xen/23235-svm-decode-assist-crs.patch
Charles Arnold 8547e28bd5 - Upstream patches from Jan
23233-hvm-cr-access.patch
  23234-svm-decode-assist-base.patch
  23235-svm-decode-assist-crs.patch
  23236-svm-decode-assist-invlpg.patch
  23238-svm-decode-assist-insn-fetch.patch
  23303-cpufreq-misc.patch
  23304-amd-oprofile-strings.patch
  23305-amd-fam15-xenoprof.patch
  23306-amd-fam15-vpmu.patch
  23334-amd-fam12+14-vpmu.patch
  23338-vtd-force-intremap.patch

- fate#310957 - Update to Xen 4.1.1-rc1 c/s 23064 

- xentrace: dynamic tracebuffer allocation
  xen-unstable.xentrace.dynamic_tbuf.patch
  xen-unstable.xentrace.empty_t_info_pages.patch
  xen-unstable.xentrace.verbose.patch
  xen-unstable.xentrace.no_gdprintk.patch
  xen-unstable.xentrace.comments.patch
  xen-unstable.xentrace.printk_prefix.patch
  xen-unstable.xentrace.remove_debug_printk.patch
  xen-unstable.xentrace.t_info_pages-formula.patch
  xen-unstable.xentrace.register_cpu_notifier-boot_time.patch
  xen-unstable.xentrace.t_info_page-overflow.patch
  xen-unstable.xentrace.t_info_first_offset.patch
  xen-unstable.xentrace.data_size__read_mostly.patch
  xen-unstable.xentrace.__insert_record-dst-type.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=124
2011-05-31 17:35:29 +00:00

67 lines
2.3 KiB
Diff

References: FATE#309900
# HG changeset patch
# User Andre Przywara <andre.przywara@amd.com>
# Date 1303117266 -3600
# Node ID 2c8ad607ece18b4740b9fc4ffe267a0e0893c141
# Parent bf7afd48339a18cd86d89337f3c055045fb78d3b
svm: implement CR access part of DecodeAssist
Newer SVM implementations (Bulldozer) now give the used general
purpose register on a MOV-CR intercept explictly. This avoids
fetching and decoding the instruction from guest's memory and speeds
up some Windows guest, which exercise CR8 quite often.
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
Signed-off-by: Keir Fraser <keir@xen.org>
Index: xen-4.1.1-testing/xen/arch/x86/hvm/svm/svm.c
===================================================================
--- xen-4.1.1-testing.orig/xen/arch/x86/hvm/svm/svm.c
+++ xen-4.1.1-testing/xen/arch/x86/hvm/svm/svm.c
@@ -1040,6 +1040,22 @@ static void svm_vmexit_do_cpuid(struct c
__update_guest_eip(regs, inst_len);
}
+static void svm_vmexit_do_cr_access(
+ struct vmcb_struct *vmcb, struct cpu_user_regs *regs)
+{
+ int gp, cr, dir, rc;
+
+ cr = vmcb->exitcode - VMEXIT_CR0_READ;
+ dir = (cr > 15);
+ cr &= 0xf;
+ gp = vmcb->exitinfo1 & 0xf;
+
+ rc = dir ? hvm_mov_to_cr(cr, gp) : hvm_mov_from_cr(cr, gp);
+
+ if ( rc == X86EMUL_OKAY )
+ __update_guest_eip(regs, vmcb->nextrip - vmcb->rip);
+}
+
static void svm_dr_access(struct vcpu *v, struct cpu_user_regs *regs)
{
HVMTRACE_0D(DR_WRITE);
@@ -1621,11 +1637,19 @@ asmlinkage void svm_vmexit_handler(struc
int dir = (vmcb->exitinfo1 & 1) ? IOREQ_READ : IOREQ_WRITE;
if ( handle_pio(port, bytes, dir) )
__update_guest_eip(regs, vmcb->exitinfo2 - vmcb->rip);
- break;
}
- /* fallthrough to emulation if a string instruction */
+ else if ( !handle_mmio() )
+ hvm_inject_exception(TRAP_gp_fault, 0, 0);
+ break;
+
case VMEXIT_CR0_READ ... VMEXIT_CR15_READ:
case VMEXIT_CR0_WRITE ... VMEXIT_CR15_WRITE:
+ if ( cpu_has_svm_decode && (vmcb->exitinfo1 & (1ULL << 63)) )
+ svm_vmexit_do_cr_access(vmcb, regs);
+ else if ( !handle_mmio() )
+ hvm_inject_exception(TRAP_gp_fault, 0, 0);
+ break;
+
case VMEXIT_INVLPG:
case VMEXIT_INVLPGA:
if ( !handle_mmio() )