Skip to contentSkip to conversation

build: introduce CONFIG_NR_CPUS in Kconfig

PATCH In review Doug Goldstein 2 participants 7 messages Jan 11, 2016 – Jan 13, 2016

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 build: introduce CONFIG_NR_CPUS in Kconfig

Introduce an option where the user can modifiy the maximum number of supported physical CPUs.

CC Ian Campbell <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Andrew Cooper <[email protected]>
---
 xen/arch/Kconfig     | 8 ++++++++
 xen/arch/arm/Kconfig | 2 ++
 xen/arch/x86/Kconfig | 2 ++
 3 files changed, 12 insertions(+)
 create mode 100644 xen/arch/Kconfig
xen/arch/Kconfig new file +8 -0
new file mode 100644
index 0000000..aacd73c
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 65536
+	default "256" if X86
+	default "128" if ARM
+	---help---
+	  Specifies the maximum number of physical CPUs which Xen will support.
xen/arch/arm/Kconfig +2 -0
index 2cab17b..60e923c 100644
@@ -31,6 +31,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 # Select HAS_GICV3 if GICv3 is supported
 config HAS_GICV3
 	bool
xen/arch/x86/Kconfig +2 -0
index 7d2ed96..e1c03bb 100644
@@ -25,6 +25,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 endmenu
 
 source "common/Kconfig"
Signature · 1 line
2.4.10
#1 lore raw

PATCH v2 2/2 build: convert NR_CPUS to Kconfig

Use CONFIG_NR_CPUS from Kconfig as NR_CPUS instead of the previous MAX_PHYS_CPUS variable from make. Remove the creation of MAX_PHYS_CPUS as well.

CC Ian Campbell <[email protected]>
CC Stefano Stabellini <[email protected]>
CC Keir Fraser <[email protected]>
CC Jan Beulich <[email protected]>
CC Andrew Cooper <[email protected]>
---
 xen/Rules.mk                 | 3 ---
 xen/include/asm-arm/config.h | 6 ------
 xen/include/asm-x86/config.h | 6 ------
 xen/include/xen/config.h     | 3 +++
 4 files changed, 3 insertions(+), 15 deletions(-)
xen/Rules.mk +0 -3
index f7ddc69..b5f1041 100644
@@ -61,9 +61,6 @@ CFLAGS-$(perfc_arrays)  += -DPERF_ARRAYS
 CFLAGS-$(lock_profile)  += -DLOCK_PROFILE
 CFLAGS-$(frame_pointer) += -fno-omit-frame-pointer -DCONFIG_FRAME_POINTER
 
-ifneq ($(max_phys_cpus),)
-CFLAGS-y                += -DMAX_PHYS_CPUS=$(max_phys_cpus)
-endif
 ifneq ($(max_phys_irqs),)
 CFLAGS-y                += -DMAX_PHYS_IRQS=$(max_phys_irqs)
 endif
xen/include/asm-arm/config.h +0 -6
index 1520b41..bd832df 100644
@@ -45,12 +45,6 @@
 
 #define OPT_CONSOLE_STR "dtuart"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 128
-#endif
-
 #ifdef CONFIG_ARM_64
 #define MAX_VIRT_CPUS 128
 #else
xen/include/asm-x86/config.h +0 -6
index f25d92e..3958ea0 100644
@@ -60,12 +60,6 @@
 
 #define OPT_CONSOLE_STR "vga"
 
-#ifdef MAX_PHYS_CPUS
-#define NR_CPUS MAX_PHYS_CPUS
-#else
-#define NR_CPUS 256
-#endif
-
 /* Linkage for x86 */
 #define __ALIGN .align 16,0x90
 #define __ALIGN_STR ".align 16,0x90"
xen/include/xen/config.h +3 -0
index 7595599..cde2006 100644
@@ -92,4 +92,7 @@
 #define FLASK_AVC_STATS 1
 #endif
 
+/* allow existing code to work with Kconfig variable */
+#define NR_CPUS CONFIG_NR_CPUS
+
 #endif /* __XEN_CONFIG_H__ */
