Commit Graph
16477 Commits
Author SHA1 Message Date
Alex Williamson d1ecffb2a9 [IA64] Provide backing for XEN_DOMCTL_set_opt_feature
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-11-29 12:01:44 -07:00
Alex Williamson 13511bb02a [IA64] Create XEN_DOMCTL_set_opt_feature
Intended for domain builder code to be able to set architecture
specific optimization features for a domain.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-29 11:57:23 -07:00
Alex Williamson 1f9c267a70 [IA64] Create common guest_os_type domain config option
This is an optional domain config entry that may be used by
architecture specific builder code to setup various optimizations
based on the guest OS intended to run in the domain.  Based on
patch from Zhang Xin.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Acked-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-29 11:54:31 -07:00
Alex Williamson 6182926e00 [IA64] Fix assign_domain_mmio_page
Test phys_addr against efi memmap, not mpaddr.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
2007-11-28 12:38:58 -07:00
Alex Williamson 7b3e1bdc2a [IA64] Only use streamlined entry/exit for xen hypercall.
This patch allows to use ia64 specific hypercalls in vti mode.

Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-11-28 12:34:33 -07:00
Alex Williamson 8d604f8b23 [IA64] vcpu_setcontext: only set cr_irr if VGCF_SET_CR_IRR flag is set.
cr_irr can be modified even when a vcpu is blocked (by itv handler).
Unconditionally setting cr_irr can trouble debugger as it may clear a bit
of cr_irr and thus miss an interrupt.  This can be very annoying if the
interrupt is itv and the vcpu is inside PAL_HALT_LIGHT (the vcpu stays
blocked forever).

Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-11-28 12:32:28 -07:00
Alex Williamson 8e7de5ff40 [IA64] Add physical to physical data only and reverse transitions.
Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-11-26 10:07:30 -07:00
Alex Williamson 642c11adff [IA64] Extract debug_op.h from arch-ia64.h
Signed-off-by: Tristan Gingold <tgingold@free.fr>
2007-11-26 10:03:53 -07:00
Keir Fraser dbccb328c8 x86_emulate: Emulate CPUID and HLT.
vmx realmode: Fix decode & emulate loop, add hooks for CPUID, HLT and
WBINVD. Also do not hook realmode entry off of vmentry failure any
more.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-26 15:32:54 +00:00
Keir Fraser cfb9675b68 x86_emulate: Emulate LDS/LES/LFS/LGS/LSS.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-26 13:54:45 +00:00
Keir Fraser 93bae2aebc vmx realmode: Detect and correctly plumb mmio accesses from emulated
realmode. Also correctly handle debug output to I/O port 0xe9.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 21:24:48 +00:00
Keir Fraser 0d0e0d8cc0 x86_emulate: Emulate CMPS and SCAS string-compare instructions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 18:07:33 +00:00
Keir Fraser 4abb21480a x86_emulate: Emulate IRET.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 18:06:30 +00:00
Keir Fraser f96485f010 x86_emulate: Decode and emulate PUSHF/POPF.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 18:05:56 +00:00
Keir Fraser b8e219e001 x86_emulate: Allow emulated injection of exceptions and interrupts.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 18:05:10 +00:00
Keir Fraser d0b01f6dd8 x86_emulate: Emulate far call/jmp. This completes emulation of Grp5.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 12:43:13 +00:00
Keir Fraser 3c7c7376b6 vmx realmode: Support privileged EFLAGS updates in emulated realmode.
Also tweak debug tracing to be much less noisy. We can emulates tens
of thousands of instructions in rombios now.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 11:45:02 +00:00
Keir Fraser a2b5673b00 vmx realmode: Plumb through I/O port accesses in emulated realmode.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-25 11:43:53 +00:00
Keir Fraser 727f3fd5fa vt-d: Fix iommu_map_page().
Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-11-25 09:23:02 +00:00
Keir Fraser 6335a36da1 Remove unused bcopy() implementation.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 22:33:38 +00:00
Keir Fraser e88b181bba Revert 16450:5e8e82e80. Instead remove all arch-specific handling of
memcmp() and hence always use common/lib.c version.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 22:19:03 +00:00
Keir Fraser cbbb95478e vmx: Initial framework for real-mode emulation (disabled by default).
Still plenty to do:
 - i/o emulation
 - more instructions
 - interrupt/exception delivery
 - vm86 fast path
At this stage we can get three instructions into the rombios.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 21:46:14 +00:00
Keir Fraser dabf515e00 x86_emulate: Support most common segment load/save instructions.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 21:40:19 +00:00
Keir Fraser 183d8f663f x86: Fix read/write control-register in x86_emulate().
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 16:16:57 +00:00
Keir Fraser 1f0fd2f1a4 vt-d: Some fixes of Intel iommu
This patch removes a wrong if condition judgement to setup rmrr
identify mapping for guests, and passes page count rather than address
size to iommu_flush_iotlb_psi().

