Commit Graph
15116 Commits
Author SHA1 Message Date
Alex Williamson fc073c9c01 [IA64] Replace mlock()/munlock() in ia64 libxc with un/lock_pages()
For Consistency.  Also add some missing unlock_pages().

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-20 21:23:35 -06:00
Alex Williamson 8ffb0fb8fe [IA64] Update struct checker for ia64 changes
This makes use of the union support to work with our new
vcpu_guest_context struct.

Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-05-16 11:38:48 -06:00
Alex Williamson ea87d1815f [IA64] Fix trivial compiler warning
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-05-16 11:37:19 -06:00
Alex Williamson f6cf01ff27 merge with xen-unstable.hg 2007-05-16 10:59:01 -06:00
Alex Williamson 5435198443 [IA64] Fix deadlock of ptc.ga emulation
ptc_ga_remote_func() might be invoked by IPI with a schedule_lock
that is acquired. (e.g., inside of vcpu_migrate())
It will cause a deadlock.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-05-16 10:42:07 -06:00
Alex Williamson c770486748 [IA64] Optimizations for windows
Windows use region 4 and region 5 for identity mapping.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
2007-05-15 15:32:23 -06:00
kfraser@localhost.localdomain 322a078ab1 [HVM][SVM] Reintroduce ASIDs.
ASIDs partition the physical TLB for SVM.  In the current implementation
ASIDs are used to reduce the number of TLB flushes.  Each time the
guest's virtual address space changes (e.g. due to an INVLPG,
MOV-TO-{CR3, CR4} operation), instead of flushing the TLB, a new ASID is
assigned.  This reduces the number of TLB flushes to at most 1/#ASIDs
(currently 1/64).  The biggest advantage is that hot parts of the
hypervisor's code and data remain in the TLB.

