Skip to contentSkip to conversation

x86/amd: Initial support for Fam19h processors

PATCH In review Andrew Cooper 3 participants 7 messages Apr 30, 2020 – May 4, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/amd: Initial support for Fam19h processors

Fam19h is very similar to Fam17h in these regards.

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

---
 xen/arch/x86/acpi/cpu_idle.c     | 1 +
 xen/arch/x86/cpu/microcode/amd.c | 1 +
 xen/arch/x86/cpu/vpmu_amd.c      | 1 +
 xen/arch/x86/nmi.c               | 2 +-
 xen/arch/x86/traps.c             | 2 +-
 5 files changed, 5 insertions(+), 2 deletions(-)
xen/arch/x86/acpi/cpu_idle.c +1 -0
index e00f2a82de..b83446e77d 100644
@@ -1356,6 +1356,7 @@ static void amd_cpuidle_init(struct acpi_processor_power *power)
 
     switch ( c->x86 )
     {
+    case 0x19:
     case 0x18:
         if ( boot_cpu_data.x86_vendor != X86_VENDOR_HYGON )
         {
xen/arch/x86/cpu/microcode/amd.c +1 -0
index 13bf9f4dee..89b656bd2b 100644
@@ -125,6 +125,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         max_size = F16H_MPB_MAX_SIZE;
         break;
     case 0x17:
+    case 0x19:
         max_size = F17H_MPB_MAX_SIZE;
         break;
     default:
xen/arch/x86/cpu/vpmu_amd.c +1 -0
index 3c6799b42c..eba47cd2a0 100644
@@ -576,6 +576,7 @@ int __init amd_vpmu_init(void)
     {
     case 0x15:
     case 0x17:
+    case 0x19:
         num_counters = F15H_NUM_COUNTERS;
         counters = AMD_F15H_COUNTERS;
         ctrls = AMD_F15H_CTRLS;
xen/arch/x86/nmi.c +1 -1
index c3f92ed231..014524486f 100644
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
xen/arch/x86/traps.c +1 -1
index 0bcf554e93..33e5d21ece 100644
@@ -1939,7 +1939,7 @@ static unsigned int calc_ler_msr(void)
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;
         }
         break;
Signature · 1 line
2.11.0
#1 lore raw
Quoted 18 lines · Andrew Cooper
xen/arch/x86/nmi.c +1 -1
index c3f92ed231..014524486f 100644
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
xen/arch/x86/traps.c +0 -0
index 0bcf554e93..33e5d21ece 100644

xen/arch/x86/traps.c static unsigned int calc_ler_msr(void) · line 1943

Quoted 6 lines
xen/arch/x86/traps.c +1 -1
@@ -1939,7 +1939,7 @@ static unsigned int calc_ler_msr(void)
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;

You seem to also add support for Fam18h here and in the chunk above, is this intentional?

Thanks, Roger.

#2 lore raw
Quoted 19 lines · Roger Pau Monné
Quoted 18 lines · Andrew Cooper
xen/arch/x86/nmi.c +1 -1
index c3f92ed231..014524486f 100644
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
xen/arch/x86/traps.c +0 -0
index 0bcf554e93..33e5d21ece 100644
@@ -1939,7 +1939,7 @@ static unsigned int calc_ler_msr(void)
Quoted 8 lines

xen/arch/x86/traps.c static unsigned int calc_ler_msr(void) · line 1943

Quoted 6 lines
xen/arch/x86/traps.c +1 -1
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;

You seem to also add support for Fam18h here and in the chunk above, is this intentional?

Yes.  Honestly, these details have never changed since the K7.  I'm tempted to drop the family logic entirely.

~Andrew

Reviewed-by
#3 lore raw
Quoted 29 lines · Andrew Cooper
Quoted 19 lines · Roger Pau Monné
Quoted 18 lines · Andrew Cooper
xen/arch/x86/nmi.c +1 -1
index c3f92ed231..014524486f 100644
@@ -398,7 +398,7 @@ void setup_apic_nmi_watchdog(void)
     case X86_VENDOR_AMD:
         switch (boot_cpu_data.x86) {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             setup_k7_watchdog();
             break;
         default:
xen/arch/x86/traps.c +0 -0
index 0bcf554e93..33e5d21ece 100644
@@ -1939,7 +1939,7 @@ static unsigned int calc_ler_msr(void)
Quoted 8 lines

xen/arch/x86/traps.c static unsigned int calc_ler_msr(void) · line 1943

Quoted 6 lines
xen/arch/x86/traps.c +1 -1
         switch ( boot_cpu_data.x86 )
         {
         case 6:
-        case 0xf ... 0x17:
+        case 0xf ... 0x19:
             return MSR_IA32_LASTINTFROMIP;

You seem to also add support for Fam18h here and in the chunk above, is this intentional?

Quoted 2 lines

Yes.  Honestly, these details have never changed since the K7.  I'm tempted to drop the family logic entirely.

Ack, just wanted to be sure the changes where intentional:

Re dropping the logic - as you wish.

Thanks, Roger.

Reviewed-by on v1 1/1
#4 lore raw
In reply to Andrew Cooper
Quoted 3 lines · Andrew Cooper

Fam19h is very similar to Fam17h in these regards.

Nevertheless a question:

xen/arch/x86/cpu/microcode/amd.c static bool_t verify_patch_size(uint32_t patch_size) · line 130

Quoted 9 lines
xen/arch/x86/cpu/microcode/amd.c +1 -0
@@ -125,6 +125,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         max_size = F16H_MPB_MAX_SIZE;
         break;
     case 0x17:
+    case 0x19:
         max_size = F17H_MPB_MAX_SIZE;
         break;

Didn't you indicate to me the other day that the upper bound would grow?

Jan

#5 lore raw
Quoted 5 lines · Jan Beulich
Quoted 3 lines · Andrew Cooper

Fam19h is very similar to Fam17h in these regards.

Thanks.

Quoted 14 lines

Nevertheless a question:

xen/arch/x86/cpu/microcode/amd.c static bool_t verify_patch_size(uint32_t patch_size) · line 130

Quoted 9 lines
xen/arch/x86/cpu/microcode/amd.c +1 -0
@@ -125,6 +125,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         max_size = F16H_MPB_MAX_SIZE;
         break;
     case 0x17:
+    case 0x19:
         max_size = F17H_MPB_MAX_SIZE;
         break;

Didn't you indicate to me the other day that the upper bound would grow?

That was a very non-specific patch to Linux.  I've asked around, and the answer seems to be 4800.

Are you happy for your review to stand with adding a new F19H_MPB_MAX_SIZE define to this effect?

~Andrew

#6 lore raw
Quoted 14 lines · Andrew Cooper
Quoted 12 lines · Jan Beulich

xen/arch/x86/cpu/microcode/amd.c static bool_t verify_patch_size(uint32_t patch_size) · line 130

Quoted 9 lines · Andrew Cooper
xen/arch/x86/cpu/microcode/amd.c +1 -0
@@ -125,6 +125,7 @@ static bool_t verify_patch_size(uint32_t patch_size)
         max_size = F16H_MPB_MAX_SIZE;
         break;
     case 0x17:
+    case 0x19:
         max_size = F17H_MPB_MAX_SIZE;
         break;

Didn't you indicate to me the other day that the upper bound would grow?

Quoted 5 lines

That was a very non-specific patch to Linux.  I've asked around, and the answer seems to be 4800.

Are you happy for your review to stand with adding a new F19H_MPB_MAX_SIZE define to this effect?

Yes.

Jan