Signed-off-by: Weidong Han <weidong.han@intel.com>
Signed-off-by: Anthony Xu <Anthony.xu@intel.com>
2007-11-24 13:40:23 +00:00
Keir Fraser fdcf346d71 [ACM] Remove aggregate set calculations for Domain-0
Since the pre_domain_create hook is called also for Dom-0, this
special case handling is not necessary any more.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-11-24 13:39:13 +00:00
Keir Fraser 4224d67524 Fix non-optimized compilation of Xen's memcmp
Even when using __builtin_memcmp, gcc may emit external references to
memcmp (when not optimizing for instance), so this #define does not
always provide a completely suitable memcmp().

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 13:37:26 +00:00
Keir Fraser 32946b60f1 [Mini-OS] Fix domain blocking race
A callback which wakes a thread may happen between the moment
schedule() gives hand to the idle thread and the latter blocks the
domain.  Idle hence needs to atomically check that no thread is
running and block, else awoken threads may have to wait up to 10
seconds.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:31:39 +00:00
Keir Fraser 153bf11814 [Mini-OS] Permit x86_64 trap handlers to return
Trap handlers sometimes fix the problem, so they need to be able to
return.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:31:01 +00:00
Keir Fraser 26aa688655 [Mini-OS] Make sure schedule() is called safely
If a thread tries to sleep from a callback or with callbacks disabled,
Mini-OS will completely lock, so make sure this never happens.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:29:20 +00:00
Keir Fraser cf64298141 [Mini-OS] Fix netfront xmit overflow
Fix xmit overflow by making netfront_xmit sleep until
network_tx_buf_gc() frees an xmit request.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:28:54 +00:00
Keir Fraser 051f29b827 [Mini-OS] Fix net backend path leak
Free backend path after use.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:28:27 +00:00
Keir Fraser 984c5a39ec [Mini-OS] Make wake_up callback-safe
As it may compete with event handlers waking wait queues, wake_up
needs to be callback-safe.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:27:59 +00:00
Keir Fraser 00e209e059 [Mini-OS] Fix init_waitqueue_entry
Fix initialization of thread_list in init_waitqueue_entry().

Signed-off-by: Samuel Thibault <samuel.thibault@xensource.com>
2007-11-24 13:27:32 +00:00
Keir Fraser e8c2d5c38a [Mini-OS] Add init_SEMAPHORE
Add init_SEMAPHORE() to dynamically initialize semaphores.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:27:08 +00:00
Keir Fraser 59091f2d52 [Mini-OS] Make semaphores callback-safe
One may want to use semaphores in event handlers to wake threads
waiting for a resource, so semaphores then need to be callback-safe.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-24 13:26:39 +00:00
Keir Fraser 07847be650 x86, hvm: Config option to allow vmxassist to be disabled.
hvmloader is modified to dynamically detect this, allowing possibility
of optional full vmxassist replacement in 3.2 stable branch in future.
Currently 'vmxassist=y' is not much use since no replacement is
implemented.

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
2007-11-24 13:23:22 +00:00
Keir Fraser 36cb94956a [Mini-OS] Add strrchr()
Add strrchr(), useful e.g. for grabbing the last part of a xenbus
path.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:42:44 +00:00
Keir Fraser 604132c3d5 [Mini-OS] Add ENOTSUP
Add missing ENOTSUP by defining it to EOPNOTSUPP like in Linux.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:42:23 +00:00
Keir Fraser 63c4c4eabe [Mini-OS] Move _ctype into a module
Move the _ctype array into its own module, instead of having it
defined in a header.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:41:54 +00:00
Keir Fraser 29c4a80b74 vt-d: Fix ISA IRQ alias issue
When assign multiple devices to guest which uses PIC, ISA IRQ alias
may occur. This patch splits ISA IRQ and GSI eoi function. In ISA IRQ
eoi function, searches all assigned mirqs and does eoi for the
corresponding mirqs which match the eoi ISA IRQ. Therefore fix ISA IRQ
alias issue.

Signed-off-by: Weidong Han <weidong.han@intel.com>
2007-11-23 16:39:45 +00:00
Keir Fraser 9ebc5c7ea6 [Mini-OS] Make bind_virq return the port
Make bind_virq() return the port bound to the irq, which is useful
e.g. for masking/unmasking it.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:25:59 +00:00
Keir Fraser fd2f80c255 [Mini-OS] Fix x86 arch_switch_thread
Fix x86 arch_switch_thread by making it pure assembly.
There were missing general register clobbers for x86_64, and BP should
theorically be clobbered too, but gcc does not believe that, so the
only simple safe solution is to use pure assembly.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:23:28 +00:00
Keir Fraser a222af2ef1 [Mini-OS] Optimize get_current()
Let gcc perform the computation with SP itself, leading to yet better
code.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:23:03 +00:00
Keir Fraser bb44bead10 [Mini-OS] Fix stack closures
So as to make backtracing tools happy, correctly close x86 stacks for
new threads as well as on callback in the x86_32 case since there is
no unwind marker.

Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:36 +00:00
Keir Fraser 8d71c3dfb8 [Mini-OS] Fix x86 initial stack alignment
This fixes the initial stack alignment for x86, which is required for
current to return a fine NULL instead of a random value or possibly
crash during initialization.

Signed-off-by: Grzegorz Milos <gm281@cam.ac.uk>
Signed-off-by: Samuel Thibault <samuel.thibault@citrix.com>
2007-11-23 16:22:13 +00:00
Keir Fraser 255c12e851 xend: Add support for NetBSD.
Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
2007-11-23 11:58:11 +00:00
Keir Fraser 3e213e5435 hvm: Clean up VMCS/VMCB construction.
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 19:55:42 +00:00
Keir Fraser bec9e32050 x86: emulate I/O port access breakpoints
Emulate the trapping on I/O port accesses when emulating IN/OUT.

Also allow 8-byte breakpoints on x86-64 (and on i686 if the hardware
supports them), and tighten the condition for loading debug registers
during context switch.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 19:23:40 +00:00
Keir Fraser 8b831f4189 x86: single step after instruction emulation
Inject single step trap after emulating instructions if guest's
EFLAGS.TF is set.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
2007-11-22 18:28:47 +00:00