From: brian.woods@amd.com
To: xen-devel@lists.xenproject.org
Cc: andrew.cooper3@citrix.com, boris.ostrovsky@oracle.com,
Brian Woods <brian.woods@amd.com>,
jbeulich@suse.com, suravee.suthikulpanit@amd.com
Subject: [PATCH 1/3] x86/svm: rename lbr control field in vmcb
Date: Tue, 31 Oct 2017 17:03:06 -0500 [thread overview]
Message-ID: <20171031220308.107679-2-brian.woods@amd.com> (raw)
In-Reply-To: <20171031220308.107679-1-brian.woods@amd.com>
From: Brian Woods <brian.woods@amd.com>
Rename the lbr_control field in the vmcb for future/upcoming changes.
Signed-off-by: Brian Woods <brian.woods@amd.com>
---
xen/arch/x86/hvm/svm/nestedsvm.c | 10 +++++-----
xen/arch/x86/hvm/svm/svm.c | 2 +-
xen/include/asm-x86/hvm/svm/nestedsvm.h | 4 ++--
xen/include/asm-x86/hvm/svm/vmcb.h | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index 1de896e456..5513f7a388 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -174,7 +174,7 @@ int nsvm_vcpu_reset(struct vcpu *v)
svm->ns_exception_intercepts = 0;
svm->ns_general1_intercepts = 0;
svm->ns_general2_intercepts = 0;
- svm->ns_lbr_control.bytes = 0;
+ svm->ns_virt_ext.bytes = 0;
svm->ns_hap_enabled = 0;
svm->ns_vmcb_guestcr3 = 0;
@@ -521,12 +521,12 @@ static int nsvm_vmcb_prepare4vmrun(struct vcpu *v, struct cpu_user_regs *regs)
/* Pending Interrupts */
n2vmcb->eventinj = ns_vmcb->eventinj;
- /* LBR virtualization */
+ /* LBR and other virtualization */
if (!vcleanbit_set(lbr)) {
- svm->ns_lbr_control = ns_vmcb->lbr_control;
+ svm->ns_virt_ext = ns_vmcb->virt_ext;
}
- n2vmcb->lbr_control.bytes =
- n1vmcb->lbr_control.bytes | ns_vmcb->lbr_control.bytes;
+ n2vmcb->virt_ext.bytes =
+ n1vmcb->virt_ext.bytes | ns_vmcb->virt_ext.bytes;
/* NextRIP - only evaluated on #VMEXIT. */
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index b9cf423fd9..c8ffb17515 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -1997,7 +1997,7 @@ static int svm_msr_write_intercept(unsigned int msr, uint64_t msr_content)
vmcb_set_debugctlmsr(vmcb, msr_content);
if ( !msr_content || !cpu_has_svm_lbrv )
break;
- vmcb->lbr_control.fields.enable = 1;
+ vmcb->virt_ext.fields.lbr_enable = 1;
svm_disable_intercept_for_msr(v, MSR_IA32_DEBUGCTLMSR);
svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHFROMIP);
svm_disable_intercept_for_msr(v, MSR_IA32_LASTBRANCHTOIP);
diff --git a/xen/include/asm-x86/hvm/svm/nestedsvm.h b/xen/include/asm-x86/hvm/svm/nestedsvm.h
index 4b36c25c5d..a619b6131b 100644
--- a/xen/include/asm-x86/hvm/svm/nestedsvm.h
+++ b/xen/include/asm-x86/hvm/svm/nestedsvm.h
@@ -46,8 +46,8 @@ struct nestedsvm {
uint32_t ns_general1_intercepts;
uint32_t ns_general2_intercepts;
- /* Cached real lbr of the l2 guest */
- lbrctrl_t ns_lbr_control;
+ /* Cached real lbr and other virtual extentions of the l2 guest */
+ virt_ext_t ns_virt_ext;
/* Cached real MSR permission bitmaps of the l2 guest */
unsigned long *ns_cached_msrpm;
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h b/xen/include/asm-x86/hvm/svm/vmcb.h
index 01ce20b0bd..beec1f6c0e 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -358,9 +358,9 @@ typedef union
u64 bytes;
struct
{
- u64 enable:1;
+ u64 lbr_enable:1;
} fields;
-} lbrctrl_t;
+} virt_ext_t;
typedef union
{
@@ -427,7 +427,7 @@ struct vmcb_struct {
u64 res08[2];
eventinj_t eventinj; /* offset 0xA8 */
u64 _h_cr3; /* offset 0xB0 - cleanbit 4 */
- lbrctrl_t lbr_control; /* offset 0xB8 */
+ virt_ext_t virt_ext; /* offset 0xB8 */
vmcbcleanbits_t cleanbits; /* offset 0xC0 */
u32 res09; /* offset 0xC4 */
u64 nextrip; /* offset 0xC8 */
--
2.11.0
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
next prev parent reply other threads:[~2017-10-31 22:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-31 22:03 [PATCH 0/3] x86/svm: virtual VMLOAD/VMSAVE brian.woods
2017-10-31 22:03 ` brian.woods [this message]
2017-10-31 22:03 ` [PATCH 2/3] x86/svm: add virtual VMLOAD/VMSAVE feature definition brian.woods
2017-10-31 22:03 ` [PATCH 3/3] x86/svm: add virtual VMLOAD/VMSAVE support brian.woods
2017-10-31 22:15 ` Andrew Cooper
2017-10-31 22:29 ` Brian Woods
2017-11-01 17:00 ` [PATCH 0/3] x86/svm: virtual VMLOAD/VMSAVE Boris Ostrovsky
2017-11-01 19:34 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171031220308.107679-2-brian.woods@amd.com \
--to=brian.woods@amd.com \
--cc=andrew.cooper3@citrix.com \
--cc=boris.ostrovsky@oracle.com \
--cc=jbeulich@suse.com \
--cc=suravee.suthikulpanit@amd.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).