Skip to contentSkip to conversation

x86: Overhaul of vendor/family/model logic to support DMR

PATCH In review Andrew Cooper 2 participants 11 messages Jul 16, 2025

lore
Share & tools
lore
#0 lore raw

cover x86: Overhaul of vendor/family/model logic to support DMR

Intel have run out of model space in Family 6 and will start using Family 19 starting with Diamond Rapids. Xen, like Linux, has model checking logic which will malfunction owing to bad assumptions about the family field.

Follow Linux's lead and combine Vendor / Family / Model into a single constant, so it is harder to mismatch family and model checks.

https://gitlab.com/xen-project/hardware/xen-staging/-/pipelines/1930124712

Andrew Cooper (3):
x86: Rearrange struct cpuinfo_x86 to introduce a vfm field x86/intel-family: Resync with Linux
x86/vtd: Switch model check to VFM

 xen/arch/x86/include/asm/cpufeature.h   | 45 ++++++++++--
 xen/arch/x86/include/asm/intel-family.h | 96 ++++++++++++++++++++++++-
 xen/arch/x86/setup.c                    |  4 +-
 xen/drivers/passthrough/vtd/quirks.c    |  7 +-
 4 files changed, 141 insertions(+), 11 deletions(-)
Signature · 1 line
2.39.5
#1 lore raw

PATCH 1/3 x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

Intel have run out of model space in Family 6 and will start using Family 19 starting with Diamond Rapids. Xen, like Linux, has model checking logic which will malfunction owing to bad assumptions about the family field.

Reorder the family, vendor and model fields so they can be accessed together as a single vfm field.

As we're cleaning up the logic, take the opportunity to introduce better names, dropping the x86 prefix.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 xen/arch/x86/include/asm/cpufeature.h | 28 +++++++++++++++++++++++----
 xen/arch/x86/setup.c                  |  4 +++-
 2 files changed, 27 insertions(+), 5 deletions(-)
xen/arch/x86/include/asm/cpufeature.h +24 -4
index 3c2ac964e410..707b134c09c7 100644
@@ -20,10 +20,30 @@
 #ifndef __ASSEMBLY__
 
 struct cpuinfo_x86 {
-    unsigned char x86;                 /* CPU family */
-    unsigned char x86_vendor;          /* CPU vendor */
-    unsigned char x86_model;
-    unsigned char x86_mask;
+    /* TODO: Phase out the x86 prefixed names. */
+    union {
+        struct {
+            union {
+                uint8_t x86_model;
+                uint8_t model;
+            };
+            union {
+                uint8_t x86;
+                uint8_t family;
+            };
+            union {
+                uint8_t x86_vendor;
+                uint8_t vendor;
+            };
+            uint8_t _rsvd;
+        };
+        uint32_t vfm;                  /* Vendor Family Model */
+    };
+    union {
+        uint8_t x86_mask;
+        uint8_t stepping;
+    };
+
     unsigned int cpuid_level;          /* Maximum supported CPUID level */
     unsigned int extended_cpuid_level; /* Maximum supported CPUID extended level */
     unsigned int x86_capability[NCAPINTS];
xen/arch/x86/setup.c +3 -1
index 24e4f5ac7f5d..37421ac9d05b 100644
@@ -178,7 +178,9 @@ void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info);
 /* Used by the boot asm and EFI to stash the multiboot_info paddr. */
 unsigned int __initdata multiboot_ptr;
 
-struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 };
+struct cpuinfo_x86 __read_mostly boot_cpu_data = {
+    .cpuid_level = -1,
+};
 
 unsigned long __read_mostly mmu_cr4_features = XEN_MINIMAL_CR4;
 
Signature · 1 line
2.39.5
Reviewed-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

Quoted 7 lines · Andrew Cooper

Intel have run out of model space in Family 6 and will start using Family 19 starting with Diamond Rapids. Xen, like Linux, has model checking logic which will malfunction owing to bad assumptions about the family field.

Reorder the family, vendor and model fields so they can be accessed together as a single vfm field.

Quoted 6 lines

As we're cleaning up the logic, take the opportunity to introduce better names, dropping the x86 prefix.

No functional change.

In principle

Two remarks, though:

Quoted 16 lines
xen/arch/x86/include/asm/cpufeature.h +6 -4
@@ -20,10 +20,30 @@
 #ifndef __ASSEMBLY__
 
 struct cpuinfo_x86 {
-    unsigned char x86;                 /* CPU family */
-    unsigned char x86_vendor;          /* CPU vendor */
-    unsigned char x86_model;
-    unsigned char x86_mask;
+    /* TODO: Phase out the x86 prefixed names. */
+    union {
+        struct {
+            union {
+                uint8_t x86_model;
+                uint8_t model;

xen/arch/x86/include/asm/cpufeature.h line 38

Quoted 10 lines
xen/arch/x86/include/asm/cpufeature.h +10 -0
+            };
+            union {
+                uint8_t x86;
+                uint8_t family;
+            };
+            union {
+                uint8_t x86_vendor;
+                uint8_t vendor;
+            };
+            uint8_t _rsvd;

Can we perhaps name this e.g. _zero, so it's clear that it cannot be repurposed?

xen/arch/x86/setup.c void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info); · line 183

Quoted 10 lines
xen/arch/x86/setup.c +3 -1
@@ -178,7 +178,9 @@ void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info);
 /* Used by the boot asm and EFI to stash the multiboot_info paddr. */
 unsigned int __initdata multiboot_ptr;
 
-struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 };
+struct cpuinfo_x86 __read_mostly boot_cpu_data = {
+    .cpuid_level = -1,
+};

So you retain the bogus setting of this field. Would you mind taking a look at [1], one of the many things that I never heard back on? I'm deliberately purging that non-sense there as a (side-)effect. Plus really I'm getting tired of having to re-base my long-pending changes over ones you are helped getting in pretty quickly. No matter that this one's going to be one of the easy ones (I hope).

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2024-02/msg00726.html

#3 lore raw

