Skip to contentSkip to conversation

x86/cpuid: Trivial fixes

PATCH In review Andrew Cooper 4 participants 13 messages Jun 27, 2018 – Jun 28, 2018

lore
Share & tools
lore
#0 lore raw

cover x86/cpuid: Trivial fixes

This is some trivial prep work for the main CPUID work.

Andrew Cooper (2):
x86/cpuid: Fix up stale comments
x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

 tools/libxc/xc_cpuid_x86.c  | 11 ++++++++++-
 xen/arch/x86/cpuid.c        | 43 ++++++++++++++++++++++++++++++++++++++++---
 xen/arch/x86/domctl.c       | 13 ++++++++++---
 xen/include/asm-x86/cpuid.h | 18 +++++++++++++++++-
 4 files changed, 77 insertions(+), 8 deletions(-)
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#1 lore raw

PATCH 1/2 x86/cpuid: Fix up stale comments

* There is no legacy path any more. All static information is retrieved in the first pass.
* d->arch.cpuids[] doesn't exist any more.

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

---
 xen/arch/x86/cpuid.c  | 2 +-
 xen/arch/x86/domctl.c | 5 ++---
 2 files changed, 3 insertions(+), 4 deletions(-)
xen/arch/x86/cpuid.c +1 -1
index beee47d..eca1a9a 100644
@@ -701,7 +701,7 @@ void guest_cpuid(const struct vcpu *v, uint32_t leaf,
      * First pass:
      * - Perform max_leaf/subleaf calculations.  Out-of-range leaves return
      *   all zeros, following the AMD model.
-     * - Fill in *res for leaves no longer handled on the legacy path.
+     * - Fill in *res with static data.
      * - Dispatch the virtualised leaves to their respective handlers.
      */
     switch ( leaf )
xen/arch/x86/domctl.c +2 -3
index 8fbbf3a..105a576 100644
@@ -56,9 +56,8 @@ static int update_domain_cpuid_info(struct domain *d,
     bool call_policy_changed = false; /* Avoid for_each_vcpu() unnecessarily */
 
     /*
-     * Skip update for leaves we don't care about.  This avoids the overhead
-     * of recalculate_cpuid_policy() and making d->arch.cpuids[] needlessly
-     * longer to search.
+     * Skip update for leaves we don't care about, to avoid the overhead of
+     * recalculate_cpuid_policy().
      */
     switch ( ctl->input[0] )
     {
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] x86/cpuid: Fix up stale comments

Quoted 6 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:

* There is no legacy path any more. All static information is retrieved in the first pass.
* d->arch.cpuids[] doesn't exist any more.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by on v1 1/2
#3 lore raw

Re: [PATCH 1/2] x86/cpuid: Fix up stale comments

In reply to Andrew Cooper
Quoted 5 lines · Andrew Cooper

* There is no legacy path any more. All static information is retrieved in the first pass.
* d->arch.cpuids[] doesn't exist any more.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#4 lore raw

PATCH 2/2 x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

In reply to Andrew Cooper

The new data lives in the .topo union, rather than being treated as a single leaf in the basic union.

Host data is scanned when filling in the raw policy, but Xen still discards any toolstack settings for now.

---
CC: Jan Beulich <[email protected]>
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

---
 tools/libxc/xc_cpuid_x86.c  | 11 ++++++++++-
 xen/arch/x86/cpuid.c        | 41 +++++++++++++++++++++++++++++++++++++++--
 xen/arch/x86/domctl.c       |  8 ++++++++
 xen/include/asm-x86/cpuid.h | 18 +++++++++++++++++-
 4 files changed, 74 insertions(+), 4 deletions(-)
tools/libxc/xc_cpuid_x86.c +10 -1
index 21537f0..96c6c95 100644
@@ -764,13 +764,22 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
             if ( (regs[0] & 0x1f) != 0 )
                 continue;
         }
+        /* Extended Topology leaves. */
+        else if ( input[0] == 0xb )
+        {
+            uint8_t level_type = regs[2] >> 8;
+
+            input[1]++;
+            if ( level_type >= 1 && level_type <= 2 )
+                continue;
+        }
 
         input[0]++;
         if ( !(input[0] & 0x80000000u) && (input[0] > base_max ) )
             input[0] = 0x80000000u;
 
         input[1] = XEN_CPUID_INPUT_UNUSED;
-        if ( (input[0] == 4) || (input[0] == 7) )
+        if ( (input[0] == 4) || (input[0] == 7) || (input[0] == 0xb) )
             input[1] = 0;
         else if ( input[0] == 0xd )
             input[1] = 1; /* Xen automatically calculates almost everything. */
xen/arch/x86/cpuid.c +39 -2

65 lines not on this page · raw message

xen/arch/x86/domctl.c +8 -0
index 105a576..3e9580b 100644
@@ -70,6 +70,10 @@ static int update_domain_cpuid_info(struct domain *d,
              ctl->input[1] >= ARRAY_SIZE(p->feat.raw) )
             return 0;
 
+        if ( ctl->input[0] == 0xb &&
+             ctl->input[1] >= ARRAY_SIZE(p->topo.raw) )
+            return 0;
+
         BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) < 2);
         if ( ctl->input[0] == XSTATE_CPUID &&
              ctl->input[1] != 1 ) /* Everything else automatically calculated. */
