All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus
@ 2014-03-18 19:29 Eduardo Habkost
  2014-03-18 19:29 ` [Qemu-devel] [PATCH 1/2] sysemu.h: Document what MAX_CPUMASK_BITS really limits Eduardo Habkost
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eduardo Habkost @ 2014-03-18 19:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, Hu Tao, Igor Mammedov, Laszlo Ersek,
	Andreas Färber, Wanlong Gao

Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I
sent (which broke the build and where reverted).

Instead of renaming MAX_CPUMASK_BITS like I did previously, just document it
and use it on the (max_cpus > 255) check on vl.c.

Eduardo Habkost (2):
  sysemu.h: Document what MAX_CPUMASK_BITS really limits
  vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant

 include/sysemu/sysemu.h | 7 +++++++
 vl.c                    | 2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)

-- 
1.8.5.3

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

* [Qemu-devel] [PATCH 1/2] sysemu.h: Document what MAX_CPUMASK_BITS really limits
  2014-03-18 19:29 [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Eduardo Habkost
@ 2014-03-18 19:29 ` Eduardo Habkost
  2014-03-18 19:29 ` [Qemu-devel] [PATCH 2/2] vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant Eduardo Habkost
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2014-03-18 19:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, Hu Tao, Igor Mammedov, Laszlo Ersek,
	Andreas Färber, Wanlong Gao

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 include/sysemu/sysemu.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/include/sysemu/sysemu.h b/include/sysemu/sysemu.h
index c01304d..865e5f0 100644
--- a/include/sysemu/sysemu.h
+++ b/include/sysemu/sysemu.h
@@ -133,7 +133,14 @@ extern uint8_t qemu_extra_params_fw[2];
 extern QEMUClockType rtc_clock;
 
 #define MAX_NODES 64
+
+/* The following shall be true for all CPUs:
+ *   cpu->cpu_index < max_cpus <= MAX_CPUMASK_BITS
+ *
+ * Note that cpu->get_arch_id() may be larger than MAX_CPUMASK_BITS.
+ */
 #define MAX_CPUMASK_BITS 255
+
 extern int nb_numa_nodes;
 extern uint64_t node_mem[MAX_NODES];
 extern unsigned long *node_cpumask[MAX_NODES];
-- 
1.8.5.3

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

* [Qemu-devel] [PATCH 2/2] vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
  2014-03-18 19:29 [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Eduardo Habkost
  2014-03-18 19:29 ` [Qemu-devel] [PATCH 1/2] sysemu.h: Document what MAX_CPUMASK_BITS really limits Eduardo Habkost
@ 2014-03-18 19:29 ` Eduardo Habkost
  2014-03-18 19:40 ` [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Laszlo Ersek
  2014-03-19 11:21 ` Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Eduardo Habkost @ 2014-03-18 19:29 UTC (permalink / raw)
  To: qemu-devel
  Cc: Michael S. Tsirkin, Hu Tao, Igor Mammedov, Laszlo Ersek,
	Andreas Färber, Wanlong Gao

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 vl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vl.c b/vl.c
index f0fe48b..337f340 100644
--- a/vl.c
+++ b/vl.c
@@ -1418,7 +1418,7 @@ static void smp_parse(QemuOpts *opts)
         max_cpus = smp_cpus;
     }
 
-    if (max_cpus > 255) {
+    if (max_cpus > MAX_CPUMASK_BITS) {
         fprintf(stderr, "Unsupported number of maxcpus\n");
         exit(1);
     }
-- 
1.8.5.3

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

* Re: [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus
  2014-03-18 19:29 [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Eduardo Habkost
  2014-03-18 19:29 ` [Qemu-devel] [PATCH 1/2] sysemu.h: Document what MAX_CPUMASK_BITS really limits Eduardo Habkost
  2014-03-18 19:29 ` [Qemu-devel] [PATCH 2/2] vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant Eduardo Habkost
@ 2014-03-18 19:40 ` Laszlo Ersek
  2014-03-19 11:21 ` Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Laszlo Ersek @ 2014-03-18 19:40 UTC (permalink / raw)
  To: Eduardo Habkost, qemu-devel
  Cc: Igor Mammedov, Hu Tao, Andreas Färber, Wanlong Gao,
	Michael S. Tsirkin

On 03/18/14 20:29, Eduardo Habkost wrote:
> Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I
> sent (which broke the build and where reverted).
> 
> Instead of renaming MAX_CPUMASK_BITS like I did previously, just document it
> and use it on the (max_cpus > 255) check on vl.c.
> 
> Eduardo Habkost (2):
>   sysemu.h: Document what MAX_CPUMASK_BITS really limits
>   vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
> 
>  include/sysemu/sysemu.h | 7 +++++++
>  vl.c                    | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 

series
Reviewed-by: Laszlo Ersek <lersek@redhat.com>

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

* Re: [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus
  2014-03-18 19:29 [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Eduardo Habkost
                   ` (2 preceding siblings ...)
  2014-03-18 19:40 ` [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Laszlo Ersek
@ 2014-03-19 11:21 ` Michael S. Tsirkin
  3 siblings, 0 replies; 5+ messages in thread
From: Michael S. Tsirkin @ 2014-03-19 11:21 UTC (permalink / raw)
  To: Eduardo Habkost
  Cc: Hu Tao, qemu-devel, Igor Mammedov, Laszlo Ersek,
	Andreas Färber, Wanlong Gao

On Tue, Mar 18, 2014 at 04:29:22PM -0300, Eduardo Habkost wrote:
> Small rework of patches 6/7 and 7/7 from the previous APIC-ID-limit series I
> sent (which broke the build and where reverted).
> 
> Instead of renaming MAX_CPUMASK_BITS like I did previously, just document it
> and use it on the (max_cpus > 255) check on vl.c.


Applied, thanks!

> Eduardo Habkost (2):
>   sysemu.h: Document what MAX_CPUMASK_BITS really limits
>   vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant
> 
>  include/sysemu/sysemu.h | 7 +++++++
>  vl.c                    | 2 +-
>  2 files changed, 8 insertions(+), 1 deletion(-)
> 
> -- 
> 1.8.5.3

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

end of thread, other threads:[~2014-03-19 11:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-18 19:29 [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Eduardo Habkost
2014-03-18 19:29 ` [Qemu-devel] [PATCH 1/2] sysemu.h: Document what MAX_CPUMASK_BITS really limits Eduardo Habkost
2014-03-18 19:29 ` [Qemu-devel] [PATCH 2/2] vl.c: Use MAX_CPUMASK_BITS macro instead of hardcoded constant Eduardo Habkost
2014-03-18 19:40 ` [Qemu-devel] [PATCH 0/2] Document MAX_CPUMASK_BITS and use it when limiting max_cpus Laszlo Ersek
2014-03-19 11:21 ` Michael S. Tsirkin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.