xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Connor Davis <connojdavis@gmail.com>
To: xen-devel@lists.xenproject.org
Cc: Bobby Eshleman <bobbyeshleman@gmail.com>,
	Connor Davis <connojdavis@gmail.com>,
	George Dunlap <george.dunlap@citrix.com>,
	Dario Faggioli <dfaggioli@suse.com>
Subject: [PATCH for-next 3/6] xen/sched: Fix build when NR_CPUS == 1
Date: Thu, 25 Feb 2021 08:24:02 -0700	[thread overview]
Message-ID: <d0922adc698ab76223d76a0a7f328a72cedf00ad.1614265718.git.connojdavis@gmail.com> (raw)
In-Reply-To: <cover.1614265718.git.connojdavis@gmail.com>

Return from cpu_schedule_up when either cpu is 0 or
NR_CPUS == 1. This fixes the following:

core.c: In function 'cpu_schedule_up':
core.c:2769:19: error: array subscript 1 is above array bounds
of 'struct vcpu *[1]' [-Werror=array-bounds]
 2769 |     if ( idle_vcpu[cpu] == NULL )
      |

Signed-off-by: Connor Davis <connojdavis@gmail.com>
---
 xen/common/sched/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xen/common/sched/core.c b/xen/common/sched/core.c
index 9745a77eee..f5ec65bf9b 100644
--- a/xen/common/sched/core.c
+++ b/xen/common/sched/core.c
@@ -2763,7 +2763,7 @@ static int cpu_schedule_up(unsigned int cpu)
     cpumask_set_cpu(cpu, &sched_res_mask);
 
     /* Boot CPU is dealt with later in scheduler_init(). */
-    if ( cpu == 0 )
+    if ( cpu == 0 || NR_CPUS == 1 )
         return 0;
 
     if ( idle_vcpu[cpu] == NULL )
-- 
2.27.0



  parent reply	other threads:[~2021-02-25 15:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-25 15:23 [PATCH for-next 0/6] Minimal build for RISCV Connor Davis
2021-02-25 15:24 ` [PATCH for-next 1/6] xen/char: Default HAS_NS16550 to y only for X86 and ARM Connor Davis
2021-02-25 15:24 ` [PATCH for-next 2/6] xen/common: Guard iommu symbols with CONFIG_HAS_PASSTHROUGH Connor Davis
2021-02-25 15:45   ` Jan Beulich
2021-02-26  2:54     ` Connor Davis
2021-02-26  7:41       ` Jan Beulich
2021-02-25 15:24 ` Connor Davis [this message]
2021-02-25 15:50   ` [PATCH for-next 3/6] xen/sched: Fix build when NR_CPUS == 1 Jan Beulich
2021-02-26  3:08     ` Connor Davis
2021-02-26  8:31       ` Jan Beulich
2021-02-26 16:49         ` Dario Faggioli
2021-02-27  4:17         ` Connor Davis
2021-02-25 22:55   ` Bob Eshleman
2021-02-26  3:01     ` Connor Davis
2021-02-26 15:21       ` Bob Eshleman
2021-02-25 15:24 ` [PATCH for-next 4/6] xen: Fix build when !CONFIG_GRANT_TABLE Connor Davis
2021-02-25 15:53   ` Jan Beulich
2021-02-26  3:36     ` Connor Davis
2021-02-25 15:24 ` [PATCH for-next 5/6] xen: Add files needed for minimal riscv build Connor Davis
2021-02-25 23:14   ` Andrew Cooper
2021-02-26  1:06     ` Stefano Stabellini
2021-02-27  4:05       ` Connor Davis
2021-02-26  3:29     ` Connor Davis
2021-02-26 15:30     ` Bob Eshleman
2021-02-26 15:55       ` Andrew Cooper
2021-02-26 16:21         ` Bob Eshleman
2021-02-26 16:56           ` Andrew Cooper
2021-03-12 17:01   ` Jan Beulich
2021-03-12 17:09   ` Jan Beulich
2021-05-14  3:25     ` Connor Davis
2021-02-25 15:24 ` [PATCH for-next 6/6] automation: add container for riscv64 builds Connor Davis
2021-02-26  0:31   ` Stefano Stabellini
2021-02-26  6:15     ` Connor Davis
2021-02-26 15:54 ` [PATCH for-next 0/6] Minimal build for RISCV Bob Eshleman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d0922adc698ab76223d76a0a7f328a72cedf00ad.1614265718.git.connojdavis@gmail.com \
    --to=connojdavis@gmail.com \
    --cc=bobbyeshleman@gmail.com \
    --cc=dfaggioli@suse.com \
    --cc=george.dunlap@citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).