2011-05-31 19:35:29 +02:00
|
|
|
References: FATE#309900
|
|
|
|
|
|
|
|
# HG changeset patch
|
|
|
|
# User Andre Przywara <andre.przywara@amd.com>
|
|
|
|
# Date 1303116553 -3600
|
|
|
|
# Node ID bf7afd48339a18cd86d89337f3c055045fb78d3b
|
|
|
|
# Parent 1276926e3795b11ef6ac2f59df900d8e0ba9f54b
|
|
|
|
svm: add bit definitions for SVM DecodeAssist
|
|
|
|
|
|
|
|
Chapter 15.33 of recent APM Vol.2 manuals describe some additions
|
|
|
|
to SVM called DecodeAssist. Add the newly added fields to the VMCB
|
|
|
|
structure and name the associated CPUID bit.
|
|
|
|
|
|
|
|
Signed-off-by: Andre Przywara <andre.przywara@amd.com>
|
|
|
|
|
|
|
|
# HG changeset patch
|
|
|
|
# User Keir Fraser <keir@xen.org>
|
|
|
|
# Date 1303117802 -3600
|
|
|
|
# Node ID 381ab77db71a4739b8a4f4fdad4ef3504999f998
|
|
|
|
# Parent e324c4d1dd6eeb9417fec513640ca795bd0f5dd4
|
|
|
|
svm: decode-assists feature must depend on nextrip feature.
|
|
|
|
|
|
|
|
...since the decode-assist fast paths assume nextrip vmcb field is
|
|
|
|
valid.
|
|
|
|
|
|
|
|
Signed-off-by: Keir Fraser <keir@xen.org>
|
|
|
|
|
2011-09-15 23:43:21 +02:00
|
|
|
Index: xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c
|
2011-05-31 19:35:29 +02:00
|
|
|
===================================================================
|
2011-09-15 23:43:21 +02:00
|
|
|
--- xen-4.1.2-testing.orig/xen/arch/x86/hvm/svm/svm.c
|
|
|
|
+++ xen-4.1.2-testing/xen/arch/x86/hvm/svm/svm.c
|
2011-05-31 19:35:29 +02:00
|
|
|
@@ -928,11 +928,16 @@ struct hvm_function_table * __init start
|
|
|
|
|
|
|
|
printk("SVM: Supported advanced features:\n");
|
|
|
|
|
|
|
|
+ /* DecodeAssists fast paths assume nextrip is valid for fast rIP update. */
|
|
|
|
+ if ( !cpu_has_svm_nrips )
|
|
|
|
+ clear_bit(SVM_FEATURE_DECODEASSISTS, &svm_feature_flags);
|
|
|
|
+
|
|
|
|
#define P(p,s) if ( p ) { printk(" - %s\n", s); printed = 1; }
|
|
|
|
P(cpu_has_svm_npt, "Nested Page Tables (NPT)");
|
|
|
|
P(cpu_has_svm_lbrv, "Last Branch Record (LBR) Virtualisation");
|
|
|
|
P(cpu_has_svm_nrips, "Next-RIP Saved on #VMEXIT");
|
|
|
|
P(cpu_has_svm_cleanbits, "VMCB Clean Bits");
|
|
|
|
+ P(cpu_has_svm_decode, "DecodeAssists");
|
|
|
|
P(cpu_has_pause_filter, "Pause-Intercept Filter");
|
|
|
|
#undef P
|
|
|
|
|
2011-09-15 23:43:21 +02:00
|
|
|
Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h
|
2011-05-31 19:35:29 +02:00
|
|
|
===================================================================
|
2011-09-15 23:43:21 +02:00
|
|
|
--- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/svm.h
|
|
|
|
+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/svm.h
|
2011-05-31 19:35:29 +02:00
|
|
|
@@ -80,6 +80,7 @@ extern u32 svm_feature_flags;
|
|
|
|
#define cpu_has_svm_svml cpu_has_svm_feature(SVM_FEATURE_SVML)
|
|
|
|
#define cpu_has_svm_nrips cpu_has_svm_feature(SVM_FEATURE_NRIPS)
|
|
|
|
#define cpu_has_svm_cleanbits cpu_has_svm_feature(SVM_FEATURE_VMCBCLEAN)
|
|
|
|
+#define cpu_has_svm_decode cpu_has_svm_feature(SVM_FEATURE_DECODEASSISTS)
|
|
|
|
#define cpu_has_pause_filter cpu_has_svm_feature(SVM_FEATURE_PAUSEFILTER)
|
|
|
|
|
|
|
|
#endif /* __ASM_X86_HVM_SVM_H__ */
|
2011-09-15 23:43:21 +02:00
|
|
|
Index: xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h
|
2011-05-31 19:35:29 +02:00
|
|
|
===================================================================
|
2011-09-15 23:43:21 +02:00
|
|
|
--- xen-4.1.2-testing.orig/xen/include/asm-x86/hvm/svm/vmcb.h
|
|
|
|
+++ xen-4.1.2-testing/xen/include/asm-x86/hvm/svm/vmcb.h
|
2011-05-31 19:35:29 +02:00
|
|
|
@@ -432,7 +432,9 @@ struct vmcb_struct {
|
|
|
|
vmcbcleanbits_t cleanbits; /* offset 0xC0 */
|
|
|
|
u32 res09; /* offset 0xC4 */
|
|
|
|
u64 nextrip; /* offset 0xC8 */
|
|
|
|
- u64 res10a[102]; /* offset 0xD0 pad to save area */
|
|
|
|
+ u8 guest_ins_len; /* offset 0xD0 */
|
|
|
|
+ u8 guest_ins[15]; /* offset 0xD1 */
|
|
|
|
+ u64 res10a[100]; /* offset 0xE0 pad to save area */
|
|
|
|
|
|
|
|
svm_segment_register_t es; /* offset 1024 - cleanbit 8 */
|
|
|
|
svm_segment_register_t cs; /* cleanbit 8 */
|