@@ -100,6 +104,10 @@ static int update_domain_cpuid_info(struct domain *d,
             p->feat.raw[ctl->input[1]] = leaf;
             break;
 
+        case 0xb:
+            p->topo.raw[ctl->input[1]] = leaf;
+            break;
+
         case XSTATE_CPUID:
             p->xstate.raw[ctl->input[1]] = leaf;
             break;
xen/include/asm-x86/cpuid.h +17 -1
index 4cce268..4113a5e 100644
@@ -61,6 +61,7 @@ extern struct cpuidmasks cpuidmask_defaults;
 #define CPUID_GUEST_NR_BASIC      (0xdu + 1)
 #define CPUID_GUEST_NR_FEAT       (0u + 1)
 #define CPUID_GUEST_NR_CACHE      (5u + 1)
+#define CPUID_GUEST_NR_TOPO       (1u + 1)
 #define CPUID_GUEST_NR_XSTATE     (62u + 1)
 #define CPUID_GUEST_NR_EXTD_INTEL (0x8u + 1)
 #define CPUID_GUEST_NR_EXTD_AMD   (0x1cu + 1)
@@ -108,7 +109,11 @@ struct cpuid_policy
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
 
             /* Leaf 0xa - Intel PMU. */
-            uint8_t pmu_version;
+            uint8_t pmu_version, _pmu[15];
+
+            uint64_t :64, :64; /* Leaf 0xb - Topology. */
+            uint64_t :64, :64; /* Leaf 0xc - rsvd */
+            uint64_t :64, :64; /* Leaf 0xd - XSTATE. */
         };
     } basic;
 
@@ -142,6 +147,17 @@ struct cpuid_policy
         };
     } feat;
 
+    /* Extended topology enumeration: 0x0000000B[xx] */
+    union {
+        struct cpuid_leaf raw[CPUID_GUEST_NR_TOPO];
+        struct cpuid_topo_leaf {
+            uint32_t id_shift:5, :27;
+            uint16_t nr_logical, :16;
+            uint8_t level, type, :8, :8;
+            uint32_t x2apic_id;
+        } subleaf[CPUID_GUEST_NR_TOPO];
+    } topo;
+
     /* Xstate feature leaf: 0x0000000D[xx] */
     union {
         struct cpuid_leaf raw[CPUID_GUEST_NR_XSTATE];
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#5 lore raw

Re: [PATCH 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:
xen/arch/x86/cpuid.c +10 -0
@@ -316,6 +319,33 @@ static void __init calculate_raw_policy(void)
             cpuid_count_leaf(7, i, &p->feat.raw[i]);
     }
 
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);

xen/arch/x86/cpuid.c static void __init calculate_raw_policy(void) · line 341

Quoted 10 lines
xen/arch/x86/cpuid.c +10 -0
+
+            if ( u.t.type == 0 )
+                break;
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future harware.

Missing d.

xen/include/asm-x86/cpuid.h struct cpuid_policy · line 116

Quoted 10 lines
xen/include/asm-x86/cpuid.h +5 -1
@@ -108,7 +109,11 @@ struct cpuid_policy
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
 
             /* Leaf 0xa - Intel PMU. */