Signature · 1 line
2.4.10
#2 lore raw

Re: [PATCH v2 2/2] build: convert NR_CPUS to Kconfig

xen/include/xen/config.h line 96

Quoted 9 lines
Quoted 1 line
Quoted 1 line · On 11.01.16 at 23:02, <[email protected]> wrote:
xen/include/xen/config.h +2 -0
@@ -92,4 +92,7 @@
 #define FLASK_AVC_STATS 1
 #endif
 
+/* allow existing code to work with Kconfig variable */
+#define NR_CPUS CONFIG_NR_CPUS

Perhaps here or in a follow-up patch derive CONFIG_SMP (used in a few places in ARM code) from NR_CPUS > 1?

Jan

#3 lore raw

Re: [PATCH v2 2/2] build: convert NR_CPUS to Kconfig

Quoted 7 lines · Jan Beulich
Quoted 7 lines
Quoted 1 line
Quoted 1 line · On 11.01.16 at 23:02, <[email protected]> wrote:
xen/include/xen/config.h +0 -0
@@ -92,4 +92,7 @@
 #define FLASK_AVC_STATS 1
 #endif
 
Quoted 8 lines

xen/include/xen/config.h line 96

Quoted 2 lines
xen/include/xen/config.h +2 -0
+/* allow existing code to work with Kconfig variable */
+#define NR_CPUS CONFIG_NR_CPUS

Perhaps here or in a follow-up patch derive CONFIG_SMP (used in a few places in ARM code) from NR_CPUS > 1?

Jan

I agree with you. That's actually in a follow on. I've got most of the CONFIG_ fields in a branch locally and as each patch gets reviewed I'm submitting more.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#4 lore raw
In reply to Doug Goldstein

xen/arch/Kconfig line 4

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 11.01.16 at 23:02, <[email protected]> wrote:
xen/arch/Kconfig new file +4 -0
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 65536

Why did you change this to 64k, when we settled on 4k-1 being correct? I don't mind fixing this up upon commit, but I'd like it to be confirmed that this was unintentional.

Jan

#5 lore raw
Quoted 13 lines · Jan Beulich

xen/arch/Kconfig line 4

Quoted 8 lines
Quoted 1 line
Quoted 1 line · On 11.01.16 at 23:02, <[email protected]> wrote:
xen/arch/Kconfig new file +4 -0
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 65536

Why did you change this to 64k, when we settled on 4k-1 being correct? I don't mind fixing this up upon commit, but I'd like it to be confirmed that this was unintentional.

Quoted 2 lines

Jan

It was definitely unintentional. I must have edited the patch to make it 4095 the first time before I sent it.

Signature · 1 line
Doug Goldstein

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#6 lore raw

PATCH v2 1/2 build: introduce CONFIG_NR_CPUS in Kconfig

In reply to Jan Beulich

Introduce an option where the user can modifiy the maximum number of supported physical CPUs.

---
 xen/arch/Kconfig     | 8 ++++++++
 xen/arch/arm/Kconfig | 2 ++
 xen/arch/x86/Kconfig | 2 ++
 3 files changed, 12 insertions(+)
 create mode 100644 xen/arch/Kconfig
xen/arch/Kconfig new file +8 -0
new file mode 100644
index 0000000..cf0acb7
@@ -0,0 +1,8 @@
+
+config NR_CPUS
+	int "Maximum number of physical CPUs"
+	range 1 4095
+	default "256" if X86
+	default "128" if ARM
+	---help---
+	  Specifies the maximum number of physical CPUs which Xen will support.
xen/arch/arm/Kconfig +2 -0
index 2cab17b..60e923c 100644
@@ -31,6 +31,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 # Select HAS_GICV3 if GICv3 is supported
 config HAS_GICV3
 	bool
xen/arch/x86/Kconfig +2 -0
index d629767..4781b34 100644
@@ -25,6 +25,8 @@ config ARCH_DEFCONFIG
 
 menu "Architecture Features"
 
+source "arch/Kconfig"
+
 config BIGMEM
 	bool "big memory support"
 	default n
Signature · 1 line
2.4.10