Keir Fraser [Mon, 9 Jun 2008 08:45:38 +0000 (09:45 +0100)]
xentrace: fix tracing for 64bit guests
Xen tracing some times ago used to put values of type 'long' into the
trace buffer. This has changed to uint32_t. Some trace points log
virtual addresses, which get cropped to 32bit in this case. There were
some inline functions to handle at least PF_XEN and VMEXIT, which
caused a lot of code duplication. The attached patch fixes several
issues:
1. fix and extend tools/xentrace/formats
2. Fix xentrace_format to handle up to 7 parameters
3. create convenience macros to properly log long values
4. remove the inline functions in hvm/trace.h and replace them by macros
5. Change the CPUID trace to work correctly
6. group HVM trace points enable mechanism
I used a similar approach as in PV tracing with bit 8 indicating 64bit
pointers.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Keir Fraser [Mon, 9 Jun 2008 08:44:21 +0000 (09:44 +0100)]
AMD IOMMU: add support for PV guest
Assuming iommu_populate_page_table() is only used for PV guest, a new
check is added into assign_device() to avoid duplicating the work done
by amd_iommu_sync_p2m() for hvm guest.
Bring the DisplayState dpy_resize interface back to how it is in qemu
mainstream, thus making the code easier to merge.
In order to support sharing the framebuffer, I am adding a new resize
interface called dpy_resize_shared that also has a depth and a pixels
parameters. As a consequence I could remove the dpy_colourdepth
callback and make the code cleaner and easier to read.
Keir Fraser [Mon, 9 Jun 2008 08:36:27 +0000 (09:36 +0100)]
xm: Set device_model option value default to None.
If device_model is set to '', xend will fail to execute the device
model. If None, xend will detect it and set a sensible qemu-dm path
instead.
Keir Fraser [Thu, 5 Jun 2008 09:36:19 +0000 (10:36 +0100)]
x86 hvm: Improve paging performance for 64b solaris guests
The following patch provides a 'fast-path' for sh_remove_write_access()
for 64 bit Solaris HVM guests. This provides a significant performance
boost for such guests; our testing shows a 200-400% improvement in
microbenchmarks such as fork(), exit(), etc...
From: Gary Pennington <Gary.Pennington@sun.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Tue, 3 Jun 2008 08:41:19 +0000 (09:41 +0100)]
Improve HPET comparator reprog to prevent intr-near-missing case
HPET intr-near-missing means if the current counter value is too close
to the comparator value to be reprogrammed the expected HPET intr may
be missing. Linux kernel uses a mininal 48-hpet-ticks(~3.5us) distance
to workaround this, but personal observation showed there is still
failure case while delta=3D0xba (~13.5us). So choosing 20us as the
MIN_DELTA_NS should be helpful to prevent near-missing from happening.
local_irq_save/restore were used to avoid disturbance. (+ 2) was used
as a final guard to avoid wrong judgement due to the real happened
near-missing case.
Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Keir Fraser [Tue, 3 Jun 2008 08:35:02 +0000 (09:35 +0100)]
x86: Enhance Cx stability by adding softirq check before entry cstate
Without checking softirq_pending before entry Cx state, softirq such
as SCHEDULE_SOFTIRQ and TIMER_SOFTIRQ can't be handled timely. It may
cause severe failures such as disk I/O failure.
This patch addresses the issue above, meanwhile move timing points
closer to cstate entry/exit point to make C3 residency more accurate,
and enable irq a little earlier.
Signed-off-by: Wei Gang <gang.wei@intel.com> Signed-off-by: Tian Kevin <kevin.tian@intel.com>
Keir Fraser [Mon, 2 Jun 2008 15:05:07 +0000 (16:05 +0100)]
rombios: S3 resume fixes.
On AMD cpus, HVM S3 resume was hanging in the bios when trying
to load the x_firmware_waking_vector from absolute
address 0xEA01C (that is, a segment offset greater than 64kB).
This change also now uses 20-bits (instead of 16) from the FACS
standard firmware_waking_vector.
Keir Fraser [Mon, 2 Jun 2008 09:55:55 +0000 (10:55 +0100)]
vmx: Better diagnostic messages when VMXON might have failed due to
bad setting of the IA32_FEATURE_CONTROL MSR. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 30 May 2008 18:31:18 +0000 (19:31 +0100)]
x86: i8254 device model is shared between PV and HVM guests, so must
take care not to run hvm_get_guest_time() on a PV VCPU. The spinlock
is not initialised and spin_lock() can thus spin forever. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 30 May 2008 15:04:20 +0000 (16:04 +0100)]
Add xen_phys_start value in the crash info note
This patch makes the vmcore utilities (ex. crash, makedumpfile) be
able to get the relocation address of the xen hypervisor from a
vmcore. It is necessary for the utilities to find the data of the
hypervisor structures.
Note that this patch does not raise any comptibility issue for the
utilities (which I know) nor the other components of xen.
Keir Fraser [Fri, 30 May 2008 14:09:40 +0000 (15:09 +0100)]
[IA64] compilation fix of iommu.h
Trivial compilation fix of iommu.h.
It includes asm/msi.h for struct msi_desc and struct msi_msg
definition.
msi.h doesn't exist yet on ia64 so declare struct msi_desc and
struct msi_msg in iommu.h and don't include asm/msi.h.
Keir Fraser [Fri, 30 May 2008 14:06:08 +0000 (15:06 +0100)]
vtd: Various cleanups and fixes:
* Handle DRHDs with different supported AGAWs. To support this we
create page tables which always have 4 levels, and skip top levels
for units which support only 2 or 3 levels.
* Handle systems with mixed DRHD support for cache snooping. We must
pessimistically CLFLUSH if any DRHD does not support snooping.
Keir Fraser [Thu, 29 May 2008 08:42:59 +0000 (09:42 +0100)]
x86: Fix reboot failure after S3
"warm reset vector" is used to start APs. At booting time, it is set
by BP, and cleared after all APs have started. When do S3, similar work
need to do. However, when enable non-boot CPUs after S3, Xen just sets
this vector, but forgets to clear it after APs startup.
Keir Fraser [Wed, 28 May 2008 15:14:10 +0000 (16:14 +0100)]
vtd: More TLB flush fixes.
- Made the non-present flush testing a bit simpler.
- Removed dma_addr_level_page_maddr(). Use a modified
addr_to_dma_page_maddr() instead.
- Upon mapping new context entry: flush old entry using domid 0 and
always flush iotlb.
Keir Fraser [Wed, 28 May 2008 13:41:23 +0000 (14:41 +0100)]
iommu: Handle sibling device assignment correctly
Domctl interface is extended to allow libxc retrieve device group
information from hypervisor. Vendor-specific iommu_ops is also
extended by adding a new operation "get_device_group_id()", which is
currently a null pointer but could be implemented later for vt-d.
Error will be raised from tools side when user trying to assign PCI
device with a sibling device being driven by dom0. User will keep
being prompted until he has hidden the entire device group (at least,
the sibling devices driven by dom0) in dom0 kernel
parameter. Hopefully this framework could be flexible enough to
support both amd iommu and vt-d.
The following 2 cases are not covered by this patch, but should be
easy to handle.
* Checking for hot-plug devices (maybe we can delay calling
ImageHandler.signalDeviceModel() until all checks are done?)
* Checking for splitted device group between different passthru
domains
Keir Fraser [Wed, 28 May 2008 08:30:48 +0000 (09:30 +0100)]
stubdom: make the build more generic by moving as many stubdom parts
into stubdom/ as possible. That also permits to build all of
ioemu, c and caml stubdoms at the same time.
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
Keir Fraser [Tue, 27 May 2008 10:51:33 +0000 (11:51 +0100)]
ioemu: Force floppy disk images to be interpreted as raw.
Fixes specifying fda/fdb image names in domain configs. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Mon, 26 May 2008 07:53:25 +0000 (08:53 +0100)]
xend: take care of dead qemu-dm process
This patch fix xend as when fatal error happened (e.g. qemu-dm process
was killed) log error message then mark that domain as crashed, do
what specified on crashed in the domain config file. Added some code in
xend to check those crashed hvm DM status each 30 seconds.
Keir Fraser [Mon, 26 May 2008 07:37:43 +0000 (08:37 +0100)]
Fix domain names that xentop shows
When I changed the name of a domain by using xm rename command, the
name of the domain that xentop shows did not change. This patch
reflects new domain name to the name of domains that xentop shows.
Keir Fraser [Mon, 26 May 2008 07:24:55 +0000 (08:24 +0100)]
VT-d: remove Xen and tboot range from dom0's VT-d table
This a step forward to fix the security hole introduced by dom0's 1:1
mapping VT-d table: remove the critical code and data from it. The
more flexible solution is to update dom0's VT-d table on demand as what
will be done for other PV domains. However, there could bring a
performance issue even with software optimization. Iotlb flush of some
hardware is time-consuming.
Keir Fraser [Sat, 24 May 2008 08:45:37 +0000 (09:45 +0100)]
Handle IOMMU device assignment for PV guests
Added more informative error codes for device assignment domctls.
Introduced python bindings for device assignment and enable xend to
also perform IOMMU device assignment when assigning PCI devices.
Keir Fraser [Sat, 24 May 2008 08:42:02 +0000 (09:42 +0100)]
Handle dynamic IOMMU map/unmap for guests
Perform IOMMU map/unmap when (a) frame type changes, (b) memory
reservation changes, and (c) a grant reference is newly mapped or
completely unmapped from a domain.
Keir Fraser [Sat, 24 May 2008 08:37:35 +0000 (09:37 +0100)]
Enable IOMMU for PV guests
Introduce 'iommu_pv' boot parameter (default off). Added a need_iommu
flag which is set if guest has PCI devices assigned. IOMMU page
tables are populated with current guest memory when IOMMU is first
enabled for the guest.
Keir Fraser [Sat, 24 May 2008 08:27:03 +0000 (09:27 +0100)]
hvm: Build guest timers on monotonic system time.
Move hvm platform timers from underlying physical CPU TSC to Xen
system time and ensure domain-wide monotonicity. TSC on many systems
may skew between processors leading to 'time going backwards' messages
from some guests.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
Keir Fraser [Fri, 23 May 2008 10:58:08 +0000 (11:58 +0100)]
rombios: Remove annoying 3-second boot delay waiting for user to hit
F10 to select boot device. This will be rarely used, and it is
possible to hit F10 before the message is displayed and the keypress
will still register. So in practice it is quite possibel to use this
boot feature reliably without needing a multi-second delay.
Keir Fraser [Fri, 23 May 2008 10:15:19 +0000 (11:15 +0100)]
x86: Fix Xen boot on 8-node AMD machines
In xen/arch/x86/cpu/amd.c the function disable_c1_ramping iterates
over the northbridges using NR_CPUS as an upper bound for the number of
nodes. If there are no more northbridges found, it stops iterating.
Sadly it just adds the northbridge number to 0x18 and uses this as a
PCI device number, so probing the 9th northbridge on an 8 node system will
be caught by the newly inserted assertion in pci_conf_read in current
unstable. We fix this by first querying the number of nodes from the
first northbridge to avoid the overflow.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Verified by Mark.Johnson@sun.com
Keir Fraser [Fri, 23 May 2008 09:41:44 +0000 (10:41 +0100)]
Make ssl relocation server listen on different port
This patch makes ssl relocation server listen on 8003 if enabled.
Whether to start ssl relocation server now controlled by
xend-relocation-ssl-server. So ssl and non-ssl relocation server can
run simultaneously. You can also only start ssl server or only start
non-ssl relocation server.
When mix deploy xen 3.2 server (has no ssl support) and 3.3 servers,
start ssl and non-ssl relocation server simultaneously can keep
backward compatibility.
It's also more reasonable to have separate ports for ssl and non-ssl.
In this patch, also renames xend-relocation-tls to xend-relocation-ssl.
Signed-off-by: Zhigang Wang <zhigang.x.wang@oracle.com>
Keir Fraser [Fri, 23 May 2008 08:48:44 +0000 (09:48 +0100)]
tboot, s3: Fix S3 issue of Xen and tboot, since the structure
acpi_sleep_info is changed but some of the code in Xen is not
synchronized up with this change, which causes Xen S3 failure.
Keir Fraser [Thu, 22 May 2008 14:11:06 +0000 (15:11 +0100)]
xend: fix automatic vcpu NUMA placement
The automatic NUMA placement code (find_relaxed_node) in
XendDomainInfo.py contains several bugs:
1. The domain just created shall not be considered in the load
calculation.
2. Nodes with too less memory for the domain must be considered during
the load calculation phase and abandoned later, currently these nodes
win with a load of 0.
3. CPUs which are offline shall not be considered in load calculation.
4. (Integer-)Dividing the load value by the number of cores per node
may conceal subtle load differences resulting in a non-optimal node to
be chosen.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>