From patchwork Tue Oct 22 00:47:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra Rao Ananta X-Patchwork-Id: 13844947 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 7B99ED1714E for ; Tue, 22 Oct 2024 01:06:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=eTpDcLprhbUi5YHe62ZQ4u0o+/QxbhbJTnRiVU+yROI=; b=YfZDYGJ2c9yY/kXkCW3pL5jChm fc3bMzlB3p32eQm+s45Kq6D0oNoh2KzNY8bPy3kg69Ex6kWnWsRQWDO7XE5sxHAuoS0zT9H5ews1j f6stLfWaFNv+LtfrQdil015mKB1AqSA4Y6xqDxTRfxsiOIe6OI3ogHs1F2XKCpsxHWeEcqWxse/91 nKhTkqYsOcbWJgIkRGu800v1l9tYF1bHCpZIWhL9aAOr1eCn1tVosxWZ6drEW+EHQ21+X0iQ7EYhZ Jc/WJ9xPfz5M79OJT3e/DlnkArai/l9FzHlO8EndePbguIv73GHGu98ocJ9JQ7kqIaP5+ti5y/Xyn wNtpm7qw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t33Lc-000000099Qd-1REy; Tue, 22 Oct 2024 01:06:08 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t333P-000000096z5-1LLs for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 00:47:20 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e290b8b69f8so8544844276.2 for ; Mon, 21 Oct 2024 17:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729558037; x=1730162837; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eTpDcLprhbUi5YHe62ZQ4u0o+/QxbhbJTnRiVU+yROI=; b=zjuk5CB6k0vgVAj+Zsvm3IAalkCTNlbRcKMSPd6mXD6iWk0i1DodTcEpoDW3xN5i6a ZzWNcq1sBcJM96f4MiYIteKkOX1NeI+dsebXwLVOz85cbPF2sncnhJTaukeEtfLsnqQO O/yAhvq/3O+sEjwYUGBzDB2nBR/lEEsT76rf15nynaDPnelkwI59wlYuwf6kt9TkX0eO sbE0lDK4dq0w0ms2z7oljtAHAIQWD9FaygtoVGRzXKDabDAb7hRnFLVWsrV1uB//I4i0 T2sr/skOzDy9h4trSYHo8FgcAqrK9+wgVED/5oc5h0OQuyd9NFr0798MbjIkNMtyw/QG mYeA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729558037; x=1730162837; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eTpDcLprhbUi5YHe62ZQ4u0o+/QxbhbJTnRiVU+yROI=; b=N0TExep9STw+b7cHCUl3xl2Z0TzwWdcHCVi0OEPJuTI39ZYMSasJQBwosDHFK9Rofg LnkaEEKk2zP+sOx/XJnyk2tI951fDga9h8C3vAu4n1C/5a2n9jb4Kz9DCE4yJqSI8oBY lidI0Y5d03LKKIVB6nMiQplK3tWvT4cfqeTzPwE95dvPGp79PB+g4sCsm4vgneI+GEED 5ch4lBgZpFeHykBbLDIY2bqQchwVxpdF+m5mqWnxxshHGQpXvKHU6eB3B4SddD9sZW3C gl+MfO/OMUheR0End9j2eXiRJEtm9G0PS+uH/CwE+cYl+75RXNHnD+q7ONsb4QD23UL5 cjWg== X-Forwarded-Encrypted: i=1; AJvYcCXk3OnBSAd8sobRJV1f6M9ePDhQyoP2319d2WVkosIpvzKhJgKejwHeDRe7QxPkaste8rx/xni4IKezqa7cp6LC@lists.infradead.org X-Gm-Message-State: AOJu0Yx0lqP2+fMbDIJFPkaJNU5RXjV+ZeoNbPXp9Y7j1hjREBq28UXl BBZMV6b2ZlTxQ8h5Rs+L2MCzOvKvC869Oc+HY/7bKyCFtRzLRoEtadHB1lmfyc6JUDbuLHMw+fO S+MsWhA== X-Google-Smtp-Source: AGHT+IFHeu+s/6VJ8LwG/ln9c8VqGvj+9fWSI0sc1LDHdzQR9YS0qXRVl8XWuhvxBjalS3fnwkBU6xUhXVdb X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a05:6902:1807:b0:e29:7454:a4da with SMTP id 3f1490d57ef6-e2bb12ed271mr8273276.4.1729558037283; Mon, 21 Oct 2024 17:47:17 -0700 (PDT) Date: Tue, 22 Oct 2024 00:47:08 +0000 In-Reply-To: <20241022004710.1888067-1-rananta@google.com> Mime-Version: 1.0 References: <20241022004710.1888067-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241022004710.1888067-2-rananta@google.com> Subject: [kvm-unit-tests PATCH 1/3] arm: Fix clang error in sve_vl() From: Raghavendra Rao Ananta To: Subhasish Ghosh , Joey Gouly , Andrew Jones Cc: Oliver Upton , Marc Zyngier , Raghavendra Rao Anata , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_174719_397339_3F2A2EA3 X-CRM114-Status: GOOD ( 12.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following clang error in sve_vl(): In file included from arm/selftest.c:16: kvm-unit-tests/lib/asm/processor.h:163:16: error: value size does not match register size specified by the constraint and modifier [-Werror,-Wasm-operand-widths] : "=r" (vl)); ^ kvm-unit-tests/lib/asm/processor.h:162:14: note: use constraint modifier "w" "rdvl %0, #8" ^~ %w0 1 error generated. Fixes: d47d370c8f ("arm: Add test for FPU/SIMD context save/restore") Signed-off-by: Raghavendra Rao Ananta --- lib/arm64/asm/processor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/arm64/asm/processor.h b/lib/arm64/asm/processor.h index b28d41fd..e261e74d 100644 --- a/lib/arm64/asm/processor.h +++ b/lib/arm64/asm/processor.h @@ -159,7 +159,7 @@ static inline int sve_vl(void) int vl; asm volatile(".arch_extension sve\n" - "rdvl %0, #8" + "rdvl %w0, #8" : "=r" (vl)); return vl; From patchwork Tue Oct 22 00:47:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra Rao Ananta X-Patchwork-Id: 13844948 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C44ABD1714E for ; Tue, 22 Oct 2024 01:11:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fFBeTk/ypl/mbwDh0gs/JhAq5wRwgc/prGa+mqCvt5o=; b=fSsfbvcYErDSaOwdzTSdb/IROX CUgbfXVjp1BaXrzuwLq0tdnKMRvbJzwlYmRK+DE2uqsRXjOvMt5rLgo39Anbf1A927Y3Pg50z9Lrf hFpNYS0mq7r9dlvX4HIm+Gf3z4LRu+BdSI/x3hh5FvM+oLqNQsgbJJRG+3nXnIPX68b7bpe0bxSfX f2aCZZ8RQ3XRewScx2RaG+GybDWB7u3cZvjIZgC4UXg2gjo1FDKijmR3mAmsrBxJ+bAjnSqzO0XU/ QRkvhahpQ2U4P5w+jy0oX8QM2alE6KhpmTU6+Mwuvde4Q99lS7VB9fZ7p8PC5tBLINJI0XYu3FBJ2 k+w7bAXA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t33QF-000000099u3-2cB4; Tue, 22 Oct 2024 01:10:55 +0000 Received: from mail-io1-xd49.google.com ([2607:f8b0:4864:20::d49]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t333P-000000096zP-3wF2 for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 00:47:21 +0000 Received: by mail-io1-xd49.google.com with SMTP id ca18e2360f4ac-832160abde4so385569539f.1 for ; Mon, 21 Oct 2024 17:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729558038; x=1730162838; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=fFBeTk/ypl/mbwDh0gs/JhAq5wRwgc/prGa+mqCvt5o=; b=KsO8L+qqsydRiGuWj/CKBFHUosc+HDpBzPXFvRSAAr1GgT0by0zdZm7nd/oOM53O5D PbOZ36/n7EWRdbCNMyCDvKqhORLaEulmriF3Ad0AvLKgLu4RX2V8A6BrXJdTnLU5IRlw XHCveXoWAVbHNRuy/OVsavC7nhJxLeq1zHmOaYAWWvHcdimze5ReDWdLZIWbChgKMyHj 7CaGBuRpbFvqhUM855OBt+6gB9TXdApmqjxSjEhc1PhgG9WweAnCO7oiHz1LdibStluZ 5oNi6vNfqpqfR37eNjyB2F/fGGnUTVGUGngrmmMtXTU43VtAP8tjSKUiJy1SVyg/RkoY 9zhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729558038; x=1730162838; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=fFBeTk/ypl/mbwDh0gs/JhAq5wRwgc/prGa+mqCvt5o=; b=ChPEnvg0Sd2zb12m7VHlJMRZxUy5r/OUGWHsdZg6/y0wXaY0vY8qYpbjS6h4kwqQe4 j7AXiBZyiim6WcEjvFgW5mRt8cJGrkhQ66sbohgNOJqHL2ynONuOqhhGUTIAFGlFkCPJ aucOZnGrdxDjKNjALPnORM5HyUpie5sdjeQFhSCf/mU72DpVxnXnfWRArqncKVraw/OI 9Ej4az7StCQumL9EzjO7I7l2UYV2kFghoHLm76I1DcOk7JdG3/D4TQFCT9641GZb24xU cCpfW0stHmOMtW2v1RtBzEn9uRuv14kxBuV/efz0TFys+SnxUyfI/jGEzA7VBxGRdtBx RLDg== X-Forwarded-Encrypted: i=1; AJvYcCWYbQelLk3zH7o2xUXNBpCopAHw1A6ihOS6bCG0Z1UDFOKGLLqeRaw7smFIL80BUN1Tcro0TL106ItoeID53JBJ@lists.infradead.org X-Gm-Message-State: AOJu0Yzfc8NukO8HWNJX6bmuvcvvbbqouIs/DJ3Ol+bmy6F/GfhKyYIw rlAuWo4RTxOjtR267s/ouJC8bfKQ+KGB41KCENYCG1xUO7F7xJV0H4mllb99gLb3GjtHsgBNlzw 2BUjN/g== X-Google-Smtp-Source: AGHT+IGzqRDsg2PzRLzqCFl7gr4a8ftn+I8+zYOg3xTOpEKFCEBYRQxWqZwKNprPXM6RvFGVT+CQWKASwGCx X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a02:a613:0:b0:4db:e3a0:c40e with SMTP id 8926c6da1cb9f-4dc44251858mr9721173.0.1729558038062; Mon, 21 Oct 2024 17:47:18 -0700 (PDT) Date: Tue, 22 Oct 2024 00:47:09 +0000 In-Reply-To: <20241022004710.1888067-1-rananta@google.com> Mime-Version: 1.0 References: <20241022004710.1888067-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241022004710.1888067-3-rananta@google.com> Subject: [kvm-unit-tests PATCH 2/3] arm: fpu: Convert 'q' registers to 'v' to satisfy clang From: Raghavendra Rao Ananta To: Subhasish Ghosh , Joey Gouly , Andrew Jones Cc: Oliver Upton , Marc Zyngier , Raghavendra Rao Anata , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_174720_015422_935EE40F X-CRM114-Status: UNSURE ( 9.37 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Clang doesn't seem to support 'q' register notation in the clobbered list, and hence throws the following error: arm/fpu.c:235:3: error: unknown register name 'q0' in asm fpu_reg_read(outdata); ^ arm/fpu.c:59:10: note: expanded from macro 'fpu_reg_read' : "q0", "q1", "q2", "q3", \ ^ arm/fpu.c:281:3: error: unknown register name 'q0' in asm fpu_reg_write(*indata); ^ arm/fpu.c:92:10: note: expanded from macro 'fpu_reg_write' : "q0", "q1", "q2", "q3", \ ^ 2 errors generated. Hence, replace 'q' with 'v' registers for the clobbered list. Fixes: d47d370c8f ("arm: Add test for FPU/SIMD context save/restore") Signed-off-by: Raghavendra Rao Ananta --- arm/fpu.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/arm/fpu.c b/arm/fpu.c index edbd9a94..587b6ea3 100644 --- a/arm/fpu.c +++ b/arm/fpu.c @@ -56,16 +56,16 @@ static inline bool arch_collect_entropy(uint64_t *random) "stp q30, q31, [%0], #32\n\t" \ : "=r" (__val) \ : \ - : "q0", "q1", "q2", "q3", \ - "q4", "q5", "q6", "q7", \ - "q8", "q9", "q10", "q11", \ - "q12", "q13", "q14", \ - "q15", "q16", "q17", \ - "q18", "q19", "q20", \ - "q21", "q22", "q23", \ - "q24", "q25", "q26", \ - "q27", "q28", "q29", \ - "q30", "q31", "memory"); \ + : "v0", "v1", "v2", "v3", \ + "v4", "v5", "v6", "v7", \ + "v8", "v9", "v10", "v11", \ + "v12", "v13", "v14", \ + "v15", "v16", "v17", \ + "v18", "v19", "v20", \ + "v21", "v22", "v23", \ + "v24", "v25", "v26", \ + "v27", "v28", "v29", \ + "v30", "v31", "memory"); \ }) #define fpu_reg_write(val) \ @@ -89,16 +89,16 @@ do { \ "ldp q30, q31, [%0], #32\n\t" \ : \ : "r" (__val) \ - : "q0", "q1", "q2", "q3", \ - "q4", "q5", "q6", "q7", \ - "q8", "q9", "q10", "q11", \ - "q12", "q13", "q14", \ - "q15", "q16", "q17", \ - "q18", "q19", "q20", \ - "q21", "q22", "q23", \ - "q24", "q25", "q26", \ - "q27", "q28", "q29", \ - "q30", "q31", "memory"); \ + : "v0", "v1", "v2", "v3", \ + "v4", "v5", "v6", "v7", \ + "v8", "v9", "v10", "v11", \ + "v12", "v13", "v14", \ + "v15", "v16", "v17", \ + "v18", "v19", "v20", \ + "v21", "v22", "v23", \ + "v24", "v25", "v26", \ + "v27", "v28", "v29", \ + "v30", "v31", "memory"); \ } while (0) #ifdef CC_HAS_SVE From patchwork Tue Oct 22 00:47:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Raghavendra Rao Ananta X-Patchwork-Id: 13844949 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3206AD17151 for ; Tue, 22 Oct 2024 01:12:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:Cc:To:From: Subject:Message-ID:References:Mime-Version:In-Reply-To:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=60wgcSLTXVxTzPUjoeX/E6FIWkDuwYegYI4IrChLCKo=; b=JnIUMCEIGjr2E1fT6zMbaRX36o W+lgpGRy1oUCC1BK+fQnDWFvhxojp2GQKvwvcWXzgf/43Xy8vzGhuwQlJ+2vd4fN47VImZ9nN8Thm PoAcgWctbKGLgqx2NPcbIV+gIRKFMGDLrV+ifyOxKrgGovKcsUYAF/GJgCDjgN9qKz0ar9zefHx2Q 7EagdpMZTemKqBnM7PLOhsN+0RntM7H4UBGLuhUeJNeU95kvTBV3sRZikI6cX5v0n0mRHi7W/NP2K eYfWwth0j1uHDsxdRjfVQFDM1MujeowKXf5kRbet525r9EyYxuDt3/hJLikUh2mZ3ifg6ekv4DI0Z F2Jfg7KQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t33Rh-00000009A41-3bdN; Tue, 22 Oct 2024 01:12:25 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t333R-000000096zy-0PPV for linux-arm-kernel@lists.infradead.org; Tue, 22 Oct 2024 00:47:23 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-6e0082c1dd0so106010267b3.3 for ; Mon, 21 Oct 2024 17:47:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729558039; x=1730162839; darn=lists.infradead.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=60wgcSLTXVxTzPUjoeX/E6FIWkDuwYegYI4IrChLCKo=; b=1NuCB2UX5i6chyFVu/bz/q7/dO3u0/0YwkswhPt3TUfzTUDOzdtua4yovOIjMxm+bK koiPdQ1irLTIs5hA7M1cHc9FO+hhKz7awGQ8NB1j8TS5Nxp1gvMN8VS7c4qMdVK5RAOm rTGP1lcvHjP7Abi0tPV2e+Z7bPZuGIypXtK0KMxhDSYly8g1n4Z1n70PC0Nuu4tP6blL AqNliMiunPkwXqQC9AH4PL40Ui+vjFgel+9Uqi4iAJiIXnerdCZbhXeMHaD13YGB7OYf 6Cc2XB7cmoGvAe8bf7ZjfsndugHwoDjWe4PlSNTtx/HFGyXp3DoP60fh7PYzSTpq6KSE Lglg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729558039; x=1730162839; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=60wgcSLTXVxTzPUjoeX/E6FIWkDuwYegYI4IrChLCKo=; b=RURBCnrRUhbFwQiJ+4hpSZkVNSpnltEDcGQyWy3ruPDrfNtdBxKthQmIJ4EPA5V67k GqH1YPR2dW2/F6P8eRCQ6cx/xvsenR1Gp3yCDaG7shzWciTLSvbILm8axzQ01WT+bXKA ogm8VqD+pVulEN0aEWPhI4J7xhkAj2BgUXjkHpRzN+NoVa4EmvHSnseRTRacnnVCNCdv ANCRlwwHizmwjJG0WcsNedKm2hxINOBUYZeA8YUk/TNUCk0eX+Q83XnU5gwCVJA87Zv6 YGMXZqb663Sa3NKQ2yfUOAouawhi5dpYKYNcizImsSLsuT6+pyksXvEBIWV3pXR4QArC cCAw== X-Forwarded-Encrypted: i=1; AJvYcCWFQBQUQPKl2hjj1lWIbedVB6BU7ceQ0J27naz8tW1WzYtMpnkn7zrjrD/B12iUbCedr+OTpp1MLhrh8y5vyPzQ@lists.infradead.org X-Gm-Message-State: AOJu0Ywza/yFUjOoDPj1ulWGE3d9Wcq21GX37LE5pBXDdkl8/NwKBlLW DIvZkr8IFCyYA+06NwHOj/+FRkeh5e+RnscYLpDmZ4lblz4kL+Rm1xCuWrkup/G0pHHYb7t+i8r SwgLzmA== X-Google-Smtp-Source: AGHT+IFiyt/4iIInAWKLwhqunyPq9QHonJj64kutF9hny1NRpAVPZ5zeWGMGBu5qDtED4tv1AgjC9hWx+3+e X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a05:690c:3582:b0:6e3:2f0b:b595 with SMTP id 00721157ae682-6e5bfd58c16mr738297b3.5.1729558039164; Mon, 21 Oct 2024 17:47:19 -0700 (PDT) Date: Tue, 22 Oct 2024 00:47:10 +0000 In-Reply-To: <20241022004710.1888067-1-rananta@google.com> Mime-Version: 1.0 References: <20241022004710.1888067-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241022004710.1888067-4-rananta@google.com> Subject: [kvm-unit-tests PATCH 3/3] arm: fpu: Fix the input/output args for inline asm in fpu.c From: Raghavendra Rao Ananta To: Subhasish Ghosh , Joey Gouly , Andrew Jones Cc: Oliver Upton , Marc Zyngier , Raghavendra Rao Anata , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241021_174721_205392_49AEB909 X-CRM114-Status: GOOD ( 10.94 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The macros fpu_reg_{read,write} post-increment the '__val' pointer register as a part of 'stp' and 'ldp' instructions. As a result, mark it with "+r" for the compiler to treat it as read-write operand. On the contrary, sve_reg_read() never updates the value of the pointer/register. Hence, mark this as "r" for the compiler to treat it as read-only operand. Without these adjustments, the compiler can potentially perform optimizations over the registers holding the pointers that could lead to data aborts. Fixes: d47d370c8f ("arm: Add test for FPU/SIMD context save/restore") Signed-off-by: Raghavendra Rao Ananta --- arm/fpu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arm/fpu.c b/arm/fpu.c index 587b6ea3..6b0411d3 100644 --- a/arm/fpu.c +++ b/arm/fpu.c @@ -54,7 +54,7 @@ static inline bool arch_collect_entropy(uint64_t *random) "stp q26, q27, [%0], #32\n\t" \ "stp q28, q29, [%0], #32\n\t" \ "stp q30, q31, [%0], #32\n\t" \ - : "=r" (__val) \ + : "+r" (__val) \ : \ : "v0", "v1", "v2", "v3", \ "v4", "v5", "v6", "v7", \ @@ -87,8 +87,8 @@ do { \ "ldp q26, q27, [%0], #32\n\t" \ "ldp q28, q29, [%0], #32\n\t" \ "ldp q30, q31, [%0], #32\n\t" \ + : "+r" (__val) \ : \ - : "r" (__val) \ : "v0", "v1", "v2", "v3", \ "v4", "v5", "v6", "v7", \ "v8", "v9", "v10", "v11", \ @@ -138,8 +138,8 @@ do { \ "str z29, [%0, #29, MUL VL]\n" \ "str z30, [%0, #30, MUL VL]\n" \ "str z31, [%0, #31, MUL VL]\n" \ - : "=r" (__val) \ : \ + : "r" (__val) \ : "z0", "z1", "z2", "z3", \ "z4", "z5", "z6", "z7", \ "z8", "z9", "z10", "z11", \