qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro
@ 2021-11-05 18:42 Peter Maydell
  2021-11-05 18:51 ` Philippe Mathieu-Daudé
  2021-11-05 22:30 ` Cédric Le Goater
  0 siblings, 2 replies; 3+ messages in thread
From: Peter Maydell @ 2021-11-05 18:42 UTC (permalink / raw)
  To: qemu-devel; +Cc: Mark Cave-Ayland, qemu-ppc

The mac.h header defines a MAX_CPUS macro. This is confusingly named,
because it suggests it's a generic setting, but in fact it's used
by only the g3beige and mac99 machines. It's also using a single
macro for two values which aren't inherently the same -- if one
of these two machines was updated to support SMP configurations
then it would want a different max_cpus value to the other.

Since the macro is used in only two places, just expand it out
and get rid of it. If hypothetical future work to support SMP
in these boards needs a compile-time-known limit on the number
of CPUs, we can give it a suitable name at that point.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
Minor bit of cleanup prompted by discussion on
https://gitlab.com/qemu-project/qemu/-/issues/672
---
 hw/ppc/mac.h          | 3 ---
 hw/ppc/mac_newworld.c | 3 ++-
 hw/ppc/mac_oldworld.c | 3 ++-
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
index 22c8408078d..a1fa8f8e41a 100644
--- a/hw/ppc/mac.h
+++ b/hw/ppc/mac.h
@@ -36,9 +36,6 @@
 #include "hw/pci-host/uninorth.h"
 #include "qom/object.h"
 
-/* SMP is not enabled, for now */
-#define MAX_CPUS 1
-
 #define NVRAM_SIZE        0x2000
 #define PROM_FILENAME    "openbios-ppc"
 
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 7bb7ac39975..4bddb529c2a 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -581,7 +581,8 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
     mc->desc = "Mac99 based PowerMAC";
     mc->init = ppc_core99_init;
     mc->block_default_type = IF_IDE;
-    mc->max_cpus = MAX_CPUS;
+    /* SMP is not supported currently */
+    mc->max_cpus = 1;
     mc->default_boot_order = "cd";
     mc->default_display = "std";
     mc->kvm_type = core99_kvm_type;
diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
index de2be960e6c..7016979a7cd 100644
--- a/hw/ppc/mac_oldworld.c
+++ b/hw/ppc/mac_oldworld.c
@@ -423,7 +423,8 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
     mc->desc = "Heathrow based PowerMAC";
     mc->init = ppc_heathrow_init;
     mc->block_default_type = IF_IDE;