-            uint8_t pmu_version;
+            uint8_t pmu_version, _pmu[15];
+
+            uint64_t :64, :64; /* Leaf 0xb - Topology. */
+            uint64_t :64, :64; /* Leaf 0xc - rsvd */
+            uint64_t :64, :64; /* Leaf 0xd - XSTATE. */

I don't understand why you add the latter two lines, neither in general nor in the particular context of this patch.

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#6 lore raw

Re: [PATCH 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:
xen/arch/x86/cpuid.c +13 -0
@@ -316,6 +319,33 @@ static void __init calculate_raw_policy(void)
             cpuid_count_leaf(7, i, &p->feat.raw[i]);
     }
 
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);
+
+            if ( u.t.type == 0 )
+                break;
Quoted 8 lines

xen/arch/x86/cpuid.c static void __init calculate_raw_policy(void) · line 341

Quoted 7 lines
xen/arch/x86/cpuid.c +7 -0
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future harware.

Missing d.

Where?  I'm afraid that after repeated re-reads, I can't spot any issue.

Quoted 4 lines
Quoted 4 lines
xen/include/asm-x86/cpuid.h +0 -0
@@ -108,7 +109,11 @@ struct cpuid_policy
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
 
Quoted 9 lines

xen/include/asm-x86/cpuid.h struct cpuid_policy · line 116

Quoted 7 lines
xen/include/asm-x86/cpuid.h +5 -1
             /* Leaf 0xa - Intel PMU. */
-            uint8_t pmu_version;
+            uint8_t pmu_version, _pmu[15];
+
+            uint64_t :64, :64; /* Leaf 0xb - Topology. */
+            uint64_t :64, :64; /* Leaf 0xc - rsvd */
+            uint64_t :64, :64; /* Leaf 0xd - XSTATE. */

I don't understand why you add the latter two lines, neither in general nor in the particular context of this patch.

This is part of reducing the effort for people extending the CPUID leaves, by keeping the .basic union in line with max_leaf.

There are further non-subleaf leaves beyond this point (0x15/0x16) and I've noticed several mistakes with newer submitted series.  I'd much rather do this myself once now, than attempt to explain it to others during code review.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#7 lore raw

Re: [PATCH 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

Quoted 28 lines · Andrew Cooper
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:
xen/arch/x86/cpuid.c +13 -0
@@ -316,6 +319,33 @@ static void __init calculate_raw_policy(void)
             cpuid_count_leaf(7, i, &p->feat.raw[i]);
     }
 
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);
+
+            if ( u.t.type == 0 )
+                break;
Quoted 8 lines

xen/arch/x86/cpuid.c static void __init calculate_raw_policy(void) · line 341

Quoted 7 lines
xen/arch/x86/cpuid.c +7 -0
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future harware.

Missing d.

Quoted 2 lines

Where?  I'm afraid that after repeated re-reads, I can't spot any issue.

har d ware. ;p

Wei.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#8 lore raw

Re: [PATCH 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

Quoted 28 lines · Wei Liu
Quoted 27 lines · Andrew Cooper
Quoted 26 lines · Jan Beulich
Quoted 15 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:
xen/arch/x86/cpuid.c +10 -0
@@ -316,6 +319,33 @@ static void __init calculate_raw_policy(void)
             cpuid_count_leaf(7, i, &p->feat.raw[i]);
     }
 
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);

xen/arch/x86/cpuid.c static void __init calculate_raw_policy(void) · line 341

Quoted 10 lines
xen/arch/x86/cpuid.c +10 -0
+
+            if ( u.t.type == 0 )
+                break;
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future harware.

Missing d.

Quoted 3 lines
Quoted 2 lines

Where?  I'm afraid that after repeated re-reads, I can't spot any issue.

har d ware. ;p

Wow I'm blind.  Thanks.

~Andrew

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Reviewed-by
#9 lore raw

Re: [PATCH 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

In reply to Andrew Cooper
Quoted 29 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 17:58, <[email protected]> wrote:
Quoted 18 lines · Jan Beulich
Quoted 18 lines
Quoted 1 line
Quoted 1 line · On 27.06.18 at 15:55, <[email protected]> wrote:
xen/arch/x86/cpuid.c +13 -0
@@ -316,6 +319,33 @@ static void __init calculate_raw_policy(void)
             cpuid_count_leaf(7, i, &p->feat.raw[i]);
     }
 
