Skip to contentSkip to conversation

xen/arm: Park CPUs with a MIDR different from the boot CPU.

PATCH In review Julien Grall 3 participants 11 messages Jan 30, 2018 – Feb 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Park CPUs with a MIDR different from the boot CPU.

Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
 xen/arch/arm/smpboot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +15 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset,
 
     init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }
+
     mmu_init_secondary_cpu();
 
     gic_init_secondary_cpu();
Signature · 7 lines
2.11.0


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

Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
 xen/arch/arm/smpboot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +4 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset,
 
     init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.

xen/arch/arm/smpboot.c void start_secondary(unsigned long boot_phys_offset, · line 308

Quoted 10 lines
xen/arch/arm/smpboot.c +10 -0
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

Quoted 6 lines
xen/arch/arm/smpboot.c +0 -0
     mmu_init_secondary_cpu();
 
     gic_init_secondary_cpu();
Signature · 1 line
2.11.0

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

#2 lore raw
Quoted 53 lines · Stefano Stabellini
Quoted 38 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
 xen/arch/arm/smpboot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +4 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset,
 
     init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.

xen/arch/arm/smpboot.c void start_secondary(unsigned long boot_phys_offset, · line 308

Quoted 10 lines
xen/arch/arm/smpboot.c +10 -0
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

Quoted 8 lines

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata would not be applied correctly in the guest or because Xen is not able to know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we always use the boot MIDR. What would you choose now? The MIDR of the CPU where the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what has been discussed in the design document written by Dario. But that's a new feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the opinion to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable one set of CPUs in the DT directly.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#3 lore raw
Quoted 80 lines · Julien Grall
Quoted 53 lines · Stefano Stabellini
Quoted 38 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
 xen/arch/arm/smpboot.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +4 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset,
 
     init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.

xen/arch/arm/smpboot.c void start_secondary(unsigned long boot_phys_offset, · line 308

Quoted 10 lines
xen/arch/arm/smpboot.c +10 -0
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

Quoted 8 lines

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata would not be applied correctly in the guest or because Xen is not able to know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we always use the boot MIDR. What would you choose now? The MIDR of the CPU where the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what has been discussed in the design document written by Dario. But that's a new feature and would require some work to do it properly.

Quoted 5 lines

A command line option might be a good idea, but I would be more of the opinion to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable one set of CPUs in the DT directly.

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

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

#4 lore raw

Hi,

Quoted 81 lines · Stefano Stabellini
Quoted 80 lines · Julien Grall
Quoted 53 lines · Stefano Stabellini
Quoted 38 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1] https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
  xen/arch/arm/smpboot.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +4 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long boot_phys_offset,
 
      init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.

xen/arch/arm/smpboot.c void start_secondary(unsigned long boot_phys_offset, · line 308

Quoted 10 lines
xen/arch/arm/smpboot.c +10 -0
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

Quoted 8 lines

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata would not be applied correctly in the guest or because Xen is not able to know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we always use the boot MIDR. What would you choose now? The MIDR of the CPU where the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what has been discussed in the design document written by Dario. But that's a new feature and would require some work to do it properly.

Quoted 8 lines
Quoted 5 lines

A command line option might be a good idea, but I would be more of the opinion to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable one set of CPUs in the DT directly.

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

I would prefer to avoid term big.LITTLE in the command line option because it might be possible to have platform with more than two kind of CPUs. How about "smp=unsafe"?

Cheers,

Signature · 6 lines
Julien Grall

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

Hi,

Quoted 99 lines · Stefano Stabellini
Quoted 97 lines · Julien Grall
Quoted 60 lines · Stefano Stabellini
Quoted 45 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest
will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between
big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux
because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
  xen/arch/arm/smpboot.c | 15 +++++++++++++++
  1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +5 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
      init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.
+     *

xen/arch/arm/smpboot.c void start_secondary(unsigned long · line 310

Quoted 10 lines
xen/arch/arm/smpboot.c +9 -0
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU
 MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

Quoted 8 lines

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata
would not be applied correctly in the guest or because Xen is not able to know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we always
use the boot MIDR. What would you choose now? The MIDR of the CPU where the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what has
been discussed in the design document written by Dario. But that's a new feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the opinion
to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable one set of CPUs in the DT directly.

Quoted 6 lines
Quoted 2 lines

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

I would prefer to avoid term big.LITTLE in the command line option because it might be possible to have platform with more than two kind of CPUs. How about "smp=unsafe"?

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

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

#6 lore raw
Quoted 106 lines · Stefano Stabellini
Quoted 105 lines · Julien Grall

Hi,

Quoted 101 lines · Stefano Stabellini
Quoted 91 lines · Julien Grall
Quoted 60 lines · Stefano Stabellini
Quoted 45 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest
will always have the MIDR of the boot CPU (see arch_domain_create). At best the guest may see unreliable performance (vCPU switching between
big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux
because they target a specific kind of CPUs and may not work on other CPUs.

For the time being, park any CPUs with a MDIR different from the boot CPU. This will be revisited in the future once Xen gains understanding of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE on Xen has never been supported but we didn't make it clearly. This is becoming more apparent with code targeting specific CPUs.

---
   xen/arch/arm/smpboot.c | 15 +++++++++++++++
   1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +5 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
       init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now.
+     *

xen/arch/arm/smpboot.c void start_secondary(unsigned long · line 310

Quoted 10 lines
xen/arch/arm/smpboot.c +9 -0
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU
 MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness perspective, especially in regards to the SP2 mitigation.

Quoted 8 lines

At the same time I would also like to give the option for people that want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Could we introduce a command line to proceed anyway? But then the system would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata
would not be applied correctly in the guest or because Xen is not able to know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we always
use the boot MIDR. What would you choose now? The MIDR of the CPU where the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what has
been discussed in the design document written by Dario. But that's a new feature and would require some work to do it properly.

Quoted 6 lines

A command line option might be a good idea, but I would be more of the opinion
to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable one set of CPUs in the DT directly.

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

Quoted 7 lines
Quoted 3 lines

I would prefer to avoid term big.LITTLE in the command line option because it might be possible to have platform with more than two kind of CPUs. How about "smp=unsafe"?

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

Heterogeneous does not tell you what you are trying to do. I think it needs to be qualified with the smp (or something similar).\

How about mp_unsafe_heterogeneous=yes/no.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#7 lore raw
Quoted 133 lines · Julien Grall
Quoted 132 lines · Stefano Stabellini
Quoted 130 lines · Julien Grall

Hi,

Quoted 115 lines · Stefano Stabellini
Quoted 114 lines · Julien Grall
Quoted 75 lines · Stefano Stabellini
Quoted 60 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest
will always have the MIDR of the boot CPU (see arch_domain_create).
At best the guest may see unreliable performance (vCPU switching between
big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux
because they target a specific kind of CPUs and may not work on other
CPUs.

For the time being, park any CPUs with a MDIR different from the boot
CPU. This will be revisited in the future once Xen gains understanding
of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE
on Xen has never been supported but we didn't make it clearly. This is
becoming more apparent with code targeting specific CPUs.

---
   xen/arch/arm/smpboot.c | 15 +++++++++++++++
   1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +2 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
       init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of

CPUs.
+ * This assumption does not hold on big.LITTLE platform and
may

xen/arch/arm/smpboot.c +7 -0
+     * result to unstability. Better to park them for now.
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot

CPU
MIDR (0x%x).\n",

xen/arch/arm/smpboot.c

Quoted 4 lines
xen/arch/arm/smpboot.c +4 -0
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness
perspective, especially in regards to the SP2 mitigation.

At the same time I would also like to give the option for people that
want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Quoted 6 lines

Could we introduce a command line to proceed anyway? But then the system
would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much
trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata
would not be applied correctly in the guest or because Xen is not able to
know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we
always
use the boot MIDR. What would you choose now? The MIDR of the CPU where
the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what
has
been discussed in the design document written by Dario. But that's a new
feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the opinion
to delay that and see who is screaming about it.

Quoted 6 lines
Quoted 3 lines

My hunch is not many people will scream because today they tend to disable
one set of CPUs in the DT directly.

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

I would prefer to avoid term big.LITTLE in the command line option because it
might be possible to have platform with more than two kind of CPUs. How about
"smp=unsafe"?

Quoted 8 lines
Quoted 3 lines

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

Heterogeneous does not tell you what you are trying to do. I think it needs to be qualified with the smp (or something similar).\

How about mp_unsafe_heterogeneous=yes/no.

it's getting longer and longer, but OK :-) At least it's descriptive.

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

#8 lore raw

Hi,

Quoted 138 lines · Stefano Stabellini
Quoted 137 lines · Julien Grall
Quoted 135 lines · Stefano Stabellini
Quoted 122 lines · Julien Grall

Hi,

Quoted 119 lines · Stefano Stabellini
Quoted 117 lines · Julien Grall
Quoted 75 lines · Stefano Stabellini
Quoted 60 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest
will always have the MIDR of the boot CPU (see arch_domain_create).
At best the guest may see unreliable performance (vCPU switching between
big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux
because they target a specific kind of CPUs and may not work on other
CPUs.

For the time being, park any CPUs with a MDIR different from the boot
CPU. This will be revisited in the future once Xen gains understanding
of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE
on Xen has never been supported but we didn't make it clearly. This is
becoming more apparent with code targeting specific CPUs.

---
    xen/arch/arm/smpboot.c | 15 +++++++++++++++
    1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +2 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
        init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of

CPUs.
+ * This assumption does not hold on big.LITTLE platform and
may

xen/arch/arm/smpboot.c +7 -0
+     * result to unstability. Better to park them for now.
+     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot

CPU
MIDR (0x%x).\n",

xen/arch/arm/smpboot.c

Quoted 4 lines
xen/arch/arm/smpboot.c +4 -0
+               smp_processor_id(), current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness
perspective, especially in regards to the SP2 mitigation.

At the same time I would also like to give the option for people that
want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Quoted 6 lines

Could we introduce a command line to proceed anyway? But then the system
would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much
trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata
would not be applied correctly in the guest or because Xen is not able to
know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we
always
use the boot MIDR. What would you choose now? The MIDR of the CPU where
the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what
has
been discussed in the design document written by Dario. But that's a new
feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the opinion
to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable
one set of CPUs in the DT directly.

Quoted 8 lines
Quoted 2 lines

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

I would prefer to avoid term big.LITTLE in the command line option because it
might be possible to have platform with more than two kind of CPUs. How about
"smp=unsafe"?

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

Quoted 6 lines
Quoted 4 lines

Heterogeneous does not tell you what you are trying to do. I think it needs to be qualified with the smp (or something similar).\

How about mp_unsafe_heterogeneous=yes/no.

it's getting longer and longer, but OK :-) At least it's descriptive.

It will be easier to spot in the logs :). I will resend the patch next week with the command line added.

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#9 lore raw
Quoted 142 lines · Julien Grall

Hi,

Quoted 139 lines · Stefano Stabellini
Quoted 138 lines · Julien Grall
Quoted 136 lines · Stefano Stabellini
Quoted 123 lines · Julien Grall

Hi,

Quoted 120 lines · Stefano Stabellini
Quoted 118 lines · Julien Grall
Quoted 76 lines · Stefano Stabellini
Quoted 57 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a guest
will always have the MIDR of the boot CPU (see arch_domain_create).
At best the guest may see unreliable performance (vCPU switching between
big and LITTLE), at worst the guest will become unreliable or insecure.

This is becoming more apparent with branch predictor hardening in Linux
because they target a specific kind of CPUs and may not work on other
CPUs.

For the time being, park any CPUs with a MDIR different from the boot
CPU. This will be revisited in the future once Xen gains understanding
of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE
on Xen has never been supported but we didn't make it clearly. This is
becoming more apparent with code targeting specific CPUs.
---
    xen/arch/arm/smpboot.c | 15 +++++++++++++++

    1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +2 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
         init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind of

CPUs.
+     * This assumption does not hold on big.LITTLE platform and may
+     * result to unstability. Better to park them for now. +     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )

Quoted 8 lines

+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match boot CPU
MIDR (0x%x).\n",
+               smp_processor_id(), current_cpu_data.midr.bits, +               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness
perspective, especially in regards to the SP2 mitigation.

At the same time I would also like to give the option for people that
want to use big.LITTLE with cpupools / cpu pinning to do so if they really want to, but I am not sure what to suggest.

Quoted 6 lines

Could we introduce a command line to proceed anyway? But then the system
would be susceptible to SP2 in the cpus different from the boot cpu. Could we make the SP2 mitigation work on big.LITTLE or is it too much
trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU errata
would not be applied correctly in the guest or because Xen is not able to
know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment we
always
use the boot MIDR. What would you choose now? The MIDR of the CPU where
the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement what
has
been discussed in the design document written by Dario. But that's a new
feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the opinion
to delay that and see who is screaming about it.

My hunch is not many people will scream because today they tend to disable
one set of CPUs in the DT directly.

Quoted 8 lines
Quoted 2 lines

As discussed, are you going to resend with a command line option such as biglittle=unsafe or something like that?

I would prefer to avoid term big.LITTLE in the command line option because it
might be possible to have platform with more than two kind of CPUs. How about
"smp=unsafe"?

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

Quoted 8 lines
Quoted 6 lines
Quoted 4 lines

Heterogeneous does not tell you what you are trying to do. I think it needs to be qualified with the smp (or something similar).\

How about mp_unsafe_heterogeneous=yes/no.

it's getting longer and longer, but OK :-)  At least it's descriptive.

It will be easier to spot in the logs :). I will resend the patch next week with the command line added.

After looking at the design doc from Dario, I was wondering if we should name the option: hmp_unsafe (or amp_unsafe). This would make the name slightly shorter.

The description of the command line would be:

"Say yes at your own risk if you want to enable heterogenous computing (such as big.LITTLE). This may result to an unstable and insecure platform. By default cores which are not identical to the boot CPU will be parked and not used by Xen.".

Cheers,

Signature · 6 lines
Julien Grall

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
#10 lore raw
Quoted 186 lines · Julien Grall
Quoted 174 lines · Julien Grall

Hi,

Quoted 171 lines · Stefano Stabellini
Quoted 170 lines · Julien Grall
Quoted 161 lines · Stefano Stabellini
Quoted 152 lines · Julien Grall

Hi,

Quoted 140 lines · Stefano Stabellini
Quoted 139 lines · Julien Grall
Quoted 89 lines · Stefano Stabellini
Quoted 68 lines · Julien Grall

Xen does not properly support big.LITTLE platform. All vCPUs of a
guest
will always have the MIDR of the boot CPU (see arch_domain_create).
At best the guest may see unreliable performance (vCPU switching
between
big and LITTLE), at worst the guest will become unreliable or
insecure.

This is becoming more apparent with branch predictor hardening in
Linux
because they target a specific kind of CPUs and may not work on
other
CPUs.

For the time being, park any CPUs with a MDIR different from the
boot
CPU. This will be revisited in the future once Xen gains understanding
of big.LITTLE.

[1]
https://lists.xenproject.org/archives/html/xen-devel/2016-12/msg00826.html

---

We probably want to backport this as part of XSA-254. Using big.LITTLE
on Xen has never been supported but we didn't make it clearly.
This is
becoming more apparent with code targeting specific CPUs.
---
    xen/arch/arm/smpboot.c | 15 +++++++++++++++

    1 file changed, 15 insertions(+)
xen/arch/arm/smpboot.c +2 -0
index 1255185a9c..2c2815f9ee 100644
@@ -292,6 +292,21 @@ void start_secondary(unsigned long
 boot_phys_offset,
 
         init_traps();
 
+    /*
+     * Currently Xen assumes the platform has only one kind

of
CPUs.
+     * This assumption does not hold on big.LITTLE platform and
may
+     * result to unstability. Better to park them for now. +     *
+     * TODO: Add big.LITTLE support.
+     */
+    if ( current_cpu_data.midr.bits != boot_cpu_data.midr.bits )
+    {
+        printk(XENLOG_ERR "CPU%u MIDR (0x%x) does not match

Quoted 8 lines

boot
CPU
MIDR (0x%x).\n",
+               smp_processor_id(),
current_cpu_data.midr.bits,
+               boot_cpu_data.midr.bits);
+        stop_cpu();
+    }

I understand that this patch is the right thing to do from a correctness
perspective, especially in regards to the SP2 mitigation.

At the same time I would also like to give the option for people
that
want to use big.LITTLE with cpupools / cpu pinning to do so if they
really want to, but I am not sure what to suggest.

Quoted 9 lines

Could we introduce a command line to proceed anyway? But then the
system
would be susceptible to SP2 in the cpus different from the boot cpu.
Could we make the SP2 mitigation work on big.LITTLE or is it too
much
trouble? Do you have any other ideas or thoughts about this?

This patch is here to prevent to spread instability/insecurity or give
the feeling we do support big.LITTLE.

Even outside of SP2, there are possibility for instability because CPU
errata
would not be applied correctly in the guest or because Xen is not able
to
know that non CPUs may have a different cacheline size...

I want to end this idea that Xen may support big.LITTLE.

The first thing to modify is the vpdir (virtual MIDR), at the moment
we
always
use the boot MIDR. What would you choose now? The MIDR of the CPU
where
the hypercall happen?

There is no shortcut for big.LITTLE. The right thing is to implement
what
has
been discussed in the design document written by Dario. But that's a
new
feature and would require some work to do it properly.

A command line option might be a good idea, but I would be more of the
opinion
to delay that and see who is screaming about it.

Quoted 8 lines
Quoted 4 lines

My hunch is not many people will scream because today they tend to
disable
one set of CPUs in the DT directly.

As discussed, are you going to resend with a command line option such as
biglittle=unsafe or something like that?

Quoted 7 lines

I would prefer to avoid term big.LITTLE in the command line option because
it
might be possible to have platform with more than two kind of CPUs. How
about
"smp=unsafe"?

Quoted 3 lines

I am fine with not using big.LITTLE but smp=unsafe is a bit confusing. What do you think of: "heterogeneous=unsafe" it is a bit of a mouthful but it should be clearer.

Heterogeneous does not tell you what you are trying to do. I think it needs to
be qualified with the smp (or something similar).\

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

How about mp_unsafe_heterogeneous=yes/no.

it's getting longer and longer, but OK :-)  At least it's descriptive.

It will be easier to spot in the logs :). I will resend the patch next week with the command line added.

After looking at the design doc from Dario, I was wondering if we should name the option: hmp_unsafe (or amp_unsafe). This would make the name slightly shorter.

Quoted 6 lines

The description of the command line would be:

"Say yes at your own risk if you want to enable heterogenous computing (such as big.LITTLE). This may result to an unstable and insecure platform. By default cores which are not identical to the boot CPU will be parked and not used by Xen.".

Good idea, Julien. hmp_unsafe is far better.

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