From patchwork Wed Oct 23 15:26:35 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: 13847412 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 89F98CFA44F for ; Wed, 23 Oct 2024 16:17:37 +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=NUyG4KJWSBf2s+OQ7gnMAGvHnB ezIqAmquznzQYvb6vUJaMj7evYyCQ3T7yfswPU6LhvI+IZ8Cz22suP45oaz3iF9NqV18l1J5w5EYv VBVvbG3uZhc0dOv6HxExoQJWYeiFCUUpg7sFTqWQe4dw60IzWqZi+c9xXuOXj9biLcELrqYST3tGG BhUYASfNwNl9HecMBRA0HJM4mOVJ5xvmbm4WMHL2zwwW9cUGOrLs0vF8V7/dYwo/U4pG6LtQ6I6Jl Z81Cx4aC2XR2GRHuNOOuqjOTeBa3RrZW2wgn8OPnfSgomZ6teP0WH65eWUAJdsqmadKMwCBhrwC/6 huoN3xTw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3e36-0000000F6ZS-2iGn; Wed, 23 Oct 2024 16:17:28 +0000 Received: from mail-yw1-x1149.google.com ([2607:f8b0:4864:20::1149]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3dG0-0000000ExHt-1olE for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2024 15:26:45 +0000 Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-6e5bdb9244eso95316007b3.2 for ; Wed, 23 Oct 2024 08:26:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729697203; x=1730302003; 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=a4ed1REiwFZ2uQRRNX3qO22MjB4h+YxnRV0VBra4G0lrEqMlxB9m27lAPjnSgkMQYz BI49zr5lucNHuIHQItdIAZy9uKDcfVaMk1kK+UgCWjHSkSpph421blcKVxu+0FxIbpcF eEtQ3lBg41zx55JQRVPvMJWYFV7KL0Z4fd1jrHyew3nU8sWcu7tLWRsfvO/1xSxAgWPs hy4KxIuk10T3ikM+uB0eUDaBs5lejSdmqXhr+FzWLggILMCFaFwOLzg3J/UtQ+S+M46z QgKRFa2mh+I+I9pcRdB68sETRe85IZWhj3TMgWw5aD8tck0ZTzaWzyG0k73Ok6O4TXR6 IRpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729697203; x=1730302003; 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=DcjTaPeLMa0XQuWtT5mzLUKVeFyh4TXrNHFvWB/m8EktlGRAEEfk/4aUC9LdCFKF0k JypdDyjac8iJJwA00qO6mny4XYEA1IzHRUyYZKv5pdS2YRBAb2h8CRYCoxu6MHpfI/od RjUa9cKUY1NIyuR8rBlbNt/W6AMWKrSk9jVYmk7+jd8NOi1XTP/sIHou0Zmcrm2t9xDB 1U/bLH5f2HMRWtn2HZVzHXuCGjE3l6eePA3/t34+ow9AgeM6N9FAWBsEpHaqFYAKevDp IqZflQXkPQiJrOGTFK7pafg6+b6S5bQH1wP8lRZQgiejZsYX7+QINXFHrGCCK27eLX5H RNzw== X-Forwarded-Encrypted: i=1; AJvYcCVauGkbZdf3gtsqZziCk3zrQ+9qTlkdLRCsPdyV5i3MoSZbpCFQfZTeNr4kKGOkN0xjWGexx8ZwnDqhO3+4SA0h@lists.infradead.org X-Gm-Message-State: AOJu0YysmhXMZRQQO1YI3cbv8VGQjs8OrhIISs5btdTVRTEK3a/eSecj o6pcUpZOjLc7BRP8KAUbDf4VJyZAVmfTJSlaLb7JEJ7FsPvVHcEWZTVixsbdnb2R9NYQfJc/bZx mDkQGqg== X-Google-Smtp-Source: AGHT+IGyKD6tDsN1UOGbK0zHzy2EM8WTJ3RRqhXskaDYZzY4RpWhowWcPc5+5VKKdGJS9/5Go7f2MraDRssJ X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a25:8e87:0:b0:e1d:912e:9350 with SMTP id 3f1490d57ef6-e2e3a6bc055mr2784276.6.1729697202285; Wed, 23 Oct 2024 08:26:42 -0700 (PDT) Date: Wed, 23 Oct 2024 15:26:35 +0000 In-Reply-To: <20241023152638.3317648-1-rananta@google.com> Mime-Version: 1.0 References: <20241023152638.3317648-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241023152638.3317648-2-rananta@google.com> Subject: [kvm-unit-tests PATCH v2 1/4] 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-20241023_082644_492453_171C2B61 X-CRM114-Status: GOOD ( 11.67 ) 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 Wed Oct 23 15:26:36 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: 13847441 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 296FACFA44E for ; Wed, 23 Oct 2024 16:19:13 +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=IxQe1EgcL9Berl33BaVEhOh9z6 O5CstcRbBfKjYbHfzdlinxLUgD7TuvozykftVw5N8aSHBokP0BHmZcoM0UCf6JTK9/yIqB2QBo/1Q VLnbBfxYOSg6uwD/DNXYXdKVo7+qZVhS74FA5CNcetF5HHLnUdJrb7CNtPFO3Hi9ijGAux2xGcNCS AMqJvnhAOmAN1iuDtetSdWw99ATOQcRt9eRj7QIqoeeWbt3lGwckoHjbEqjbWgX+CouQfYtjSjD5G 7bbkVXwwsn68A+BmmSdb6CVqYIBA6QZbO+jBhcsKEeJOf1oT/9h5UaFElqAPY1i8naBo/TS5kO9f0 2TIwZvlw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3e4a-0000000F6gf-2Zz1; Wed, 23 Oct 2024 16:19:00 +0000 Received: from mail-yb1-xb49.google.com ([2607:f8b0:4864:20::b49]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1t3dG2-0000000ExIO-315N for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2024 15:26:48 +0000 Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-e28fdb4f35fso10978273276.0 for ; Wed, 23 Oct 2024 08:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729697204; x=1730302004; 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=BnmBPVw3svMGOU7XoWc4/xSHDLr8uMSMjBoyOIomxukdll1SmUFqBUXOnSJHllDplg l5KwOJUHAk1Lpf4s4M0aCAh37A1f3BC9S17SG018epcNEMViO8ETFg2jhgklwFHeGGbP HDyAx4CFAvG8HOL/8UpGm6wSV49yg4sz42TGq9nMVP6p6v7irje9I/OTl3OBAKsnOH9x 69CyLt03lhzBgJoSOUvxGefAMPvwxwtalHG1XgLnp390nAq2dhhfJTWkvLqwbEXW00Gd 0ndz64rtbiTNA6O3GD+q5Gaqucd071iuinX/q9DbBAkeBw7DnaWrssZbEOoNHtW1qr1U 8+pg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729697204; x=1730302004; 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=uwNQykJdmg8rvPD2PtRswYJQIgO9o3TZm7GFZ0P+FdDb67vGzGQTFKfvK+FmobXuTW f0hAtvg4cKa1vm2gA5I9eZgvOMl6TB6jdGxDYBi6yiS1QdqGLk7HBKHppNjL2tqtA9vf 0tJhuP7SlIRNE74nBfSpCpZvgGnMu2ACE3yaIk7B7m9Qqn5hiMRzmbM1UtJ6CpfhbGWz a/1+q6Th4OPFure5Yf4ULe6fln5wf8QK1kH7waJon59M9wgkJ6qway3JXw85JvOUCHtY wxg/mBMq7LlPsTF1mBol68b8JG7KuzlUAQI1eTFCzLyX31Udh4UOZFRMPKuX4JLDloM/ eirQ== X-Forwarded-Encrypted: i=1; AJvYcCVGeBsguVrfftvwfECeV05ENEk8il9bGOfyjfLa20jsE4nsJaEqxBpukA6/JLmv8GmSC7bShwGZYoQeB8dt9ebF@lists.infradead.org X-Gm-Message-State: AOJu0Yx+/FeaW1WMzpZ1Ve3KLxzouMDaaZUIp0LeIj3si3BMIE6RJsHg mob28nW8HiNgCLeK10zlmlegAYt2W5s4S8kpaCDNvIqGNWE99UaqwAopmHSF1dARepEN5XAnTe5 8DdTjGw== X-Google-Smtp-Source: AGHT+IFh0UYQGtbCtvsET0xrrd1Y/kAJ4FbXvNEzhh8lcJJcZvj2pTt+HaP9rNqWRxjhbRVfontBWLjAHjHZ X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a25:acce:0:b0:e28:8f62:e735 with SMTP id 3f1490d57ef6-e2e3a5f5d18mr1688276.1.1729697204137; Wed, 23 Oct 2024 08:26:44 -0700 (PDT) Date: Wed, 23 Oct 2024 15:26:36 +0000 In-Reply-To: <20241023152638.3317648-1-rananta@google.com> Mime-Version: 1.0 References: <20241023152638.3317648-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241023152638.3317648-3-rananta@google.com> Subject: [kvm-unit-tests PATCH v2 2/4] 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-20241023_082646_777583_E7084F06 X-CRM114-Status: UNSURE ( 8.99 ) 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 Wed Oct 23 15:26:37 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: 13847442 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 CFF5ACFA44E for ; Wed, 23 Oct 2024 16:20:43 +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=7NioyoNb1tbeyUGY4RlitjUeF9A4E3KRPhc6ahZCNVQ=; b=CtsSMfILD6PC11bL4Yb8hhHKev 0fi9Eq/UvXxT1eiAaHSE7IaToQoPBRkbIgkLQUg3fhNrOutqljkTxiFYr0t+FrtMsdTto9/zX9qiO ZzDgfPgqgKrt0ngxAcmIRIIa9+TxHsi2aadyXP76zoXyhA49AJzFf6/GhANeOMr4uXyX8D06gCaje s4JEWc0TWzRtAAX/ArX469X7wSAnkhd3RCRvXILhLfIrZczTIBrQ7WeCCfto6RUs+iK5oVfATLfnh jIsCjrzy2mC96ptTDJQdupK7hOren4L/P2pU+mAkDwMg8WrDD0nd/VaeK7vtZCrbQSClXfUNni/hV DU9P/wXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3e65-0000000F74w-34Xe; Wed, 23 Oct 2024 16:20:33 +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 1t3dG3-0000000ExIl-1sYW for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2024 15:26:48 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-e29205f6063so11045119276.1 for ; Wed, 23 Oct 2024 08:26:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729697205; x=1730302005; 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=7NioyoNb1tbeyUGY4RlitjUeF9A4E3KRPhc6ahZCNVQ=; b=tp22JUJduoXan4aMP9RLOFfiQCqGrooKkxloFegmN4tTSEIhBgrO1vGIzdjPGorIpq iNaBFc/uMtzwzaXomuSHs0yzQ1D6oI/rg00j3ovj6p8easuvjn51+izy/EjDFWlSC7lZ Rdj1zJDuCXJo9zmo6Pj+BmuKqTDG4YU0btWZwuhnoG5D8RKPG/Ps5XBxNcRtV/kecOD9 vuI/+sdtu4QC6aP2d6HoQhH4AG7+RUYBxMgFEDVABrXSFYAJAcFFfNnT1cwckRliQEzF eyjq57+wiuKSPeA9WVFmp6Kt5kVTPEmFRRzqy4dsBILzlv5qyxxfgpVqpTpYXCYCRaKT E/iA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729697205; x=1730302005; 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=7NioyoNb1tbeyUGY4RlitjUeF9A4E3KRPhc6ahZCNVQ=; b=K3NJCQxT47iJ4JYR8JIzHOq1LW1zYurLF9AYfAiYtn/nZt2AgkNOCV0G8JFAgeRM9L /vfpizFkXPdAPTpkZbwMM8G4SaTehUB2xpGPshpid458g2ZMcFx7w1ygA1FAQ2/cHEqp jMrKQo6KuPE669I4NkA6xSfugxfPGWKv/wcD4H33azWSSzYTGoL12vYWyBouykU4rrdE zZDUWcqdfw2KGKKyUBXQMwsyzliqw05y7y0uxQAkoAJvB0dzr9Rp1ZfWcZshfV+o/091 EpOQ+sSZmS3ZeDYwL7WbMOWsPOdNuvttD5iwXJtN7rf7TiKw6TZx5pAnnheTRk1ZPmQa Q5sg== X-Forwarded-Encrypted: i=1; AJvYcCVQqZsYyMmeKdNv/9FHSyjikaSslP++v4bddUD/nZG+K36ggaKtWTEofSgfgXEp7G9fC2G4D5vDe/vLCYahfzf7@lists.infradead.org X-Gm-Message-State: AOJu0YxkS+vmlTN82ZHZo0LyCDZhuxMrwaQdf+7blwsUbrQBY2HP9/ZZ shc/UfddNnkve27GYxobH8X9sFT16RgENOUyX8YJ/9g0LEDbvUGnd+0JCNalG4dEbgK18Ewg1r5 In3h+tA== X-Google-Smtp-Source: AGHT+IE9OyKSIQFj5g+9JOMt/US00gq7iSxNgRTSGWr8GfQo9rufdELdBzRinCot5ZkBU1YALlbhI9gWX/bZ X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a5b:947:0:b0:e28:f454:7de5 with SMTP id 3f1490d57ef6-e2e3a6b78d6mr6103276.6.1729697205144; Wed, 23 Oct 2024 08:26:45 -0700 (PDT) Date: Wed, 23 Oct 2024 15:26:37 +0000 In-Reply-To: <20241023152638.3317648-1-rananta@google.com> Mime-Version: 1.0 References: <20241023152638.3317648-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241023152638.3317648-4-rananta@google.com> Subject: [kvm-unit-tests PATCH v2 3/4] arm: fpu: Add '.arch_extension fp' to fpu macros 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-20241023_082647_508207_2DDE3E95 X-CRM114-Status: UNSURE ( 9.84 ) 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 Since the tests are built with '-mgeneral-regs-only', clang-18 tends to push 'q' registers out of the scope and hence, the following error is observed: arm/fpu.c:281:3: error: instruction requires: fp-armv8 281 | fpu_reg_write(*indata); | ^ arm/fpu.c:74:15: note: expanded from macro 'fpu_reg_write' 74 | asm volatile("ldp q0, q1, [%0], #32\n\t" \ | ^ :1:2: note: instantiated into assembly here 1 | ldp q0, q1, [x8], #32 | ^ Hence, explicitly add fp support where these registers are used. Reported-by: Andrew Jones Signed-off-by: Raghavendra Rao Ananta --- arm/fpu.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/arm/fpu.c b/arm/fpu.c index 587b6ea3..f327a349 100644 --- a/arm/fpu.c +++ b/arm/fpu.c @@ -38,7 +38,8 @@ static inline bool arch_collect_entropy(uint64_t *random) #define fpu_reg_read(val) \ ({ \ uint64_t *__val = (val); \ - asm volatile("stp q0, q1, [%0], #32\n\t" \ + asm volatile(".arch_extension fp\n" \ + "stp q0, q1, [%0], #32\n\t" \ "stp q2, q3, [%0], #32\n\t" \ "stp q4, q5, [%0], #32\n\t" \ "stp q6, q7, [%0], #32\n\t" \ @@ -71,7 +72,8 @@ static inline bool arch_collect_entropy(uint64_t *random) #define fpu_reg_write(val) \ do { \ uint64_t *__val = (val); \ - asm volatile("ldp q0, q1, [%0], #32\n\t" \ + asm volatile(".arch_extension fp\n" \ + "ldp q0, q1, [%0], #32\n\t" \ "ldp q2, q3, [%0], #32\n\t" \ "ldp q4, q5, [%0], #32\n\t" \ "ldp q6, q7, [%0], #32\n\t" \ From patchwork Wed Oct 23 15:26:38 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: 13847626 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 80758CFA453 for ; Wed, 23 Oct 2024 16:58:26 +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=A2EE3sVxYqIJ1dH+QTH0uydlcXtt1ReqMB1Nu0t+juU=; b=Yav/4w+f8lBlPw0rHy/nWbq6Iq iXy182ZPCCyaAxiHGLQoZWaNTfo8Sp3R3JMIxBd9tEEzTJYmLjAB4DDQIqf/443FmwhvZsSCK650u exFa0JTCTbHxchcr14teLf13zLDkx0ZutLBXRAJH8fyL2tk09oEoFOcDiBm5g47k1QeaDmyTWa+H4 luZ24LSAF8klgNw1Hl0HB2rZvrlqFwb9Teq5naMe0CpFBDMWBu5874P3X8ei9FU2N83jTKpmo1Y+X ybKmgZH8wa4xDjfQnqPYQ6hb354IJiBYDyTYWi7yBbL7Us/bIC+n8sCq/JiFTvI9smotmsKwzQsbc hNl5vuIg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1t3egZ-0000000FFRT-2tTk; Wed, 23 Oct 2024 16:58:15 +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 1t3dG4-0000000ExJ6-0FKd for linux-arm-kernel@lists.infradead.org; Wed, 23 Oct 2024 15:26:49 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-6e3705b2883so135070887b3.3 for ; Wed, 23 Oct 2024 08:26:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729697207; x=1730302007; 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=A2EE3sVxYqIJ1dH+QTH0uydlcXtt1ReqMB1Nu0t+juU=; b=r5ORK2whcW606TEWWM6c+eG7HcSB8Z2L9qhHXJvApetqz0lOG1zVlN8uRdYFm81vKe X9xCEPekLOYO6NjjUqqVizQWo9bFx61ZxqM+mGwq3QJ2FYhQAR3NDaD6lNdGz2Phw4sl F4hRhT5CZVSw+3uX0jWmrBnh/3nctAsRAMPZfGX85Pr0r40B7BrmL0dk8df3V9mw4c0O +8FD8c0lQvFMQn4Ui0LmbwLmFrXpADbwAVB6ygpbPva/5OxVigZ3PJ/MRgQ/CXxPG2nY 7tP7m+vmYl9rIijGJbtfo9g5gXhvpjiNOY+g9zjSnI9F5WiqdJdCbyax2HXGY/K6bH9Z w4KQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729697207; x=1730302007; 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=A2EE3sVxYqIJ1dH+QTH0uydlcXtt1ReqMB1Nu0t+juU=; b=xB4mSVL44JqBS2ZApCjv/ItRpnpvLHV+ubF0RnLBPdvUb7aG+rP1/jzf2GxlDbjOiR Rb1ZP1GYBYOH7dM5ixY9lbLPcwi32RDv1ItTm1F/FFVqmihBa6C387rZFSaSwZLRJbNc f7SeYDI6dXWzKY+zyXZTo2Sc1KUtHnG+NmygXBVdscAWf/vahvwXxmVmEq/TH6wzsif2 Y7PfIc9aPLxbp6IxViochGjIUKWIWfWM/ueQ06vV6WEiJ+YZ8TNqcyd3hSb/oBVX3Ikz MrQ7ZPEo3h0FxUuzLfBIXtVP+coB498B+HNpYF1WKWD1JAYfap8seiBAGJXsfYWoAIuC 84VQ== X-Forwarded-Encrypted: i=1; AJvYcCV4m8qMeA+unL5RS+YI1V9R4XZKJZP5oIeRuhrsUSdchhVKrGLRTgVU4rtQgwEYrGPXVH8ri5rJmtxOOYbqZgqN@lists.infradead.org X-Gm-Message-State: AOJu0YwrX4+QoDj3tT4vjEd9oJXrI8q8H0HO8n7m397aE4pagHCT3T8U hjkNb+KH1C8b3z5vnTPccYBpQr2+f+Q/uv6oz2JczPcrBKDeAGZoNESwdTMWSuo1MVfXmxsLvgS vcZXL1A== X-Google-Smtp-Source: AGHT+IFIvoDWzY92c7Ql5MqDK4/LO8cFIPrnyxqxIgb86cVrW0eQyRyYu3QqngJF51cWPwSpHNgspMn0AOrE X-Received: from rananta-linux.c.googlers.com ([fda3:e722:ac3:cc00:11b:3898:ac11:fac1]) (user=rananta job=sendgmr) by 2002:a25:df45:0:b0:e28:e510:6ab1 with SMTP id 3f1490d57ef6-e2e3a6c91cemr1496276.8.1729697206388; Wed, 23 Oct 2024 08:26:46 -0700 (PDT) Date: Wed, 23 Oct 2024 15:26:38 +0000 In-Reply-To: <20241023152638.3317648-1-rananta@google.com> Mime-Version: 1.0 References: <20241023152638.3317648-1-rananta@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241023152638.3317648-5-rananta@google.com> Subject: [kvm-unit-tests PATCH v2 4/4] 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-20241023_082648_124685_D3DE86C4 X-CRM114-Status: GOOD ( 10.47 ) 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 f327a349..f44ed82a 100644 --- a/arm/fpu.c +++ b/arm/fpu.c @@ -55,7 +55,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", \ @@ -89,8 +89,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", \ @@ -140,8 +140,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", \