Re: [PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

Quoted 39 lines · Jan Beulich
Quoted 7 lines · Andrew Cooper

Intel have run out of model space in Family 6 and will start using Family 19 starting with Diamond Rapids. Xen, like Linux, has model checking logic which will malfunction owing to bad assumptions about the family field.

Reorder the family, vendor and model fields so they can be accessed together as a single vfm field.

Quoted 6 lines

As we're cleaning up the logic, take the opportunity to introduce better names, dropping the x86 prefix.

No functional change.

In principle

Two remarks, though:

Quoted 20 lines
xen/arch/x86/include/asm/cpufeature.h +10 -4
@@ -20,10 +20,30 @@
 #ifndef __ASSEMBLY__
 
 struct cpuinfo_x86 {
-    unsigned char x86;                 /* CPU family */
-    unsigned char x86_vendor;          /* CPU vendor */
-    unsigned char x86_model;
-    unsigned char x86_mask;
+    /* TODO: Phase out the x86 prefixed names. */
+    union {
+        struct {
+            union {
+                uint8_t x86_model;
+                uint8_t model;
+            };
+            union {
+                uint8_t x86;
+                uint8_t family;
Quoted 8 lines

xen/arch/x86/include/asm/cpufeature.h line 38

Quoted 6 lines
xen/arch/x86/include/asm/cpufeature.h +6 -0
+            };
+            union {
+                uint8_t x86_vendor;
+                uint8_t vendor;
+            };
+            uint8_t _rsvd;

Can we perhaps name this e.g. _zero, so it's clear that it cannot be repurposed?

It can be repurposed; it just must be done in coordination with VFM_MAKE().

I can add a comment to this effect, but it would need to be in the subsequent patch when VFM_MAKE() is introduced.

Quoted 18 lines

xen/arch/x86/setup.c void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info); · line 183

Quoted 11 lines
xen/arch/x86/setup.c +3 -1
@@ -178,7 +178,9 @@ void *stack_start = cpu0_stack + STACK_SIZE - sizeof(struct cpu_info);
 /* Used by the boot asm and EFI to stash the multiboot_info paddr. */
 unsigned int __initdata multiboot_ptr;
 
-struct cpuinfo_x86 __read_mostly boot_cpu_data = { 0, 0, 0, 0, -1 };
+struct cpuinfo_x86 __read_mostly boot_cpu_data = {
+    .cpuid_level = -1,
+};

So you retain the bogus setting of this field. Would you mind taking a look at [1], one of the many things that I never heard back on? I'm deliberately purging that non-sense there as a (side-)effect. Plus really I'm getting tired of having to re-base my long-pending changes over ones you are helped getting in pretty quickly. No matter that this one's going to be one of the easy ones (I hope).

Quoted 3 lines

Jan

[1] https://lists.xen.org/archives/html/xen-devel/2024-02/msg00726.html

I can rebase.

~Andrew

#4 lore raw

Re: [PATCH 1/3] x86: Rearrange struct cpuinfo_x86 to introduce a vfm field

Quoted 31 lines · Andrew Cooper
Quoted 21 lines · Jan Beulich
Quoted 20 lines · Andrew Cooper
xen/arch/x86/include/asm/cpufeature.h +10 -4
@@ -20,10 +20,30 @@
 #ifndef __ASSEMBLY__
 
 struct cpuinfo_x86 {
-    unsigned char x86;                 /* CPU family */
-    unsigned char x86_vendor;          /* CPU vendor */
-    unsigned char x86_model;
-    unsigned char x86_mask;
+    /* TODO: Phase out the x86 prefixed names. */
+    union {
+        struct {
+            union {
+                uint8_t x86_model;
+                uint8_t model;
+            };
+            union {
+                uint8_t x86;
+                uint8_t family;
Quoted 8 lines

xen/arch/x86/include/asm/cpufeature.h line 38

Quoted 6 lines
xen/arch/x86/include/asm/cpufeature.h +6 -0
+            };
+            union {
+                uint8_t x86_vendor;
+                uint8_t vendor;
+            };
+            uint8_t _rsvd;

Can we perhaps name this e.g. _zero, so it's clear that it cannot be repurposed?

Quoted 1 line

It can be repurposed; it just must be done in coordination with VFM_MAKE().

Hmm, true.

Quoted 2 lines

I can add a comment to this effect, but it would need to be in the subsequent patch when VFM_MAKE() is introduced.

Okay, and thanks.

Jan

#5 lore raw

PATCH 2/3 x86/intel-family: Resync with Linux

In reply to Andrew Cooper

This snapshot is prior to Linux commit db4001f9cc32 ("x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines") at the end of their conversion phase.

In addition to non-FAM6 infixed names, defines are added for the Pentium Pro, ArrowLake U, and reintroduced the PHI defines which were incorrectly deleted in the past.

In cpufeature.h, provide VFM_* macros to transform constants to/from the cpuinfo_x86 representation.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

I meant to object to deleting PHI at the time, but was too late. Just because Xen has stopped supporting the PHI doesn't mean the model numbers have ceased existing.

---
 xen/arch/x86/include/asm/cpufeature.h   | 17 +++++
 xen/arch/x86/include/asm/intel-family.h | 96 ++++++++++++++++++++++++-
 2 files changed, 111 insertions(+), 2 deletions(-)
xen/arch/x86/include/asm/cpufeature.h +17 -0
index 707b134c09c7..ba2c1c1c7416 100644
@@ -8,6 +8,8 @@
 
 #include <xen/cache.h>
 #include <xen/const.h>
+#include <xen/macros.h>
+
 #include <asm/cpuid.h>
 
 #define cpufeat_word(idx)	((idx) / 32)
@@ -17,6 +19,21 @@
 /* An alias of a feature we know is always going to be present. */
 #define X86_FEATURE_ALWAYS      X86_FEATURE_LM
 
+/*
+ * Layout tied to cpuinfo_x86.vfm
+ */
+#define VFM_MODEL_MASK  0x000000ff
+#define VFM_FAMILY_MASK 0x0000ff00
+#define VFM_VENDOR_MASK 0x00ff0000
+
+#define VFM_MAKE(v, f, m) (MASK_INSR(v, VFM_VENDOR_MASK) | \
+                           MASK_INSR(f, VFM_FAMILY_MASK) | \
+                           MASK_INSR(f, VFM_MODEL_MASK))
+
+#define VFM_MODEL(vfm)  MASK_EXTR(vfm, VFM_MODEL_MASK)
+#define VFM_FAMILY(vfm) MASK_EXTR(vfm, VFM_FAMILY_MASK)
+#define VFM_VENDOR(vfm) MASK_EXTR(vfm, VFM_VENDOR_MASK)
+
 #ifndef __ASSEMBLY__
 
 struct cpuinfo_x86 {
xen/arch/x86/include/asm/intel-family.h +94 -2

233 lines not on this page · raw message

Signature · 1 line
2.39.5
Acked-by on v1 2/3
#6 lore raw

Re: [PATCH 2/3] x86/intel-family: Resync with Linux

Quoted 12 lines · Andrew Cooper

This snapshot is prior to Linux commit db4001f9cc32 ("x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines") at the end of their conversion phase.

In addition to non-FAM6 infixed names, defines are added for the Pentium Pro, ArrowLake U, and reintroduced the PHI defines which were incorrectly deleted in the past.

In cpufeature.h, provide VFM_* macros to transform constants to/from the cpuinfo_x86 representation.

No functional change.

Quoted 8 lines

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

I meant to object to deleting PHI at the time, but was too late. Just because Xen has stopped supporting the PHI doesn't mean the model numbers have ceased existing.

I don't mind their re-introduction, yet I wonder what value their presence has when we don't use them anywhere. In the public cpufeatureset.h they serve a documentation purpose, to have less holes there. This could be view the same here, yes, but it still seems (yet) less relevant.

xen/arch/x86/include/asm/intel-family.h line 17

Quoted 10 lines
xen/arch/x86/include/asm/intel-family.h +2 -2
@@ -13,8 +13,8 @@
  *	INTEL_FAM6{OPTFAMILY}_{MICROARCH}{OPTDIFF}
  * where:
  * OPTFAMILY	Describes the family of CPUs that this belongs to. Default
- *		is assumed to be "_CORE" (and should be omitted). The other
- *		value currently in use is _ATOM.
+ *		is assumed to be "_CORE" (and should be omitted). Other values
+ *		currently in use are _ATOM and _XEON_PHI

Nit: You lost the full stop.

Quoted 5 lines
xen/arch/x86/include/asm/intel-family.h +1 -0
@@ -40,131 +40,223 @@
  * their own names :-(
  */
 
+#define IFM(_fam, _model)	VFM_MAKE(X86_VENDOR_INTEL, _fam, _model)

xen/arch/x86/include/asm/intel-family.h line 53

Quoted 10 lines
xen/arch/x86/include/asm/intel-family.h +6 -0
+
 /* Wildcard match for FAM6 so X86_MATCH_INTEL_FAM6_MODEL(ANY) works */
 #define INTEL_FAM6_ANY			X86_MODEL_ANY
+/* Wildcard match for FAM6 so X86_MATCH_VFM(ANY) works */
+#define INTEL_ANY			IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
+
+#define INTEL_PENTIUM_PRO		IFM(6, 0x01)
 
 #define INTEL_FAM6_CORE_YONAH		0x0E
+#define INTEL_CORE_YONAH		IFM(6, 0x0E)

Here and below I assume it is deliberate that you use a raw number again, rather than making use of the immediately preceding #define? Perhaps for the sake of brevity?

Jan

#7 lore raw

Re: [PATCH 2/3] x86/intel-family: Resync with Linux

Quoted 18 lines · Jan Beulich
Quoted 17 lines · Andrew Cooper

This snapshot is prior to Linux commit db4001f9cc32 ("x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines") at the end of their conversion phase.

In addition to non-FAM6 infixed names, defines are added for the Pentium Pro, ArrowLake U, and reintroduced the PHI defines which were incorrectly deleted in the past.

In cpufeature.h, provide VFM_* macros to transform constants to/from the cpuinfo_x86 representation.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

Quoted 5 lines
Quoted 3 lines

I meant to object to deleting PHI at the time, but was too late. Just because Xen has stopped supporting the PHI doesn't mean the model numbers have ceased existing.

I don't mind their re-introduction, yet I wonder what value their presence has when we don't use them anywhere.

I spend a lot of time cross-checking tables in the speculative papers. Knowing which were the released CPUs is important for finding typos.  No comment on how many tables were correct on their first revision...

That said, there's SoFIA which is not included in intel-family, and for which we have partial coverage owing to early speculative tables.  IIRC, it was a custom chip for a mobile base-station, and runs an entirely custom software stack.

Quoted 11 lines

xen/arch/x86/include/asm/intel-family.h line 17

Quoted 10 lines
xen/arch/x86/include/asm/intel-family.h +2 -2
@@ -13,8 +13,8 @@
  *	INTEL_FAM6{OPTFAMILY}_{MICROARCH}{OPTDIFF}
  * where:
  * OPTFAMILY	Describes the family of CPUs that this belongs to. Default
- *		is assumed to be "_CORE" (and should be omitted). The other
- *		value currently in use is _ATOM.
+ *		is assumed to be "_CORE" (and should be omitted). Other values
+ *		currently in use are _ATOM and _XEON_PHI

Nit: You lost the full stop.

That seems to be missing in Linux, even at master.

I've got an outstanding task in Linux's intel-family.  I'll try to remember to fix it upstream.

Quoted 14 lines
Quoted 14 lines
xen/arch/x86/include/asm/intel-family.h +6 -0
@@ -40,131 +40,223 @@
  * their own names :-(
  */
 
+#define IFM(_fam, _model)	VFM_MAKE(X86_VENDOR_INTEL, _fam, _model)
+
 /* Wildcard match for FAM6 so X86_MATCH_INTEL_FAM6_MODEL(ANY) works */
 #define INTEL_FAM6_ANY			X86_MODEL_ANY
+/* Wildcard match for FAM6 so X86_MATCH_VFM(ANY) works */
+#define INTEL_ANY			IFM(X86_FAMILY_ANY, X86_MODEL_ANY)
+
+#define INTEL_PENTIUM_PRO		IFM(6, 0x01)
 
Quoted 5 lines

xen/arch/x86/include/asm/intel-family.h line 53

Quoted 2 lines
xen/arch/x86/include/asm/intel-family.h +1 -0
 #define INTEL_FAM6_CORE_YONAH		0x0E
+#define INTEL_CORE_YONAH		IFM(6, 0x0E)

Here and below I assume it is deliberate that you use a raw number again, rather than making use of the immediately preceding #define? Perhaps for the sake of brevity?

Because it's transient.

All the FAM* constants get deleted in db4001f9cc32 ("x86/cpu/vfm: Delete all the *_FAM6_ CPU #defines") and I've got another resync in my local branch, but it obviously doesn't compile in Xen yet.

Quoted 1 line

Thanks.

~Andrew

#8 lore raw

PATCH 3/3 x86/vtd: Switch model check to VFM

In reply to Andrew Cooper

This form is shorer and more legible.

No functional change.

---
CC: Jan Beulich <[email protected]>
CC: Roger Pau Monné <[email protected]>

As this is the first transformation, an anlysis of the code generation change:

before:
<quirk_iommu_caps>:

	       8b 05 4a 7e 09 00    	mov    0x97e4a(%rip),%eax        # <boot_cpu_data>
	       25 00 ff ff 00       	and    $0xffff00,%eax
	       3d 00 06 01 00       	cmp    $0x10600,%eax
	   /-- 74 0e                	je     <quirk_iommu_caps+0x20>
	/--|-> e9 59 8a dc ff       	jmp    <__x86_return_thunk>
	|  |   66 0f 1f 84 00 00 00 	nopw   0x0(%rax,%rax,1)
	|  |   00 00
	|  \-> 0f b6 05 29 7e 09 00 	movzbl 0x97e29(%rip),%eax        # <boot_cpu_data>
	|      3c 2a                	cmp    $0x2a,%al
	|  /-- 74 04                	je     <quirk_iommu_caps+0x2f>
	|  |   3c 2d                	cmp    $0x2d,%al
	\--|-- 75 e3                	jne    <quirk_iommu_caps+0x12>
	   \-> 48 b8 ff ff ff ff c3 	movabs $0xffffffc3ffffffff,%rax
	       ff ff ff
	       48 21 47 20          	and    %rax,0x20(%rdi)
	       e9 2e 8a dc ff       	jmp    <__x86_return_thunk>

after:
<quirk_iommu_caps>:

	    8b 05 4a 7e 09 00    	mov    0x97e4a(%rip),%eax        # <boot_cpu_data>
	    3d 2a 06 01 00       	cmp    $0x1062a,%eax
	/-- 74 13                	je     <quirk_iommu_caps+0x20>
	|   3d 2d 06 01 00       	cmp    $0x1062d,%eax
	+-- 74 0c                	je     <quirk_iommu_caps+0x20>
	|   e9 57 8a dc ff       	jmp    <__x86_return_thunk>
	|   0f 1f 80 00 00 00 00 	nopl   0x0(%rax)
	\-> 48 b8 ff ff ff ff c3 	movabs $0xffffffc3ffffffff,%rax
	    ff ff ff
	    48 21 47 20          	and    %rax,0x20(%rdi)
	    e9 3d 8a dc ff       	jmp    <__x86_return_thunk>

Previously, GCC managed to merge the "x86_vendor == X86_VENDOR_INTEL && x86 == 6" condition, but performed a second load for x86_model.

Afterwards, there's a single load, and two compares.

Neither managed to merge the model checks together by playing with bit 2, but that's something that compilers could learn to and is not suitable to express at the C level for this kind of logic.

Unrelated to this change, it would be rather better to do andl $0xc3, 0x24(%rdi) than to manifest a 64bit constant.

---
 xen/arch/x86/include/asm/cpufeature.h | 2 +-
 xen/drivers/passthrough/vtd/quirks.c  | 7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
xen/arch/x86/include/asm/cpufeature.h +1 -1
index ba2c1c1c7416..f8b85c0f9520 100644
@@ -28,7 +28,7 @@
 
 #define VFM_MAKE(v, f, m) (MASK_INSR(v, VFM_VENDOR_MASK) | \
                            MASK_INSR(f, VFM_FAMILY_MASK) | \
-                           MASK_INSR(f, VFM_MODEL_MASK))
+                           MASK_INSR(m, VFM_MODEL_MASK))
 
 #define VFM_MODEL(vfm)  MASK_EXTR(vfm, VFM_MODEL_MASK)
 #define VFM_FAMILY(vfm) MASK_EXTR(vfm, VFM_FAMILY_MASK)
xen/drivers/passthrough/vtd/quirks.c +3 -4
index dc3dac749ce6..0a10a46d90f7 100644
@@ -30,6 +30,7 @@
 #include <xen/pci_regs.h>
 #include <xen/keyhandler.h>
 #include <asm/msi.h>
+#include <asm/intel-family.h>
 #include <asm/irq.h>
 #include <asm/pci.h>
 
@@ -630,9 +631,7 @@ void __init quirk_iommu_caps(struct vtd_iommu *iommu)
      * model because the client parts don't expose their IOMMUs as PCI devices
      * we could match with a Device ID.
      */
-    if ( boot_cpu_data.x86_vendor == X86_VENDOR_INTEL &&
-         boot_cpu_data.x86 == 6 &&
-         (boot_cpu_data.x86_model == 0x2a ||
-          boot_cpu_data.x86_model == 0x2d) )
+    if ( boot_cpu_data.vfm == INTEL_SANDYBRIDGE ||
+         boot_cpu_data.vfm == INTEL_SANDYBRIDGE_X )
         iommu->cap &= ~(0xful << 34);
 }
Signature · 1 line
2.39.5
#9 lore raw

Re: [PATCH 3/3] x86/vtd: Switch model check to VFM

xen/arch/x86/include/asm/cpufeature.h line 32

Quoted 11 lines · Andrew Cooper
xen/arch/x86/include/asm/cpufeature.h +1 -1
index ba2c1c1c7416..f8b85c0f9520 100644
@@ -28,7 +28,7 @@
 
 #define VFM_MAKE(v, f, m) (MASK_INSR(v, VFM_VENDOR_MASK) | \
                            MASK_INSR(f, VFM_FAMILY_MASK) | \
-                           MASK_INSR(f, VFM_MODEL_MASK))
+                           MASK_INSR(m, VFM_MODEL_MASK))
 

This hunk should be in the prior patch.  Fixed up locally.

~Andrew

Reviewed-by
#10 lore raw

Re: [PATCH 3/3] x86/vtd: Switch model check to VFM

Quoted 7 lines · Andrew Cooper
Quoted 6 lines · Andrew Cooper
xen/arch/x86/include/asm/cpufeature.h +0 -0
index ba2c1c1c7416..f8b85c0f9520 100644
@@ -28,7 +28,7 @@
 
Quoted 7 lines

xen/arch/x86/include/asm/cpufeature.h line 32

Quoted 5 lines
xen/arch/x86/include/asm/cpufeature.h +1 -1
 #define VFM_MAKE(v, f, m) (MASK_INSR(v, VFM_VENDOR_MASK) | \
                            MASK_INSR(f, VFM_FAMILY_MASK) | \
-                           MASK_INSR(f, VFM_MODEL_MASK))
+                           MASK_INSR(m, VFM_MODEL_MASK))
 

This hunk should be in the prior patch.  Fixed up locally.

Then:

Jan