[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] timer: fix NR_CPUS=1 build with gcc13


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Wed, 13 Sep 2023 09:31:57 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=/tiHzTrYqqG3aaqu9LsDUaxhtnU6xcOEZaIY6SzhcLI=; b=FhPMdOY4X1s6Bnxs3Fck3sBfWlHwiT7VtpXs0NqFSFgDTuR/9+MRFsc61iUp+flPX5G1afSUGHx5/m8aTqO7HXmS5xM5do+7KPd9QqJ0vCJvkAG4MRfH61gOEBshD2WMpCwWOdpXGsDYoFomZ6tjAEzl57hScA2zg0wX5mIdlR7IfVCeMS/thKdc9pAYq2XApsjn3t/bfLYvcd3YKZXnvCsxEhQ8dlhqXpujWHRoNABcMSIYJrBZDoEFvzfTVIqDGCLF7JEPtjnTk2UNvcBY7RKluNboi5r+ft2v77H2Ya3MdEAO/jCfmaFo7KIFZgmiojWg5/WfZc+nA5lql0z6MA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ai58XmAK60Y5crv7Ldek21LSTLBC8ox+o8jfZ2UVCYs3EwpUJJ2utQpdnEi2iamDOCBtt6dpZAiR0zqcLJg0xyKL+hxJlGCWBUHo7r6j7OyeT8613LplL+kLtjFH5ln1UvKpiX6E9kEmDPmb38xlOokFyzmep2xYayWbAUs6ny8L0OwBHvnxfPKOQwDaD0T7vhqR3csunTnrBKnOWBz6MT9+7DRSNrKQWD2Uj26yYnlXI5erl3o4iOoLQZskusQUyhz1cs541XUJhC/ZHLW8JSTmsc8rHxHB5kMidMNXS0GJuMtip08dTkBoJDr2BXZ4L3vzSIHlj4PHP3I5TEesUA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Wed, 13 Sep 2023 07:32:07 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Gcc13 apparently infers from "if ( old_cpu < new_cpu )" that "new_cpu"
is >= 1, and then (on x86) complains about "per_cpu(timers, new_cpu)"
exceeding __per_cpu_offset[]'s bounds (being an array of 1 in such a
configuration). Make the code conditional upon there being at least 2
CPUs configured (otherwise there simply is nothing to migrate [to]).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/common/timer.c
+++ b/xen/common/timer.c
@@ -356,6 +356,7 @@ bool timer_expires_before(struct timer *
 
 void migrate_timer(struct timer *timer, unsigned int new_cpu)
 {
+#if CONFIG_NR_CPUS > 1
     unsigned int old_cpu;
     bool_t active;
     unsigned long flags;
@@ -404,6 +405,7 @@ void migrate_timer(struct timer *timer,
 
     spin_unlock(&per_cpu(timers, old_cpu).lock);
     spin_unlock_irqrestore(&per_cpu(timers, new_cpu).lock, flags);
+#endif /* CONFIG_NR_CPUS > 1 */
 }
 
 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.