aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-x86/hvm/support.h
Commit message (Collapse)AuthorAgeFilesLines
* x86: fix XCR0 handlingJan Beulich2013-06-041-1/+1
| | | | | | | | | | | | | | - both VMX and SVM ignored the ECX input to XSETBV - both SVM and VMX used the full 64-bit RAX when calculating the input mask to XSETBV - faults on XSETBV did not get recovered from Also consolidate the handling for PV and HVM into a single function, and make the per-CPU variable "xcr0" static to xstate.c. Signed-off-by: Jan Beulich <jbeulich@suse.com> Acked-by: Keir Fraser <keir@xen.org> Acked-by: George Dunlap <george.dunlap@eu.citrix.com>
* xen: Include headers that are actually needed, drop everything else.Christoph Egger2011-05-201-2/+2
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* vmx/hvm: move mov-cr handling functions to generic HVM codeKeir Fraser2011-04-181-0/+2
| | | | | | | | | Currently the handling of CR accesses intercepts is done much differently in SVM and VMX. For future usage move the VMX part into the generic HVM path and use the exported functions. Signed-off-by: Andre Przywara <andre.przywara@amd.com> Signed-off-by: Keir Fraser <keir@xen.org>
* x86: redefine a few empty macros as explicit nops.Tim Deegan2011-03-071-1/+1
| | | | | | | This is needed to compile xen with clang. Signed-off-by: Tim Deegan <Tim.Deegan@citrix.com> Acked-by: Keir Fraser <keir@xen.org>
* amd xsave: Enable XSAVE/XRSTOR for SVM guestKeir Fraser2010-12-071-0/+2
| | | | | | This patch creates a common interface hanlding xsetbv. Signed-off-by: Wei Huang <wei.huang2@amd.com>
* x86 hvm: msr-handling cleanupKeir Fraser2010-06-101-2/+2
| | | | Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
* x86: Fail CPU bringup cleanly if it cannot initialise HVM.Keir Fraser2010-05-191-2/+0
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* The internal Xen x86 emulator is fixed to handle shared/sharable pages corretly.Keir Fraser2009-12-171-0/+1
| | | | | | | | | If pages cannot be unshared immediately (due to lack of free memory required to create private copies) the VCPU under emulation is paused, and the emulator returns X86EMUL_RETRY, which will get resolved after some memory is freed back to Xen (possibly through host paging). Signed-off-by: Grzegorz Milos <Grzegorz.Milos@citrix.com>
* Memory paging support for HVM guest emulation.Keir Fraser2009-12-171-1/+2
| | | | | | | | | | A new HVMCOPY return value, HVMCOPY_gfn_paged_out is defined to indicate that a gfn was paged out. This value and PFEC_page_paged, as appropriate, are caught and passed up as X86EMUL_RETRY to the emulator. This will cause the emulator to keep retrying the operation until is succeeds (once the page has been paged in). Signed-off-by: Patrick Colp <Patrick.Colp@citrix.com>
* Extend max vcpu number for HVM guestKeir Fraser2009-10-291-2/+2
| | | | | | | | | | | | | | Reduce size of Xen-qemu shared ioreq structure to 32 bytes. This has two advantages: 1. We can support up to 128 VCPUs with a single shared page 2. If/when we want to go beyond 128 VCPUs, a whole number of ioreq_t structures will pack into a single shared page, so a multi-page array will have no ioreq_t straddling a page boundary Also, while modifying qemu, replace a 32-entry vcpu-indexed array with a dynamically-allocated array. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: softtsc for PV domainsKeir Fraser2009-08-271-1/+0
| | | | | | | | | | | | Implement softtsc (TSC emulation) for userland code in PV domains. It currently is tied to the existing "softtsc" Xen boot option (which does the same thing but for HVM domains). Later it should be tied to a vm.cfg option, but this is sufficient for now to obtain performance degradation data for PV environments that heavily utilize rdtsc. To record emulation frequency, use debug-key "s". Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* Mapping grant references into HVM guests, take 2Keir Fraser2009-07-131-1/+2
| | | | | | | | | | | | | After some discussion, here's a second version of the patch I posted a couple of weeks back to map grant references into HVM guests. As before, this is done by modifying the P2M map, but this time there's no new hypercall to do it. Instead, the existing GNTTABOP_map is overloaded to perform a P2M mapping if called from a shadow mode translate guest. This matches the IA64 API. Signed-off-by: Steven Smith <steven.smith@citrix.com> Acked-by: Tim Deegan <tim.deegan@citrix.com> CC: Bhaskar Jayaraman <Bhaskar.Jayaraman@lsi.com>
* x86 hvm: New boot option 'softtsc' to cause RDTSC to be trapped-and-emulated.Keir Fraser2008-07-101-0/+3
| | | | | Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86, hvm: Lots of MTRR/PAT emulation cleanup.Keir Fraser2008-04-161-0/+2
| | | | | | | | | | - Move MTRR MSR initialisation into hvmloader. - Simplify initialisation logic by overlaying UC on default WB rather than vice versa. - Clean up hypervisor HVM MTRR/PAE code's interface with rest of hypervisor. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: Code cleanups.Keir Fraser2008-03-281-18/+1
| | | | Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86_emulate: Check I/O port accesses.Keir Fraser2008-03-271-7/+11
| | | | | | | Implements both CPL/IOPL and TSS-bitmap checks. Requires changes to read/write callback hooks to disable user-access checks when walking pagetables on behalf of GDT/LDT/TSS accesses. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: Allow bitop functions to be applied only to fields of at least 4Keir Fraser2008-03-161-1/+1
| | | | | | | | | | | | | bytes. Otherwise the 'longword' processor instructions used will overlap with adjacent fields with unpredictable consequences. This change requires some code fixup and just a few casts (mainly when operating on guest-shared fields which cannot be changed, and which by observation are clearly safe). Based on ideas from Jan Beulich <jbeulich@novell.com> Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86 hvm: Replace old MMIO emulator with x86_emulate()-based harness.Keir Fraser2008-02-201-0/+1
| | | | | Re-factor VMX real-mode emulation to use the same harness. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* hvm: For functions which translate virtual addresses to machineKeir Fraser2007-12-271-5/+44
| | | | | | | | | | | | | addresses, page faults should only be raised when the gva->gfn translation fails. These should be distinguished from gfn->mfn translation failures. The main effect of this is to change the behaviour of functions derived from __hvm_copy(), which now returns a three-way enumeration, and also can automatically inject #PF when the gva->gfn translation fails. Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
* x86: single step after instruction emulationKeir Fraser2007-11-221-1/+1
| | | | | | | | 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>
* [SHADOW] Make the guest PT walker more complete.Tim Deegan2007-11-021-0/+1
| | | | | | | | | | | | We now check access rights and write back the _PAGE_ACCESSED and _PAGE_DIRTY bits into the guest entries as we walk the tables. This makes the shadow fault handler simpler, and the various emulation paths more correct. This patch doesn't add checking and write-back to the HAP pagetable walker; it just fixes up its arguments to match the new shadow one. Signed-off-by: Tim Deegan <Tim.Deegan@eu.citrix.com>
* hvm/x86: MTRR/PAT virtualisation.Keir Fraser2007-10-221-0/+1
| | | | Signed-off-by: Disheng Su <disheng.su@intel.com>
* Split asm-x86/hvm/support into arch generic part and x86 specific part.Keir Fraser2007-10-181-138/+1
| | | | Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
* hvm: Clean up EFER handling. Check CR0/CR4/EFER on HVM restore.Keir Fraser2007-09-281-0/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* hvm: Unify %cr0 handling.kfraser@localhost.localdomain2007-08-081-0/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* hvm: More cleanups, particularly to %cr4 handling.kfraser@localhost.localdomain2007-08-081-0/+1
| | | | | Signed-off-by: Keir Fraser <keir@xensource.com> Signed-off-by: Xin Li <xin.b.li@intel.com>
* hvm: Clean up control-register and EFER handling.kfraser@localhost.localdomain2007-08-071-0/+2
| | | | | No semantic changes. :-) Signed-off-by: Keir Fraser <keir@xensource.com>
* x86: Various cleanups around CR4 handling, cpu_possible_map, and VMX ↵kfraser@localhost.localdomain2007-07-121-1/+0
| | | | | | initialisation. Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM][SVM] flush all entries from guest ASIDs when xen writes CR3.Tim Deegan2007-06-201-1/+0
| | | | | | | This makes the assumptions about TLB flush behaviour in the page-type system and the shadow code safe again, and fixes a corner case of NPT log-dirty. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* x86/hvm: add logging for hypercallskfraser@localhost.localdomain2007-05-151-0/+1
| | | | Signed-off-by: Jan Beulich <jbeulich@novell.com>
* hvm: Clean up treatment of is_dying per-domain boolean. All criticalKeir Fraser2007-04-131-7/+6
| | | | | | | | | | checks are done under an appropriate lock, allowing the lock-free protocols surrounding this boolean to be removed. Also simplification and fixes to code for setting/zapping the ioreq and buf_ioreq shared pages. Signed-off-by: Keir Fraser <keir@xensource.com>
* PV-on-HVM: Add new ioreq 'invalidate' for zapping ioemu-dm mapccahekfraser@localhost.localdomain2007-04-051-0/+3
| | | | | | | | | | | | | after balloon operations in an HVM guest. This removes the I/O port hack from the guest OS, and from ioemu. Also we flush on reservation *increases* as well as decreases. This is necessary until qemu-dm can demand-fault page mappings into existing valid buckets. Signed-off-by: Steven Hand <steven@xensource.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* Initial check-in to support PV balloon driver within HVM guests.Steven Hand2007-04-041-1/+1
| | | | | | | | | Still todo: - fix mapcache invalidation (should happen in Xen) - support 32-on-64 mode correctly Signed-off-by: Steven Hand <steven@xensource.com>
* hvm vmx: VMX MSR bitmap format and size is VMX-specific, so move itskfraser@localhost.localdomain2007-04-021-1/+0
| | | | | allocation and initialisation into VMX-specific code. Signed-off-by: Keir Fraser <keir@xensource.com>
* Enable VMX MSR bitmap support.kfraser@localhost.localdomain2007-03-291-0/+1
| | | | | | | | We use it to avoid VMExits on FS_BASE and GS_BASE MSR accesses. Signed-off-by: Weidong Han <weidong.han@intel.com> Signed-off-by: Xin Li <xin.b.li@intel.com> Signed-off-by: Keir Fraser <keir@xensource.com>
* hvm: Clean up handling of exception intercepts.Keir Fraser2007-03-281-39/+0
| | | | | Only intercept #DB/#BP if a debugger is attached. Signed-off-by: Keir Fraser <keir@xensource.com>
* Don't trap int3 instructions by default - can have a major overhead inSteven Hand2007-03-281-2/+1
| | | | | | certain cases, and typically not used for anything. Signed-off-by: Steven Hand <steven@xensource.com>
* hvm: Only do hvm_disable() on HVM-enabled systems.kfraser@localhost.localdomain2007-02-281-0/+1
| | | | | Original patch by Jan Beulich. Signed-off-by: Keir Fraser <keir@xensource.com>
* [xentrace][HVM] introduce HVM tracing to unify SVM and VMX tracingkfraser@localhost.localdomain2007-02-261-3/+0
| | | | | | | | | | | | | | * new tracing class TRC_HVM replacing TRC_VMX * 20 new trace events to differentiate the information carried by them ** added corresponding trace points in SVM and VMX code ** updated formats file: descriptive formatting of trace event data ** completely replacing previous simple tracing in VMX * possibility to toggle single events on and off at compile time in include/asm-x86/hvm/trace.h Signed-off-by: Thomas Friebel <thomas.friebel@amd.com>
* hvm: Clean up initialisation of hvm_funcs.kfraser@localhost.localdomain2007-02-231-1/+1
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] Save/restore: dynamically calculate the size of the save bufferTim Deegan2007-02-071-10/+24
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: clean up the new hypercall interfaceTim Deegan2007-01-311-0/+7
| | | | | | | Pass a buffer and size through instead of fixed-size structure. Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: save RTC state.Tim Deegan2007-01-311-7/+8
| | | | Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore: clean up marshalling codeTim Deegan2007-01-311-110/+98
| | | | | | | | | | | | - All entries are now defined as structs and saved/restored in self-contained operations. - Save/restore operations are type-safe, to tie each entry's typecode to a particular struct and its length. - Save/restore handlers are registered once per host instead of per domain. - Detect buffer overrun before it happens and abort. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] Save/restore cleanups: don't save state for downed vcpus.Tim Deegan2007-01-291-5/+2
| | | | | | | (Since we wouldn't load it anyway) Also tidy up the plumbing around the hypercalls. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* hvm: Define a global I/O access bitmap, allowing direct access to port 0x80.kfraser@localhost.localdomain2007-01-251-8/+8
| | | | Signed-off-by: Keir Fraser <keir@xensource.com>
* [HVM] Save/restore cleanups 01: PITTim Deegan2007-01-201-1/+6
| | | | | | | Define public structure for the saved PIT data and use it instead of a series of explicit loads and stores. Don't save ephemeral Xen timer structs; rebuild them instead. Signed-off-by: Tim Deegan <Tim.Deegan@xensource.com>
* [HVM] save restore: save restore dev in HVTim Deegan2007-01-181-0/+2
| | | | | | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> save/restore all dev state in HV such as PIT/PIC/APIC
* [HVM] save restore: new hyper-callTim Deegan2007-01-181-0/+125
| | | | | | Signed-off-by: Zhai Edwin <edwin.zhai@intel.com> add a pair of hyper-call for hvm guest context
* [HVM] Add triple-fault handler (resets the domain).kfraser@localhost.localdomain2007-01-031-0/+1
| | | | | Todo: How to hook this for SVM? Signed-off-by: Keir Fraser <keir@xensource.com>