From patchwork Thu Aug 29 05:55:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13782461 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 762DCC71151 for ; Thu, 29 Aug 2024 05:55:26 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.785450.1194888 (Exim 4.92) (envelope-from ) id 1sjY7k-0003D1-9h; Thu, 29 Aug 2024 05:55:12 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 785450.1194888; Thu, 29 Aug 2024 05:55:12 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjY7k-0003Cu-6X; Thu, 29 Aug 2024 05:55:12 +0000 Received: by outflank-mailman (input) for mailman id 785450; Thu, 29 Aug 2024 05:55:11 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1sjY7i-0003Co-Uw for xen-devel@lists.xenproject.org; Thu, 29 Aug 2024 05:55:11 +0000 Received: from mail-lf1-x135.google.com (mail-lf1-x135.google.com [2a00:1450:4864:20::135]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 3f85b0b2-65cb-11ef-a0b0-8be0dac302b0; Thu, 29 Aug 2024 07:55:09 +0200 (CEST) Received: by mail-lf1-x135.google.com with SMTP id 2adb3069b0e04-5334b0e1a8eso325363e87.0 for ; Wed, 28 Aug 2024 22:55:09 -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-a8988feb112sm31713966b.39.2024.08.28.22.55.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 28 Aug 2024 22:55:08 -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: 3f85b0b2-65cb-11ef-a0b0-8be0dac302b0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=google; t=1724910908; x=1725515708; 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=TChNeicFWEvZRxp5rEEVegR0lK4vwAbrXE7Ewib5yl8=; b=dGBAL4swy2XlWp0WNSKV9DA8nJ+lI+3T1zhVuExSs8Fseg0jYP5CcI/zgLpSxIoeFl zmQIOSijCo1tnaj8tgTfWaBFUMRVz3LkXWOW5t37hQHaoh73sXeGTnz6X5T3LnErRGwT qCPgRMd0oV6fENvN0BtJ+OTo+sQYCzqEP0x26euPIYZcrkMmCsyTBkTLkE7wxsqgXeT7 ObS04OJOoEo72MvHBuWwbQbog9T/7l+3tRPjIThX+KMSQXsy8HS50R9qK61eh3tdcnjM cL91bj/l1yrzP92NfEpIB1pPte4yWvAtq/w4SX4ftNwrDs6VfYYX2e3ZQLAOiK8jWnnU 1IpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724910908; x=1725515708; 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=TChNeicFWEvZRxp5rEEVegR0lK4vwAbrXE7Ewib5yl8=; b=T2Cum6PjoQ47BjPfVy+PdmN3T3V9jYHVPCltz/tjueBuzTg1wVq+aS5//7kJ7H+lWC mk43Fw3XCsYQgmCucnNE3yrD3LkrTrdruG9PDKMDMywBQQmIQdh+iL0cHploWBvasDnb QBzc+9HeG6HdCfvDprwindTm/gdSZbrM5EgB2JngDIBoceJkigOewwMNjdwIXecrziG2 dFmTxU22eNn/WvgeI4fUiHEz5oHIWKfOoZ3pJhXcZFyz2HPtFRlwfH8VP+mdJIVZryR5 rn/E67BGQWJ9//hsGraLhG37e4X8mVlm+Oc8zpXScqXVQA8RZiverQwZdnBv5y3hVAy6 WzKQ== X-Gm-Message-State: AOJu0YxSOzOJwPyvnjb54C8G0xWPBONeRmP7pAcvESOB0UVA4Le7N4MB ppJfSQkvjB4Xo7Vf7vWmKgoDZEgZxlNSaiiaXhLEY0A34QI77XYqkCOFYdebRkuJ7uT0MJ02GVw = X-Google-Smtp-Source: AGHT+IGEZVS9fixFILZZKvdr8rWtiNHg0swOH2e2TQEZMm4TGDdKtU3nb1kOJBXVRQEhLURtF/YeZA== X-Received: by 2002:a05:6512:2210:b0:52e:d0f8:2d30 with SMTP id 2adb3069b0e04-5353e5be49emr1072170e87.59.1724910908368; Wed, 28 Aug 2024 22:55:08 -0700 (PDT) Message-ID: <9cc9e16d-a4b0-4902-9f12-a7cb337b1763@suse.com> Date: Thu, 29 Aug 2024 07:55:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Julien Grall , Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , Michal Orzel From: Jan Beulich Subject: [PATCH] Arm64: adjust __irq_to_desc() to fix build with gcc14 Autocrypt: addr=jbeulich@suse.com; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf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g0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL With the original code I observe In function ‘__irq_to_desc’, inlined from ‘route_irq_to_guest’ at arch/arm/irq.c:465:12: arch/arm/irq.c:54:16: error: array subscript -2 is below array bounds of ‘irq_desc_t[32]’ {aka ‘struct irq_desc[32]’} [-Werror=array-bounds=] 54 | return &this_cpu(local_irq_desc)[irq]; | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ which looks pretty bogus: How in the world does the compiler arrive at -2 when compiling route_irq_to_guest()? Yet independent of that the function's parameter wants to be of unsigned type anyway, as shown by a vast majority of callers (others use plain int when they really mean non-negative quantities). With that adjustment the code compiles fine again. Signed-off-by: Jan Beulich Acked-by: Michal Orzel --- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116519 --- a/xen/arch/arm/include/asm/irq.h +++ b/xen/arch/arm/include/asm/irq.h @@ -56,7 +56,7 @@ extern const unsigned int nr_irqs; struct irq_desc; struct irqaction; -struct irq_desc *__irq_to_desc(int irq); +struct irq_desc *__irq_to_desc(unsigned int irq); #define irq_to_desc(irq) __irq_to_desc(irq) --- unstable.orig/xen/arch/arm/irq.c 2024-06-28 15:56:44.000000000 +0200 +++ unstable/xen/arch/arm/irq.c 2024-08-28 15:12:10.333607505 +0200 @@ -48,7 +48,7 @@ void irq_end_none(struct irq_desc *irq) static irq_desc_t irq_desc[NR_IRQS]; static DEFINE_PER_CPU(irq_desc_t[NR_LOCAL_IRQS], local_irq_desc); -struct irq_desc *__irq_to_desc(int irq) +struct irq_desc *__irq_to_desc(unsigned int irq) { if ( irq < NR_LOCAL_IRQS ) return &this_cpu(local_irq_desc)[irq];