[IA64] let VMM do itc sync for guest on VTI domain
Previously, on SMP VTI-domain, Guest OS was responsible for
syncing itc by calling ia64_sync_itc, but the round trip may
be very large on VTI domain, that may cause guest itcs are
not synced well and cause guest wall clock is not accurate.
This patch intends to fix this issue, when guest wants to sync
itc( vcpus other than vcpu0 write itc), VMM directly get vcpu0
itc for other vcpus.
Now guest vhpt table of VMX domain is searched to insert some
entry into vtlb on the fly. However previous guard on memory
attribute is only done for guest itc.d emulation. That breaks
VGA acceleration and this patch fixes it by moving check to
right place.
[IA64] cleanup warning in xen/arch/ia64/linux-xen/time.c
Remove a wrong cleanup in xen/arch/ia64/linux-xen/time.c
itc_ratio.num and itc_ratio.den are defined u64
in xen/include/asm-ia64/linux-xen/asm/pal.h.
These are the below.
typedef struct pal_freq_ratio {
u64 den : 32, num : 32; /* numerator & denominator */
} itc_ratio, proc_ratio;
This is a port of a newer upsteam efi.c to xen/ia64. For the most
part, this patch is simply incorporating this upstream linux-ia64
patch into the tree:
To support this new code, xensetup needed to be modified to relocate
the dom0 kernel and initrd images without using efi_memmap_walk() as
this can no longer be called until after reserve_memory(). The dom0
kernel and initrd images are now only moved if necessary and the xen
MDT entry is expanded to cover the xenheap area and any relocated dom0
bits.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEN] Fix compatibility with future guests which may try to
use hypercalls >= NR_hypercalls. These must fail with ENOSYS,
but the current strategy of masking off the high-order bits of
the hypercall number means we instead map those hypercalls onto
lower-numbered hypercalls with unpredictable results. This patch
replaces masking with an explicit compare-and-jump. Signed-off-by: Keir Fraser <keir@xensource.com>
Fix race in device resume path - need to ensure we add the watch only
after the device-specific resume code has run. Also removed some unused /
usless code from netfront.c.
[LINUX] Fix interaction between idle loop and RCU subsystem.
There is a problem with the current implementation of stop_hz_timer in
arch/i386/kernel/time-xen.c where the hz timer can be stopped on a CPU
which has RCU callbacks pending.
This patch backports a new RCU API created to fix this problem for the
s390 implementation of stop_hz_timer and also updates the time-xen.c
implementation of stop_hz_timer to call the new API.
Signed-off-by: Harry Butterworth <butterwo@uk.ibm.com>
[HVM][VMX] Fix the build with certain versions of gcc.
Restrict register choices to this which are byte addressable. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM][VMX] Provide right view of cpuid to the HVM guests.
Some of the CPU features such as APIC, PAE, MTRR, HT are virtualized;
while others are not virtualized yet such as TM1, TM2, MCA and there are
some features which do not need virtualization such as MMX. With the
patch Guest sees only those processor features in the cpuid which are
virtualized in the hyper visor, or do not need any virtualization in
hypervisor.
Signed-off-by: Nitin A Kamble <nitin.a.kamble@intel.com> Signed-off-by: Jun Nakajima <jun.nakajima@intel.com> Signed-off-by: Asit Mallick <asit.k.mallick@intel.com>
[HVM][DM] Backport the USB support from QEMU 0.8.1 to the current Xen
device model. To support USB there are two new optional config lines
that can be added to the guest config file:
usb=1
This will enable USB without defining a specific USB device.
This option is assumed and not needed if the `usbdevice' option
is given.
usbdevice='device'
This will enable USB and also enable support for the given device.
Currently, the only two devices are `mouse' (a PS/2 mouse) and
`tablet' (an absolute pointing device). The advantage of `tablet'
is that Windows guests will automatically recognize and support this
device so specifying the config line:
usbdevice='tablet'
will create a mouse that works transparently with Windows guests
under VNC. (Linux doesn't recognize the USB tablet yet so Linux
guests under VNC will still need the Summagraphics emulation.)
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
[HVM][VMX] Cleanups and fixes to VMCS lifecycle.
1. Maintain a 'launched' software flag to select between
VMLAUNCH and VMRESUME.
2. Take more care with VMPTRLD/VMCLEAR.
Also various other fixes (e.g., safe testing of
condition codes after executing a VMX instruction).
[LINUX] Fix IRQ SMP affinity logic for event channels.
The logic now mimics native x86 behaviour: a request to change
affinity via /proc is held until the next interrupt on that
event channel. So /proc/irq/n/smp_affinity may not change
immediately!
Other notes:
1. CPU-specific interrupts silently ignore requests to change
affinity. For example, resched0, timer0, callfunc0, ...
2. Reading smp_affinity always returns a cpumask containing
a single cpu. An event channel can only be bound to a single
cpu at a time. Neither Xen nor XenLinux implement IRQ
balancing: requires a user-space balancing daemon.
[XEN] Replace direct common-code access of evtchn_upcall_mask
with local_event_delivery_* accessors.
Notes:
1. Still some (read-only, debug) use in keyhandler.c
2. Still accesses through current->vcpu_info.
Both above may need to be compiled only for architectures
that use event channels.
[LINUX] Remove the only use of evtchn_upcall_mask in common code.
Replace with an assertion of irq_disabled(). Signed-off-by: Keir Fraser <keir@xensource.com>
[IA64] passthrough EFI_ACPI_MEMORY_NVS and EFI_RESERVED_TYPE
According to the EFI spec, firmware may describe ACPI tables loaded
at runtime in EFI_RESERVED_TYPE or EFI_ACPI_MEMORY_NVS memory ranges.
This patch adds these to the list of memory types we pass through for
dom0. This allows Xen to boot on HP Superdomes.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEN] VCPU operation register_runstate should work even when
called from non-local VCPU. Necessary as Linux always calls
this operation from VCPU0 during secondary-VCPU bringup. Signed-off-by: Keir Fraser <keir@xensource.com>
[ACM] Replace enumerations with macros with qualified names.
Old unqualified enumeration names polluted the global namespace. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Simplify /proc/iomem initialisation -- no need to fake a
domU memory map. The main e820 map already terminates at max_pfn. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX][X86/64] Initialise pages outside initial allocation so that
they are picked up by the balloon driver.
From: Jan Beulich Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX][XENBUS] replace xenbus_transaction_t with an opaque transaction ID.
xenbus_transaction_t -> struct xenbus_transaction, which just contains
a single u32. Also renamed XBT_NULL to XBT_NIL to emphasize that it
isn't a NULL pointer, but a NIL transaction ID. Compile and boot tested.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
[chrisw: updated for xen-unstable from patchqueue] Signed-off-by: Chris Wright <chrisw@sous-sol.org>
[LINUX][XENBUS] Drop (struct xenbus_device)->data, and simply use ->dev.driver_data
instead, since that's what it is there for. Similar to patch
in patchqueue started by Jeremy, and expanded by me to include all
relevant drivers in xen-unstable.
Cc: Jeremy Fitzhardinge <jeremy@xensource.com> Signed-off-by: Chris Wright <chrisw@sous-sol.org>
[LINUX] Use structs not typedefs, remove trailing whitespaces, place symbol
EXPORTs with functions, order includes, eliminate unsed macros, don't
initialize static data to NULL, etc. Cleanups from patchqueue.
[NET] front: There's a small leak on a couple error paths in setup_device().
While there rearrange the ring setup order slightly to simplify error
path since netif_free() will cleanup once ring_ref is valid. And use
get_zeroed_page() instead of __get_free_page()/memset(). Handle error if
bind_evtchn_to_irqhandler() fails, as bad info->irq value is likely to
cause oops later. In create_device(), gnttab_free_grant_references()
is accidentally called twice on tx_head during cleanup from failed
gnttab_alloc_grant_references() on rx_head, which could corrupt
gnttab_free_count.
Here's a first pass at some sparse tree cleanups based on feedback
we've gotten on linux-ia64. I haven't taken all of the comments into
account yet, this is just a start. Specific changes:
- CONFIG_ARCH_XEN is no longer necessary
- simple is_running_on_xen() checks can be handled w/o CONFIG_XEN
- pulled forward a drivers/xen/Makefile change that broken make clean
- changed some comments from C++ style to C
- turned HYPERVISOR_ioremap into a macro for !CONFIG_XEN
- made hypervisor.h and privop.h include-able for !CONFIG_XEN
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[XEN] Reduce default maximum allocation order from 2^20 pages to 2^11.
On x86 this corresponds to a maximum aligned contiguous allocation of 8MB.
This can be overridden by architectures if need be. Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Set up /proc/iomem in a sensibel way to indicate
code & data resources, and a RAM area on domU.
From: Gerd Hoffmann <kraxel@suse.de> Signed-off-by: Keir Fraser <keir@xensource.com>
[LINUX] Only trigger unhandled irq path if irq is not shared across
multiple guests (another guest may have handled the interrupt). Signed-off-by: Keir Fraser <keir@xensource.com>
[TOOLS] Fix domain builder to carefully check that mapped memory area
does not overflow and wrap to zero. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVM][MMIO] Support decode of 0x83 opcode (or imm8,m32/64').
This instruction is used by both WinXP during an SMP installation and by
Sun Solaris. With this patch Sun Solaris UP is able to boot. Windows
SMP gets a bit further but still has issues.
Signed-off-by: Tom Woller <thomas.woller@amd.com> Signed-off-by: Travis Betak <tbetak.woller@amd.com>
[HVM][DM] Cleaner way of clearing VGA memory on mode changes (thanks to
Fabrice Bellard on the QEMU project). This patch clears the
memory in the BIOS call rather than when the Cirrus Logic register changes,
which more closely matches what happens on the real hardware.
Signed-off-by: Don Dugger <donald.d.dugger@intel.com>
[LIBXC] Convert all printf/fprintf uses to use a macro instead.
Thus all can be disabled at compile time. It would be easy to
make enabling/disabling a run-time option too. Signed-off-by: Keir Fraser <keir@xensource.com>
[HVMLOADER] Revert to uniprocessor MPS table in rombios.
Advertising more CPUs than the guest is allocated hangs boot
of Windows XP (selects wrong HAL). The correct fix here is
to dynamically generate the MPS table (at least the CPU
entries) from hvmloader binary. Signed-off-by: Keir Fraser <keir@xensource.com>
Clean up event wait sequence in io emulation path, as a critical
fix to a severe issue where VTI domain may fall into block state
when doing bulk network transfer.
Use explicitly-sized types in the dom0_ops and privcmd structures.
As discussed previously, the these operations are not performance-sensitive, so
the additional cache footprint shouldn't be an issue.
Represent PFNs with their own type, rather than 'unsigned long'.
('long' changes size and alignment between 32- and 64-bit ABIs.) Signed-off-by: Hollis Blanchard <hollisb@us.ibm.com>
[NET] front: Turn grant-ref error into a fatal bug. That's the best we
can do until we have a backend driver recovery method. Signed-off-by: Keir Fraser <keir@xensource.com>
[X86EMUL] Mark MOV instruction as not needing writeback.
Fix the test harness for x86/64 -- map emulated addresses
to low 4GB of address space. Signed-off-by: Keir Fraser <keir@xensource.com>
After enabling dom0_vp mode, we lost the VGA console.
The reason is that VGA frame buffer(0xa0000-0xc0000) was set
to conventional memory not IO in dom0's p2m table.
Low conventional memory ranges are also given MDT entries for
dom0 to allow Linux to properly detect whether VGA is present.
Signed-off-by: Zhang xiantao <xiantao.zhang@intel.com> Signed-off-by: Alex Williamson <alex.williamson@hp.com>
[HVM][VMX] Interrupts must be kept disabled when entering Xen for
external interrupt processing. Remove code that immediately
reenabled interrupt delivery on VMEXIT. Signed-off-by: Seteven Smith <sos22@cam.ac.uk> Signed-off-by: Keir Fraser <keir@xensource.com>
This patch adds scatter-and-gather transmission support to the frontend.
This allows the MTU to be raised right now and the potential for TSO in
future.
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>