[XEN] Fix log-level printk logic for multi-line and partial-line printks.
Add support for switching to print-all mode, and use this for
debug-key output. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Remove VGCF_hvm_guest, replace with XEN_DOMINF_hvm_guest.
Rename DOMFLAGS_* to XEN_DOMINF_*.
Clean up tools to deal with flags changes. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Add 'loglvl' and 'guest_loglvl' boot parameters.
<lvl> := none|error|warning|info|debug|all
loglvl=<lvl_print_always>[/<lvl_print_ratelimit>]
<lvl_print_always>: log level which is always printed
<lvl_print_rlimit>: log level which is rate-limit printed
'loglvl' applies to non-guest-related messages.
'guest_loglvl' applies to guest-related messages.
Alastair Tse [Thu, 2 Nov 2006 18:51:23 +0000 (18:51 +0000)]
[XEND] Reverting self.domains UUID indexing
Due to localhost migration, it is possible to have two VMs with the
same UUID on the same host. So instead, we revert back to XendDomain
where there are two lists, a "domains" of active domains indexed by
domid and a "managed_domains" which is a list of all domains whose
lifecycle is managed by Xend.
[HVM] Clean up VCPU initialisation in Xen. No longer
parse HVM e820 tables in Xen (add some extra HVM parameters as a
cleaner alternative). Lots of code removal. Signed-off-by: Keir Fraser <keir@xensource.com>
Alastair Tse [Thu, 2 Nov 2006 14:26:01 +0000 (14:26 +0000)]
[XEND][XM] Fixes for xm list output
Do not output image, security if they are empty
Change xm list slightly to be more informative about state.
Add back store_mfn and console_mfn to the SXP so save/restore can work
again.
Ian Campbell [Thu, 2 Nov 2006 11:56:26 +0000 (11:56 +0000)]
PV-on-HVM: Conditionally disable checksum offload for receive on some
older kernels.
On some older kernels the CHECKSUM_UNNECESSARY flag on received
skbuffs is not honoured by all subsystems, specifically netfilter
under 2.6.9-42.EL
To work around this we need to ensure that the correct checksum is
calculated at some point. We can cause the backend to do this for us
by advertising to the backend that we cannot support checksum offload.
The correlation of this issue with the presence of NETIF_F_TSO is not
100% but it is a good first approximation.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
[XEN] Fix credit scheduler cap mechanism not to over park VCPUs
We used to park a capped VCPU when it had ran its fair share, even
if the fair share was below its cap. With this change, make sure
we only park once a VCPU has overrun its actual cap.
We could also try to make the capping mechanism more accurate by
parking and unparking at a finer granularity (currently done on
30ms boundaries) but that'll be for a different time. Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
[HVM] Move shadow initialisation into domain-creation hypercall.
Allocate HVM guest memory in the libxc builder function rather
than in xend. Clean up fall out from these changes.
Todo: Fix ia64. Move PV builder to same model (it should allocate the
memory rather than xend doing so -- then it can avoid using
xc_get_pfn_list()).
[HVM] HVM is now a flag parameter to domain-creation hypercall.
This cleans up HVM start-of-day in Xen and means that the
HVM status of a domain is maintained from cradle to grave. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEN] Extend dom0_mem syntax to support min/max clamps.
dom0_mem=[min:<min_amt>,][max:<max_amt>,][<amt>]
<min_amt>: The minimum amount of memory which should be allocated for dom0.
<max_amt>: The maximum amount of memory which should be allocated for dom0.
<amt>: The precise amount of memory to allocate for dom0.
Notes:
1. <amt> is clamped from below by <min_amt> and from above by available
memory and <max_amt>
2. <min_amt> is clamped from above by available memory and <max_amt>
3. <min_amt> is ignored if it is greater than <max_amt>
4. If <amt> is not specified, it is calculated as follows:
"All of memory is allocated to domain 0, minus 1/16th which is reserved
for uses such as DMA buffers (the reservation is clamped to 128MB)."
Each value can be specified as positive or negative:
If +ve: The specified amount is an absolute value.
If -ve: The specified amount is subtracted from total available memory.
Tim Deegan [Wed, 1 Nov 2006 10:31:11 +0000 (10:31 +0000)]
[XEN] Prefetch multiple shadow entries per pagefault
Also, clean up the shadow *_propagate/fault routines.
This allows us to quickly dispatch some guest-not-present faults
and most MMIO accesses without taking the shadow lock. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
Tim Deegan [Tue, 31 Oct 2006 16:42:46 +0000 (16:42 +0000)]
[HVM] Use correct types for guest physical addresses
Guest physical addresses are not guaranteed to fit in either a pointer
or an unsigned long int; use paddr_t for them. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
[HVM] Add support for 'add r8,m8' instruction to memory-mapped I/O. Signed-off-by: Kevin Tronkowski <ktronkowski@virtualiron.com> Signed-off-by: Ben Thomas <bthomas@virtualiron.com>
[HVM] ACPI: Clean up table definitions, move under hvmloader/
directory pending tighter integration of table generation
into hvmloader. This patch also includes the TPM TIS SSDT
generator from Stefan Berger at IBM.
Steven Smith [Tue, 31 Oct 2006 11:38:55 +0000 (11:38 +0000)]
[PV-ON-HVM] Don't generate lots of spurious interrupts when using event
channel upcalls.
The issue here was that the Xen platform PCI interrupt is only updated
when you return from the hypervisor into guest context, and so remained
asserted for a short interval after the interrupt handler ran. If
it happened that the first subsequent trap to the hypervisor was
for unmasking the 8259 interrupt again, the unmasking caused the interrupt
to be reinjected. This caused an edge on the chaining interrupt from
the slave PIC to the master. The platform interrupt on the slave
would then be cleared as we returned to the guest, and so you
eventually end up injecting an interrupt on the master chained
interrupt with nothing pending on the slave, which shows up as
a spurious interrupt in the guest.
Steven Smith [Tue, 31 Oct 2006 11:31:34 +0000 (11:31 +0000)]
[NETFRONT] Make sure we don't crash if the backend goes to state
Closing before we have a chance to connect. This can happen if
there's an error while connecting.
Steven Smith [Tue, 31 Oct 2006 10:11:53 +0000 (10:11 +0000)]
[HVM][LINUX][TOOLS] Split control/reboot_module into control/feature-reboot
and control/feature-sysrq. This is more consistent with the other
PV device protocols.
Emmanuel Ackaouy [Tue, 31 Oct 2006 10:10:17 +0000 (10:10 +0000)]
[XEN] Cleanup and optimize layout of credit scheduler stats.
Also carve out per VCPU stats for clarity and add per-VCPU
migration counter. Signed-off-by: Emmanuel Ackaouy <ack@xensource.com>
Steven Smith [Tue, 31 Oct 2006 09:54:49 +0000 (09:54 +0000)]
[HVM][LINUX][TOOLS] Make xm {shutdown|reboot} do something sensible for HVM
domains with PV drivers loaded. This patch creates a new PV-on-HVM
module, reboot.ko, which, when loaded, creates control/reboot_module
in the store. The tools notice this, and disable the watch which would
normally destroy HVM domains which are the target of an xm shutdown
command, allowing the reboot module to shut the domain down cleanly.
Signed-off-by: Tetsu Yamamoto <yamamoto.tetsu@jp.fujitsu.com>
(Checkin comments by Steven Smith <sos22@cam.ac.uk>)
[LINUX] Declare structs as 'static __initdata' where possible.
Probably still not catching all possible cases, but using static
(where not already the case) makes the code size smaller, and using __initdata
has the usual advantages.
[LINUX] privcmd: Range-check hypercall index.
Otherwise, bugs in e.g. libxc may bring the kernel down. Signed-off-by: Jan Beulich <jbeulich@novell.com>
x64 Windows uses CR8 to access TPR very frequently. This patch enables
TPR shadow and allows mov-from/to-CR8 to access it directly; tests
indicates it can boost greatly the performance of x64 Windows 2003.
Signed-off-by: Eddie Dong <eddie.dong@intel.com> Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com> Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
[HVM] Fix Qemu-dm serial issues:
1. Retry transmit via a polling timer if a byte cannot be written
immediately to its destination.
2. Turn off output processing of raw serial lines.
Ewan Mellor [Sun, 29 Oct 2006 19:28:26 +0000 (19:28 +0000)]
Fix handling of SXP for devices through device_add -- this solves the
Invalid device (uname) problem that breaks just about everything once you've
done xm block-attach.
[XEN] Some cleanups to the log-level stuff. Largely this
is a rename and slight interface change to DPRINTK (now
replaced by dprintk() and gdprintk()). Also shuffle some
log-level definitions around and tweak the semantics of
the upper threshold. Signed-off-by: Keir Fraser <keir@xensource.com>
[QEMU] Add a TIS device model compliant to the 1.2 TPM specification.
It implements all registers necessary to make the Linux TIS driver
work (tpm_tis.c). All of the basic registers supported by this type of
device are implemented. Also the locality selection has been
implemented, but has not been tested. The legacy registers as
described in the specification are not supported.
Current caveat: The device has so far not yet been integrated with the
virtual TPM available in the repository. It will require changes to
the virtual TPM spawned by the vTPM manager to offer an additional message
interface. The TIS interface itself then needs to have an additional
transport implemented. (see vTPMTransmit array).
The relevant specification for the device model can be found here:
https://www.trustedcomputinggroup.org/groups/pc_client/TCG_PCClientTPMSpecification_1-20_1-00_FINAL.pdf
[QEMU] Helper functions to interface with the xenstore and read device information from it.
- detect what types of devices a domain has or whether a domain has a
device of a certain type
- read the content of a variable related to a device, i.e.,
hotplug-status
- subscribe to changes of the hotplug status of a device for not
having to poll the status
[XEND] Do not delete VNC password from configuration.
Fixes reboot of HVM guest when VNC authentication is in use. Signed-off-by: Keir Fraser <keir@xensource.com>
[XEND] Do not delete VNC password from configuration.
Fixes reboot of HVM guest when VNC authentication is in use. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM] Fix SMP timer issues:
* Sync AP TSCs with BP at startup
* Only halt BP TSC when descheduled
* Correctly handle IPIs on timer vector Signed-off-by: Xiaowei Yang <xiaowei.yang@intel.com>
As a program that runs in dom0 which serves users from guests,
the qemu drivers need to be vigilant to the input that comes
from the guests since they may be malicious.
As it is there are multiple ways to get ne2000 to read/write
memory beyond the 48K buffer that it has allocated for each
adapter.
This patch checks the addresses and prevents this from occuring.
The boundary is checked each time since it's changed for every
packet received while the other parameters are only changed
(by the guest) during setup.
Signed-off: Herbert Xu <herbert@gondor.apana.org.au>
Emmanuel Ackaouy [Fri, 27 Oct 2006 14:44:27 +0000 (15:44 +0100)]
Improve I/O performance when competing with CPU intensive workloads.
Allow non CPU consuming wake-to-run latency sensitive VCPUs to
preempt CPU consuming ones.
Ian Campbell [Thu, 26 Oct 2006 15:56:16 +0000 (16:56 +0100)]
[TOOLS] Uncompress and allocate memory for gzipped kernel and initrd images on
the fly. We cannot rely on the length contained in the gzip trailer to determine
the length of the decompressed data because images have been observed which have
trailing junk.
Signed-off-by: Ian Campbell <ian.campbell@xensource.com>
Tim Deegan [Thu, 26 Oct 2006 14:08:20 +0000 (15:08 +0100)]
[HVM] Fix qemu's test for whether physcal addresses are RAM.
HVM guests have a memory hole below 4GB, so can't just check whether
addresses are < the amount of RAM allocated. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
[NET] back: Advertise that we do not support rx-flip path any more.
This will now be used only by older guests who do not understand
the feature-rx-{copy,flip} feature flags. Signed-off-by: Keir Fraser <keir@xensource.com>