From: Sebastian Biemueller <Sebastian.Biemueller@amd.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-15 15:14:02 +01:00
kfraser@localhost.localdomain 07f8d1fdbf Fix TPM support in HVM domains
Signed-off-by:  Joseph Cihula <joseph.cihula@intel.com>
Signed-off-by:  Peter Yang <peisen.yang@intel.com>
2007-05-15 10:50:09 +01:00
kfraser@localhost.localdomain 59f97292fa xenapi: Small fix to the host.get_name_description call
Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
2007-05-15 10:49:10 +01:00
kfraser@localhost.localdomain 396211ae01 x86/hvm: HVM_DBG_LOG() cleanup
- make log levels used consistent in a few places
- remove trailing newlines, dots, and commas
- remove explictly specified function names from message text

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:46:43 +01:00
kfraser@localhost.localdomain 12a056ebf3 vmx: remove CSTAR save/restore on VMX
CSTAR is an unused MSR in 64-bit mode on Intel's EM64T, hence there's
no need to save/restore this MSR during context switches. Mimic real
hardware by retaining the value written for eventual guest OS reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:46:03 +01:00
kfraser@localhost.localdomain 89130c31e5 x86/hvm: add logging for hypercalls
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:43:59 +01:00
kfraser@localhost.localdomain f1bd686887 x86: fix EFER handling
Introduce a per-CPU shadow of what is currently in EFER, as context
switch code must re-write this MSR so that all guests run with
appropriate EFER.SCE and EFER.NX settings. Remove EFER from the set of
MSRs that VMX deals with in a generic fashion.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:43:18 +01:00
kfraser@localhost.localdomain 71adf3c9eb x86/hvm: hypercall adjustments
- share more code between 32- and 64-bit variants
- properly handle continuations for 32-bit guests on 64-bit hv
- properly handle preemption (this must *not* rely on regs->eip, as
- other code may overwrite the value there by calling
- hvm_store_cpu_guest_regs()
- deny hypercall access when called from guest in vm86 mode, which
  requires that ???_guest_x86_mode() make real and vm86 modes distinguishable

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:28:28 +01:00
kfraser@localhost.localdomain f78175be51 x86-64/hvm: pio result storing
Don't clear upper 32 bits on 8- and 16-bit PIO reads.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:13:11 +01:00
kfraser@localhost.localdomain 76328d5bec x86: ptwr adjustments
Make sure MFN read from pte is valid before accessing the page info
structure associated with it. Drop guest-to-machine-physical
translation from ptwr code.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:12:02 +01:00
kfraser@localhost.localdomain 3490d2804a x86: replace some intpte_t * casts
Don't cast values when other (type safe) mechanisms are available to =
achieve the same effect.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:08:20 +01:00
kfraser@localhost.localdomain f95c4d2e4a x86: kill unused local variable sh_mapcache
Apparently a leaf-over from pre-3.0.3.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:03:58 +01:00
kfraser@localhost.localdomain 4fcd011a83 tools: check for curl-devel and libxml2-devel
when they are required for LIBXENAPI_BINDINGS.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:03:14 +01:00
kfraser@localhost.localdomain 67770ae5ab tools: check for libvncserver dependency libraries
Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 10:01:14 +01:00
kfraser@localhost.localdomain b4a663b87d 64-bit hvm on 32-bit dom0 - ioemu adjustments
Don't mask off data bits when running 64-bit hvm guests on 32-bit dom0.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 09:59:51 +01:00
kfraser@localhost.localdomain ddb76c5b25 x86: suppress SYSCALL feature for 32on64 guests
since Xen cannot handle it.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 09:54:27 +01:00
kfraser@localhost.localdomain cb16c56482 x86: invalidate_shadow_ldt() should be static
Since invalidate_shadow_ldt() depends on process_deferred_ops() to be
called, it shouldn't be visible outside xen/arch/x86/mm.c.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
2007-05-15 09:50:36 +01:00
Alex Williamson 8a9d7de961 [IA64] White space cleanup in regionreg.h
Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-14 12:54:26 -06:00
Alex Williamson 8522e94583 [IA64] Fix ptc.ga emulation
cset14829(c42ae7839750) was incomplete.

The region register 0 will be clobbered as follows.

time    pcpu0   pcpu1   pcpu2
 |      vcpu0   vcpu1   idle  // assignment of vcpu
 V
        1.vcpu0 issues ptc.ga
        2.vcpu0 sends IPI to vcpu1(pcpu1)
                3.vcpu1 migrates from pcpu1 to pcpu2
                4.pcpu1 receives IPI of 2 and exec ptc_ga_remote_func()
                5.pcpu1 saves and modifies vrr[0]
                        6.vcpu1(pcpu2) modifies vrr[0]
                7.pcpu1 restores vrr[0]         // vrr[0] of 6 is lost

Windows will crash due to this issue.

Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
2007-05-14 11:52:01 -06:00
Alex Williamson f1bfaa9e03 [IA64] Compilation fix with CRASH_DEBUG defined.
Update for guest_mode()

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-14 11:13:24 -06:00
Steven Hand 415b7c6f46 Fix HVM save/restore after upgrade to 0.90.
Signed-off-by: Steven Hand <steven@xensource.com>
2007-05-14 15:19:46 +01:00
Steven Hand f0c155875d HVM save/restore: handle larger domain ids.
Signed-off-by: Steven Hand <steven@xensource.com>
2007-05-14 15:16:32 +01:00
Keir Fraser 45138b4b05 hvm qemu: Fix for masking 64-bit operands broke 32-bit operands with
32-bit qemu. Issue spotted and initial fix provided by Dexuan Cui.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-13 10:04:34 +01:00
Keir Fraser 2c4aacf734 svm: Simplify asm stub for vmentry/vmexit.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 19:22:24 +01:00
Keir Fraser f64b7618e1 svm: Avoid VMSAVE/VMLOAD/VMSAVE/VMLOAD sequence on every vmexit/vmentry.
Instead do this only on context switches. In cases where we need
access to state that is only saved to the VMCB on VMSAVE, we track
whether the state is in sync via a per-vcpu flag and VMSAVE on demand.

The context switch code can be further improved:
 1. No need to VMLOAD host state if we are switching to another SVM  VCPU.
 2. No need to VMSAVE host state at all (except once at start of day)
 because the registers that are saved do not change (or at least, none
 of the ones that matter change).

The performance is improvement is about 650 cycles for a null
hypercall. This reduces the total null-hypercall time for a non-debug
build of Xen down to around 3300 cycles on my AMD X2 system.

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 19:04:35 +01:00
Keir Fraser 8665aa44c3 hvm: Fix ACPI shutdown, broken by my previous changeset.
It turns out that although PIIX4 hardware defines the S5 type code to
be 000, all OSes will discover the correct code by evlauating an \_Sx
object in the ACPI DSDT. And we set the type code in that object to be
111.

So this patch keeps the other cleanups made to the piix4acpi.c file,
but switches back to checking for code 111. It also makes it clearer
in both the ioemu code and in the dsdt source code where these magic
numbers come from.

Let's hope noone actually has the true PIIX4 type codes hardcoded
(it's highly doubtful that anyone would).

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 16:24:50 +01:00
Keir Fraser f313852e91 vmx: Replace pointless test-then-set with set.
Spotted by Eddie Dong.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 12:46:26 +01:00
Keir Fraser 253a9fcaf4 xend: configuration option 'localtime = 1' is not honored for PV domains.
This patch fixes an oversight when platform_* config options were
collected in a dictionary.

Signed-off-by: Jim Fehlig <jfehlig@novell.com>
2007-05-12 12:44:20 +01:00
Keir Fraser a4bc02d9dd xen: Fix struct-size checker for unions and long names.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
2007-05-12 12:43:16 +01:00
Keir Fraser 4d6bc05812 hvm qemu: Fix write parameter masking for 64-bit guests.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 12:41:40 +01:00
Keir Fraser a4c4c5f134 xen: Better handling on not-present PDEs in destroy_xen_mappings().
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 12:37:51 +01:00
Keir Fraser 7c9f1018ee x86: Improve zap_low_mappings.
Do it earlier on x86/64, properly free non-superpages on x86/32, and
leave a mapping of the boot trampoline (0x90000-0xA0000) in place.

Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 12:07:01 +01:00
Keir Fraser 39f1622a28 xen: Free initmem after boot. Mark lots of init functions as __init
that weren't before.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 10:28:53 +01:00
Keir Fraser 34df2e48f9 hvm: Fix emulation of PIIX4 PMCNTRL register for soft power-off.
The type code needs to be 000, not 111 (which is a reserved value).
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-12 09:48:33 +01:00
Alex Williamson 2cf8e750ad [IA64] get guest os type
This patch is to use GFW ACPI_OSI to identify guest OS type.
When ACPI_OSI gets OS type, it writes to a reserved port a
special val. then XEN can know the guest OS type.

NB. Linux returns true both for _OSI(linux) and _OSI(windows)

Signed-off-by: Zhang Xin <xing.z.zhang@intel.com>
Signed-off-by: Anthony Xu <anthony.xu@intel.com>
2007-05-11 13:15:53 -06:00
Alex Williamson 625f73d3df [IA64] Fix allocate_rid_range()
Though there is a free ridblock_owner[], allocate_rid_range()
cannot allocate it.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-05-11 13:09:12 -06:00
Alex Williamson 4327b1944f [IA64] Return ENOMEM if VPD allocation failed
Usually ASSRET() is "(void)0".  Therefore if VPD allocation
fails with xenheap shortage or fragmentation, NULL pointer
access occurs in vmx_final_setup_guest().
This patch fixes it.

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
2007-05-11 13:07:04 -06:00
Christian Limpach 1946d15507 [qemu patches] Update patches upto changeset 15040:090ca10cb543.
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2007-05-11 10:07:06 +01:00
Christian Limpach dc53960c99 [qemu] Fix ia64 after removal of ia64_intrinsic.h.
From: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Christian Limpach <Christian.Limpach@xensource.com>
2007-05-11 10:06:19 +01:00
Keir Fraser db82fef5d6 svm: Rationalise register synchronisation to be similar to our vmx
handling.
 1. Do not copy all VMCB register state in cpu_user_regs on every
 vmexit.
 2. Save/restore RAX inside asm stub (in particular, before STGI on
 vmexit).
 3. Simplify store/load_cpu_guest_regs() hook functions to synchronise
 precisely the same state as VMX.

By my measurements this reduces the round-trip latency for a null
hypercall by around 150 cycles. This is about 3% of the ~5000-cycle
total on my AMD X2 system. Not a great win, but a nice extra on top of
the code rationalisation.
2007-05-10 23:49:04 +01:00
Alex Williamson 095859f49a [IA64] Implement XENMEM_machine_memory_map on ia64.
This is necessary for kexec/kdump for xen/ia64. kexec-tools needs to know
real machine's memory map.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-10 15:55:22 -06:00
Keir Fraser 72a9bb3cfb xen: Some cleanups for x86 start of day.
1. Remove erroneous modification to e820.c
2. Make sure Xen is relocated as high as possible below 4GB.
Signed-off-by: Keir Fraser <keir@xensource.com>
2007-05-10 22:54:43 +01:00
Alex Williamson 2285f577b1 [IA64] Handle speculative vhpt walk
Since processor may support speculative VHPT walk,
The long format VHPT head entry needs to be disabled
before programming it.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
2007-05-10 15:46:30 -06:00
Alex Williamson d84c659b3a [IA64] Quiet lookup_domain_mpa() when domain is dying.
Message clean up in lookup_domain_mpa(). It is possible that current != d.

This patch addresses xensource bugzilla #944

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
2007-05-10 15:18:27 -06:00