From patchwork Wed Sep 4 10:15:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13790327 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id ED9D3CA0ED3 for ; Wed, 4 Sep 2024 10:15:41 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.790020.1199705 (Exim 4.92) (envelope-from ) id 1sln2h-0000V1-9l; Wed, 04 Sep 2024 10:15:15 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 790020.1199705; Wed, 04 Sep 2024 10:15:15 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sln2h-0000Uu-6f; Wed, 04 Sep 2024 10:15:15 +0000 Received: by outflank-mailman (input) for mailman id 790020; Wed, 04 Sep 2024 10:15:14 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sln2g-0000Uo-8x for xen-devel@lists.xenproject.org; Wed, 04 Sep 2024 10:15:14 +0000 Received: from mail-lf1-x12b.google.com (mail-lf1-x12b.google.com [2a00:1450:4864:20::12b]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 92452190-6aa6-11ef-99a1-01e77a169b0f; Wed, 04 Sep 2024 12:15:12 +0200 (CEST) Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5333b2fbedaso11181507e87.0 for ; Wed, 04 Sep 2024 03:15:12 -0700 (PDT) Received: from [10.156.60.236] (ip-037-024-206-209.um08.pools.vodafone-ip.de. [37.24.206.209]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a898922259esm788550766b.209.2024.09.04.03.15.11 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 04 Sep 2024 03:15:11 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 92452190-6aa6-11ef-99a1-01e77a169b0f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1725444912; x=1726049712; darn=lists.xenproject.org; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=GeNIzN2b2u/5QAD5o+qedFl6/Bre1iyXww+BMt4MVLk=; b=BOQKnJeCV+vXlJ+G0/5GsbhSrSSzrfyBBqubPMUTR9k1FY41pLjCmav/c4mLsF4Hu2 svL6l4RDjQcvM8WCBtNKfDS82gel/heUlbHaE1sLKSndY+8Y1W8LynvwZLkf8Xo7dic+ M1c1nY/CY41I1IhHwDg38Ul2s9WTdUD06CLJrx1/eYEKZlApWTCK/S0VczXcNVZKadY1 L8s91HVC/wu/CJxzCzun4fTUd0rfiagWnQd9LdQOl7LJhrIjqaBL407tbGvOWERhbqMd P3lw/i8LrN69Khx7ivXcAQp+bmphlOLMSlCJtGbqIQeOznR7Mi3dYDCPo3LAwrkQRd2D wxKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725444912; x=1726049712; h=content-transfer-encoding:autocrypt:subject:from:cc:to :content-language:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GeNIzN2b2u/5QAD5o+qedFl6/Bre1iyXww+BMt4MVLk=; b=ZXJnAJKjpVTeALREgoUq3+CUaU+uqmol5Rpf68vcbyMR5Wm+ZmoVZ9xEY9JdIHAnMS AUBX+LbtMDt6nlQjz70jalz80f37wXADoIKgAvqFz1qSUdp1TMlPQAxVOjyGIe9HAU5q +PFv3MvL3WsDUqEI65bBmCx7HCuPi6y+8VR8Lzi4jMD+0LPP1qJ9ynP3bE74cLun8ZyI kq4SI683m9x6B9K5gn0eKtnDWtLfwYsKUe2HsiZq4W2NTFYWVx1Ltd6ysjjEmw/h4/mP FB/tS9obkCl5zM9BbsqfpFwqmOrWam5OYRB7U4NSpP5FKZnPzZqvuZoxfEQyAzwnJG8q z7eg== X-Gm-Message-State: AOJu0YxNQ57+PRYuJqy8H53pazJt7BpOJSWqe4ExwMt8Qh2bQbGX1iyA Hp10F1DAFwePuu/+5iquDlE4L9fgRH3gYJpkltBLLkSHN8RlMQCGk3fpniDT+d9tUUEOpOs7FVA = X-Google-Smtp-Source: AGHT+IGHYDtReK+cg/Jpy2sMNL/Yu2TNJI8ebV+xYmPb18b6ZVagPybUCDByWcomQFCvf8pt5udrZQ== X-Received: by 2002:a05:6512:3352:b0:535:6992:f2c3 with SMTP id 2adb3069b0e04-5356992f3dcmr602076e87.41.1725444911650; Wed, 04 Sep 2024 03:15:11 -0700 (PDT) Message-ID: <6c7e29c6-eefa-48a2-9f02-e74b35d0438c@suse.com> Date: Wed, 4 Sep 2024 12:15:10 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , =?utf-8?q?Roger_Pau_Monn?= =?utf-8?q?=C3=A9?= From: Jan Beulich Subject: [PATCH] x86: fix UP build with gcc14 Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM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2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL The complaint is: In file included from ././include/xen/config.h:17, from : arch/x86/smpboot.c: In function ‘link_thread_siblings.constprop’: ./include/asm-generic/percpu.h:16:51: error: array subscript [0, 0] is outside array bounds of ‘long unsigned int[1]’ [-Werror=array-bounds=] 16 | (*RELOC_HIDE(&per_cpu__##var, __per_cpu_offset[cpu])) ./include/xen/compiler.h:140:29: note: in definition of macro ‘RELOC_HIDE’ 140 | (typeof(ptr)) (__ptr + (off)); }) | ^~~ arch/x86/smpboot.c:238:27: note: in expansion of macro ‘per_cpu’ 238 | cpumask_set_cpu(cpu2, per_cpu(cpu_sibling_mask, cpu1)); | ^~~~~~~ In file included from ./arch/x86/include/generated/asm/percpu.h:1, from ./include/xen/percpu.h:30, from ./arch/x86/include/asm/cpuid.h:9, from ./arch/x86/include/asm/cpufeature.h:11, from ./arch/x86/include/asm/system.h:6, from ./include/xen/list.h:11, from ./include/xen/mm.h:68, from arch/x86/smpboot.c:12: ./include/asm-generic/percpu.h:12:22: note: while referencing ‘__per_cpu_offset’ 12 | extern unsigned long __per_cpu_offset[NR_CPUS]; | ^~~~~~~~~~~~~~~~ Which I consider bogus in the first place ("array subscript [0, 0]" vs a 1-element array). Yet taking the experience from 99f942f3d410 ("Arm64: adjust __irq_to_desc() to fix build with gcc14") I guessed that switching function parameters to unsigned int (which they should have been anyway) might help. And voilà ... Signed-off-by: Jan Beulich Acked-by: Andrew Cooper --- a/xen/arch/x86/smpboot.c +++ b/xen/arch/x86/smpboot.c @@ -226,7 +226,7 @@ static int booting_cpu; /* CPUs for which sibling maps can be computed. */ static cpumask_t cpu_sibling_setup_map; -static void link_thread_siblings(int cpu1, int cpu2) +static void link_thread_siblings(unsigned int cpu1, unsigned int cpu2) { cpumask_set_cpu(cpu1, per_cpu(cpu_sibling_mask, cpu2)); cpumask_set_cpu(cpu2, per_cpu(cpu_sibling_mask, cpu1));