[PATCH] x86/svm: Adjust VMCB comments

Andrew Cooper posted 1 patch 4 days, 12 hours ago
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20260121174314.1465759-1-andrew.cooper3@citrix.com
xen/arch/x86/hvm/svm/vmcb.c | 4 ++++
xen/arch/x86/hvm/svm/vmcb.h | 8 ++------
2 files changed, 6 insertions(+), 6 deletions(-)
[PATCH] x86/svm: Adjust VMCB comments
Posted by Andrew Cooper 4 days, 12 hours ago
The Intercept comments provide no value whatsoever.  For the VMCB, label the
Control area and State Save area, which are the names given by the APM.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Jan Beulich <JBeulich@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Alejandro Vallejo <alejandro.garciavallejo@amd.com>
---
 xen/arch/x86/hvm/svm/vmcb.c | 4 ++++
 xen/arch/x86/hvm/svm/vmcb.h | 8 ++------
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index cbee10d0463d..72173c8fdd6a 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -430,9 +430,13 @@ static void __init __maybe_unused build_assertions(void)
 
     /* Build-time check of the VMCB layout. */
     BUILD_BUG_ON(sizeof(vmcb) != PAGE_SIZE);
+
+    /* Control area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), _pause_filter_thresh) != 0x03c);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _vintr)               != 0x060);
     BUILD_BUG_ON(offsetof(typeof(vmcb), event_inj)            != 0x0a8);
+
+    /* State Save area */
     BUILD_BUG_ON(offsetof(typeof(vmcb), es)                   != 0x400);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cpl)                 != 0x4cb);
     BUILD_BUG_ON(offsetof(typeof(vmcb), _cr4)                 != 0x548);
diff --git a/xen/arch/x86/hvm/svm/vmcb.h b/xen/arch/x86/hvm/svm/vmcb.h
index ba554a964487..c64386e7ef85 100644
--- a/xen/arch/x86/hvm/svm/vmcb.h
+++ b/xen/arch/x86/hvm/svm/vmcb.h
@@ -8,7 +8,6 @@
 
 struct vcpu;
 
-/* general 1 intercepts */
 enum GenericIntercept1bits
 {
     GENERAL1_INTERCEPT_INTR          = 1 << 0,
@@ -45,7 +44,6 @@ enum GenericIntercept1bits
     GENERAL1_INTERCEPT_SHUTDOWN_EVT  = 1u << 31
 };
 
-/* general 2 intercepts */
 enum GenericIntercept2bits
 {
     GENERAL2_INTERCEPT_VMRUN   = 1 << 0,
@@ -65,8 +63,6 @@ enum GenericIntercept2bits
     GENERAL2_INTERCEPT_RDPRU   = 1 << 14,
 };
 
-
-/* control register intercepts */
 enum CRInterceptBits
 {
     CR_INTERCEPT_CR0_READ   = 1 << 0,
@@ -103,8 +99,6 @@ enum CRInterceptBits
     CR_INTERCEPT_CR15_WRITE = 1u << 31,
 };
 
-
-/* debug register intercepts */
 enum DRInterceptBits
 {
     DR_INTERCEPT_DR0_READ   = 1 << 0,
@@ -400,6 +394,7 @@ typedef union
 #define MSRPM_SIZE  (8  * 1024)
 
 struct vmcb_struct {
+    /* Control area */
     u32 _cr_intercepts;         /* offset 0x00 - cleanbit 0 */
     u32 _dr_intercepts;         /* offset 0x04 - cleanbit 0 */
     u32 _exception_intercepts;  /* offset 0x08 - cleanbit 0 */
@@ -491,6 +486,7 @@ struct vmcb_struct {
     u8  guest_ins[15];          /* offset 0xD1 */
     u64 res10a[100];            /* offset 0xE0 pad to save area */
 
+    /* State Save area */
     union {
         struct segment_register sreg[6];
         struct {
-- 
2.39.5


Re: [PATCH] x86/svm: Adjust VMCB comments
Posted by Jan Beulich 3 days, 21 hours ago
On 21.01.2026 18:43, Andrew Cooper wrote:
> The Intercept comments provide no value whatsoever.  For the VMCB, label the
> Control area and State Save area, which are the names given by the APM.
> 
> No functional change.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>