-    mc->max_cpus = MAX_CPUS;
+    /* SMP is not supported currently */
+    mc->max_cpus = 1;
 #ifndef TARGET_PPC64
     mc->is_default = true;
 #endif
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro
  2021-11-05 18:42 [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro Peter Maydell
@ 2021-11-05 18:51 ` Philippe Mathieu-Daudé
  2021-11-05 22:30 ` Cédric Le Goater
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2021-11-05 18:51 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: qemu-ppc, Mark Cave-Ayland

On 11/5/21 19:42, Peter Maydell wrote:
> The mac.h header defines a MAX_CPUS macro. This is confusingly named,
> because it suggests it's a generic setting, but in fact it's used
> by only the g3beige and mac99 machines. It's also using a single
> macro for two values which aren't inherently the same -- if one
> of these two machines was updated to support SMP configurations
> then it would want a different max_cpus value to the other.
> 
> Since the macro is used in only two places, just expand it out
> and get rid of it. If hypothetical future work to support SMP
> in these boards needs a compile-time-known limit on the number
> of CPUs, we can give it a suitable name at that point.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> Minor bit of cleanup prompted by discussion on
> https://gitlab.com/qemu-project/qemu/-/issues/672
> ---
>  hw/ppc/mac.h          | 3 ---
>  hw/ppc/mac_newworld.c | 3 ++-
>  hw/ppc/mac_oldworld.c | 3 ++-
>  3 files changed, 4 insertions(+), 5 deletions(-)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro
  2021-11-05 18:42 [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro Peter Maydell
  2021-11-05 18:51 ` Philippe Mathieu-Daudé
@ 2021-11-05 22:30 ` Cédric Le Goater
  1 sibling, 0 replies; 3+ messages in thread
From: Cédric Le Goater @ 2021-11-05 22:30 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: qemu-ppc, Mark Cave-Ayland

On 11/5/21 19:42, Peter Maydell wrote:
> The mac.h header defines a MAX_CPUS macro. This is confusingly named,
> because it suggests it's a generic setting, but in fact it's used
> by only the g3beige and mac99 machines. It's also using a single
> macro for two values which aren't inherently the same -- if one
> of these two machines was updated to support SMP configurations
> then it would want a different max_cpus value to the other.
> 
> Since the macro is used in only two places, just expand it out
> and get rid of it. If hypothetical future work to support SMP
> in these boards needs a compile-time-known limit on the number
> of CPUs, we can give it a suitable name at that point.

Yes. the mac99 could theoretically support SMP with the 970MP CPU
but I have never seen plan for this.

Anyhow,
  
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Cédric Le Goater <clg@kaod.org>

Thanks,

C.

> ---
> Minor bit of cleanup prompted by discussion on
> https://gitlab.com/qemu-project/qemu/-/issues/672
> ---
>   hw/ppc/mac.h          | 3 ---
>   hw/ppc/mac_newworld.c | 3 ++-
>   hw/ppc/mac_oldworld.c | 3 ++-
>   3 files changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/ppc/mac.h b/hw/ppc/mac.h
> index 22c8408078d..a1fa8f8e41a 100644
> --- a/hw/ppc/mac.h
> +++ b/hw/ppc/mac.h
> @@ -36,9 +36,6 @@
>   #include "hw/pci-host/uninorth.h"
>   #include "qom/object.h"
>   
> -/* SMP is not enabled, for now */
> -#define MAX_CPUS 1
> -
>   #define NVRAM_SIZE        0x2000
>   #define PROM_FILENAME    "openbios-ppc"
>   
> diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
> index 7bb7ac39975..4bddb529c2a 100644
> --- a/hw/ppc/mac_newworld.c
> +++ b/hw/ppc/mac_newworld.c
> @@ -581,7 +581,8 @@ static void core99_machine_class_init(ObjectClass *oc, void *data)
>       mc->desc = "Mac99 based PowerMAC";
>       mc->init = ppc_core99_init;
>       mc->block_default_type = IF_IDE;
> -    mc->max_cpus = MAX_CPUS;
> +    /* SMP is not supported currently */
> +    mc->max_cpus = 1;
>       mc->default_boot_order = "cd";
>       mc->default_display = "std";
>       mc->kvm_type = core99_kvm_type;
> diff --git a/hw/ppc/mac_oldworld.c b/hw/ppc/mac_oldworld.c
> index de2be960e6c..7016979a7cd 100644
> --- a/hw/ppc/mac_oldworld.c
> +++ b/hw/ppc/mac_oldworld.c
> @@ -423,7 +423,8 @@ static void heathrow_class_init(ObjectClass *oc, void *data)
>       mc->desc = "Heathrow based PowerMAC";
>       mc->init = ppc_heathrow_init;
>       mc->block_default_type = IF_IDE;
> -    mc->max_cpus = MAX_CPUS;
> +    /* SMP is not supported currently */
> +    mc->max_cpus = 1;
>   #ifndef TARGET_PPC64
>       mc->is_default = true;
>   #endif
> 



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-11-05 22:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-05 18:42 [PATCH] hw/ppc/mac.h: Remove MAX_CPUS macro Peter Maydell
2021-11-05 18:51 ` Philippe Mathieu-Daudé
2021-11-05 22:30 ` Cédric Le Goater

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).