+    if ( p->basic.max_leaf >= 0xb )
+    {
+        union {
+            struct cpuid_leaf l;
+            struct cpuid_topo_leaf t;
+        } u;
+
+        for ( i = 0; i < ARRAY_SIZE(p->topo.raw); ++i )
+        {
+            cpuid_count_leaf(0xb, i, &u.l);
+
+            if ( u.t.type == 0 )
+                break;
Quoted 8 lines

xen/arch/x86/cpuid.c static void __init calculate_raw_policy(void) · line 341

Quoted 7 lines
xen/arch/x86/cpuid.c +7 -0
+
+            p->topo.subleaf[i] = u.t;
+        }
+
+        /*
+         * The choice of CPUID_GUEST_NR_TOPO is per the manual.  It may need
+         * to grow for future harware.

Missing d.

Quoted 1 line

Where? I'm afraid that after repeated re-reads, I can't spot any issue.

hardware

Quoted 13 lines
Quoted 12 lines

xen/include/asm-x86/cpuid.h struct cpuid_policy · line 116

Quoted 10 lines
xen/include/asm-x86/cpuid.h +5 -1
@@ -108,7 +109,11 @@ struct cpuid_policy
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
 
             /* Leaf 0xa - Intel PMU. */
-            uint8_t pmu_version;
+            uint8_t pmu_version, _pmu[15];
+
+            uint64_t :64, :64; /* Leaf 0xb - Topology. */
+            uint64_t :64, :64; /* Leaf 0xc - rsvd */
+            uint64_t :64, :64; /* Leaf 0xd - XSTATE. */

I don't understand why you add the latter two lines, neither in general nor in the particular context of this patch.

Quoted 7 lines

This is part of reducing the effort for people extending the CPUID leaves, by keeping the .basic union in line with max_leaf.

There are further non-subleaf leaves beyond this point (0x15/0x16) and I've noticed several mistakes with newer submitted series. I'd much rather do this myself once now, than attempt to explain it to others during code review.

Ah, I see. If you make the commit message say so,

Jan

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

#10 lore raw

PATCH v2 2/2 x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

In reply to Andrew Cooper

The new data lives in the .topo union, rather than being treated as a single leaf in the basic union.

While adjusting cpuid_policy, pad .basic to CPUID_GUEST_NR_BASIC for the benefit of people extending the number of leaves in the future.

Host data is scanned when filling in the raw policy, but Xen still discards any toolstack settings for now.

---
CC: Ian Jackson <[email protected]>
CC: Wei Liu <[email protected]>
CC: Roger Pau Monné <[email protected]>

v2:
* s/harware/hardware/
* Comment about padding .basic in the commit message

---
 tools/libxc/xc_cpuid_x86.c  | 11 ++++++++++-
 xen/arch/x86/cpuid.c        | 41 +++++++++++++++++++++++++++++++++++++++--
 xen/arch/x86/domctl.c       |  8 ++++++++
 xen/include/asm-x86/cpuid.h | 18 +++++++++++++++++-
 4 files changed, 74 insertions(+), 4 deletions(-)
tools/libxc/xc_cpuid_x86.c +10 -1
index 21537f0..96c6c95 100644
@@ -764,13 +764,22 @@ int xc_cpuid_apply_policy(xc_interface *xch, uint32_t domid,
             if ( (regs[0] & 0x1f) != 0 )
                 continue;
         }
+        /* Extended Topology leaves. */
+        else if ( input[0] == 0xb )
+        {
+            uint8_t level_type = regs[2] >> 8;
+
+            input[1]++;
+            if ( level_type >= 1 && level_type <= 2 )
+                continue;
+        }
 
         input[0]++;
         if ( !(input[0] & 0x80000000u) && (input[0] > base_max ) )
             input[0] = 0x80000000u;
 
         input[1] = XEN_CPUID_INPUT_UNUSED;
-        if ( (input[0] == 4) || (input[0] == 7) )
+        if ( (input[0] == 4) || (input[0] == 7) || (input[0] == 0xb) )
             input[1] = 0;
         else if ( input[0] == 0xd )
             input[1] = 1; /* Xen automatically calculates almost everything. */
xen/arch/x86/cpuid.c +39 -2

65 lines not on this page · raw message

xen/arch/x86/domctl.c +8 -0
index 105a576..3e9580b 100644
@@ -70,6 +70,10 @@ static int update_domain_cpuid_info(struct domain *d,
              ctl->input[1] >= ARRAY_SIZE(p->feat.raw) )
             return 0;
 
+        if ( ctl->input[0] == 0xb &&
+             ctl->input[1] >= ARRAY_SIZE(p->topo.raw) )
+            return 0;
+
         BUILD_BUG_ON(ARRAY_SIZE(p->xstate.raw) < 2);
         if ( ctl->input[0] == XSTATE_CPUID &&
              ctl->input[1] != 1 ) /* Everything else automatically calculated. */
@@ -100,6 +104,10 @@ static int update_domain_cpuid_info(struct domain *d,
             p->feat.raw[ctl->input[1]] = leaf;
             break;
 
+        case 0xb:
+            p->topo.raw[ctl->input[1]] = leaf;
+            break;
+
         case XSTATE_CPUID:
             p->xstate.raw[ctl->input[1]] = leaf;
             break;
xen/include/asm-x86/cpuid.h +17 -1
index 4cce268..4113a5e 100644
@@ -61,6 +61,7 @@ extern struct cpuidmasks cpuidmask_defaults;
 #define CPUID_GUEST_NR_BASIC      (0xdu + 1)
 #define CPUID_GUEST_NR_FEAT       (0u + 1)
 #define CPUID_GUEST_NR_CACHE      (5u + 1)
+#define CPUID_GUEST_NR_TOPO       (1u + 1)
 #define CPUID_GUEST_NR_XSTATE     (62u + 1)
 #define CPUID_GUEST_NR_EXTD_INTEL (0x8u + 1)
 #define CPUID_GUEST_NR_EXTD_AMD   (0x1cu + 1)
@@ -108,7 +109,11 @@ struct cpuid_policy
             uint64_t :64, :64; /* Leaf 0x9 - DCA */
 
             /* Leaf 0xa - Intel PMU. */
-            uint8_t pmu_version;
+            uint8_t pmu_version, _pmu[15];
+
+            uint64_t :64, :64; /* Leaf 0xb - Topology. */
+            uint64_t :64, :64; /* Leaf 0xc - rsvd */
+            uint64_t :64, :64; /* Leaf 0xd - XSTATE. */
         };
     } basic;
 
@@ -142,6 +147,17 @@ struct cpuid_policy
         };
     } feat;
 
+    /* Extended topology enumeration: 0x0000000B[xx] */
+    union {
+        struct cpuid_leaf raw[CPUID_GUEST_NR_TOPO];
+        struct cpuid_topo_leaf {
+            uint32_t id_shift:5, :27;
+            uint16_t nr_logical, :16;
+            uint8_t level, type, :8, :8;
+            uint32_t x2apic_id;
+        } subleaf[CPUID_GUEST_NR_TOPO];
+    } topo;
+
     /* Xstate feature leaf: 0x0000000D[xx] */
     union {
         struct cpuid_leaf raw[CPUID_GUEST_NR_XSTATE];
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Reviewed-by on v2 2/2
#11 lore raw

Re: [PATCH v2 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

Quoted 11 lines · Andrew Cooper

The new data lives in the .topo union, rather than being treated as a single leaf in the basic union.

While adjusting cpuid_policy, pad .basic to CPUID_GUEST_NR_BASIC for the benefit of people extending the number of leaves in the future.

Host data is scanned when filling in the raw policy, but Xen still discards any toolstack settings for now.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel

Acked-by on v2 2/2
#12 lore raw

Re: [PATCH v2 2/2] x86/cpuid: Alter the policy logic for leaf 0xb to be multi-invocation

In reply to Andrew Cooper
Quoted 11 lines · Andrew Cooper

The new data lives in the .topo union, rather than being treated as a single leaf in the basic union.

While adjusting cpuid_policy, pad .basic to CPUID_GUEST_NR_BASIC for the benefit of people extending the number of leaves in the future.

Host data is scanned when filling in the raw policy, but Xen still discards any toolstack settings for now.

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel