From nobody Mon Nov 25 22:32:51 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E98371C1ADE for ; Wed, 23 Oct 2024 15:26:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697205; cv=none; b=myX3dxKIYG6eNWWbRnOknL2hica7ATw4/ayFrzMIktIoEjGSse5YNjKKNht3T24IJ1TbRdSoi1j/qKkkK1Pdhn85VTegMxxbwg+coo66EryH8Tz9bytIINBTYmKJ8MJIfL9MrK719/Cnh8HSlQZFMyZVIlxSIXbkISSamwJNoKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697205; c=relaxed/simple; bh=esQoNZuXsR24jwPl1DfQPAsmfQfBH1AfjOxCgQQxj50=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I7Xk6w+pSxxoEQOZOJ7wJr3ccpXk2ZQ+yJt0VxHrIJI+3yfDH213WDas4H/bWH7ggRrIwIRSB+xREGwqAwaGl9HRM2ItVNMfa2209sGGmSkTLibat1xpn8LvhNb0/U9g4skW7cE8rqT4Sv48Z6UyXf/ARWEToNzBs8SFk6dBTxY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=UnptddTT; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="UnptddTT" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e370139342so118118907b3.3 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=vger.kernel.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=UnptddTTjSWKqFJpFHyGYMDGmM0jP/sK2gHpXfLQk7V82ed287fPn46FIkFrKgU7KY MMnroaaEM9/iQOZjHXpxquCaux9bLcCGyhEiThtZGCwT3JLkf7B7rmBEzzD1Q1cLYRvi DnkOsJrDo0oTzeVq/dB9btZxFejWLXrhHMDLVtgOCbw6OZD6yVnvHfe7PPUWBGdgCPVh EBstI9G9vgJ83GR5vklGiCH4o/gY+yKao/pgtxyMzw6u+S8lQwaBY2B69aXdlJ+PXZjP kWcFj8OGAb6zsbkBhLqupwZsOCwzcMtlopkkVRUr9Py0o8EfpIIISFPtBopxxHt0YzS1 jcIg== 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=hqqhABEAR9QhQruVRMqLnjWq9N3+nfTi0pwnt6pq/yekfLwsWZRlvL3+LB61+vnU/U dfaliAA4uYg8LzNop/hr2aikDhrDJuNgtEM3mOx7BhWe0PPlPeYaPBZmhSVwPRHkLLIU q95qDw28T3eT3DYskyqzcxtFbvhYLxisfu0SfKMrM8glgUlfMkObKDm5mWlbpbdKSOTh GkJX/6ZanQjCyYEbbJyDCL+JjtTbZYYgLCsHxnTn60gw6dxQO14LOnJWGLg+clE4ZJ14 FDhEmnbuL5RonlOcwkmu56SB8zApYk1bQJi+cpNr13+UE8uI066W+tQqKl65IVDyYKG3 hdjg== X-Forwarded-Encrypted: i=1; AJvYcCWxkeiQ1s9I/sY/CO5t6wzYYGQdYj5uPrpep9JyFKd0Vbz/YqwH2qR8oqBeAjvhFgHEEtHo085Qa3DoePM=@vger.kernel.org X-Gm-Message-State: AOJu0Ywh9OIudzB6waylwbpVq1Vv/mbUE9G38kzLOR49o702K4aeaooK UJrxBoGOZdZF6JIASQMwIclIHtEieJg7wMz1XeafIVRrqtyiDFgCBIsa/48sO688Sx/BDrPZof8 bTDvMdA== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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] : "=3Dr" (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; =20 asm volatile(".arch_extension sve\n" - "rdvl %0, #8" + "rdvl %w0, #8" : "=3Dr" (vl)); =20 return vl; --=20 2.47.0.105.g07ac214952-goog From nobody Mon Nov 25 22:32:51 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 137DB1C3318 for ; Wed, 23 Oct 2024 15:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697206; cv=none; b=XSAdAnsEG8MN5VLidMxrhhPKxyrX3oyc5d6yvP2FKbynL/7+0KPivb3qOoEfpm2krFtcP3ogPbmxSc3TLzIyTF/kh43S+pjCE7RhW+4JWxqstWj97b7Lp3xplDiRzakcaHQN++elNbnHuo6C50tGLJeO5zEnuqFThK+RZ0ExCeg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697206; c=relaxed/simple; bh=3W9iajvimea6YrR9U732pMuKRx3PZLGRnnVS589DTvs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=WrVWjMZtvdr0SntVCzkAxgLrSqAB7tB4rodHYM8wAv6j6oxIs1pgy2m+Fkj3R1rb3B/1wpSv3WXEIz3DLtKTQP349ffc79++/UsmFPKPNUVOcmQykuqMAurGSb+tnK3zFYV8VCMwIVkg4xPTefdojQAvHTBRZ8afR/8ioXiO2LA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=c5iJRAnV; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="c5iJRAnV" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e2971589916so12014083276.3 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=vger.kernel.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=c5iJRAnV3Fi4lYXeoXbKQPKWwovOzhYCc7sZo9bpxAhvPLbExgqWjK/KFIIiKQAuBU cls+xavghVNYuH1042htv/kbU2HgDQT07ozuJ6M3fFAdqT8s6OE7z+iLVixM5oGa8ADJ pIoRkf5fIbv1l7Ot/HWh36gR8vPw0b1kpmYi78aa+/ONsNBRXWe2gqwjWzX3Ov6ER02J WamC9Fuc/rTkgOqRjcLJIpbzoiBPXocjThvzeRKc8PeneZyreuX22clYk8US5MYuSxkB 97tKfUIQv1xo1BIWOm38vuPNnSzeWnsfa8y3wlrdt0jBfsu2NxeXsl+xKTGgbBRJlUlc OgxQ== 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=JoYGUcqM8extbMHHevnekKkcWl8d7PDVk+8YRsWqFVDjMpIhgJlJ6x3RfHnpwTChaf wh5X8mYKpn28mWuwkXfhjyidMJHIIM99DYB7mVOzjjTkeafG/st3y3T6cG5PJzvY03Hf zEORSCzstt4NrvM5pTmGOEjtGx/VqHsjgDUUOfEoSvjvPCDEWmP8Go6i1ZhwkWHH1Ycs k8goIf673G3r545cqbPOfNAWqD/Dff7vjxQ3S5Ir/ce0GF0IOoZvsNRPeIhQ7bmQRBIW WDdiwSJ2XIjkdWuexX/gnI8YoghfAOI9aK7nOcaodsEPlrz9+C459ZSsyhp6q4EiSRz3 H03w== X-Forwarded-Encrypted: i=1; AJvYcCVkaikbT5Sn+N3RW8mUswKvw3asye1fb6mHUGjNQ1DORvvc+Ev16JpXuVVhdgKxuxuxJBvuYC8sKfueWZM=@vger.kernel.org X-Gm-Message-State: AOJu0YyG8/QlbVQ1TwvKrzIpfZl1FXuEt8UpmNWgm2c1DKXTJeyA5pxE gDGvw9baSEq5+Gp+jQI4wrgNSZO+bXOmu15r/4Q9mA32cTXA1yJLa8uk0rlNgBTvGJ5PyN6ZenK ti7p7AQ== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 *rando= m) "stp q30, q31, [%0], #32\n\t" \ : "=3Dr" (__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"); \ }) =20 #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) =20 #ifdef CC_HAS_SVE --=20 2.47.0.105.g07ac214952-goog From nobody Mon Nov 25 22:32:51 2024 Received: from mail-yw1-f201.google.com (mail-yw1-f201.google.com [209.85.128.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7101A1C831A for ; Wed, 23 Oct 2024 15:26:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697207; cv=none; b=Vymiisb3uWL6KZOP/gOiWacSTGAaF6Xv+wYpwcKDJj3BC0BcAQ6EGf68ALiLSukabJd7UrJCdSN+Y/IfWwCimP2yFZQd2nJpIVliD9XRt7fViVPDCZx9qEjSUiVnJ17tjaFSoWYBI/fSnUpktsbi2MYjiH8FqIfYDGpEFrk8KaA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697207; c=relaxed/simple; bh=sTMEe8hKVyhG4n3/J0S0bVeWZJkoFNBIjGAvrfLzml8=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=OACSFZKynOMlPw1BW4YpqMV0IWpcga9OqIWywpkXKOTSz/NBaKP5OX8gPcCl/HvxTwKXJu/NAmVIYVGEDebxwc8eLRaF82fY4TW3A/hifagRcqd6SzI3OaXXOKuaP+ljekZXkhi58i4KEdRxnyYi23AO8XDajB2lzqn4W49f24E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=tEQDW2TP; arc=none smtp.client-ip=209.85.128.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tEQDW2TP" Received: by mail-yw1-f201.google.com with SMTP id 00721157ae682-6e6101877abso56452137b3.0 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=vger.kernel.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=tEQDW2TP4aSlWq5iJGF0obfpW9K++suPbFYXR9gRcqeoXCNrINNmWcQAwiUErUHrhe EIQ4Q6L7hkC1Lpi1ZDYUr2jcNgeIENl8cX60FUD6uwSxaGGh6Q3sDyqoW5Ntl2LHT0ro 0FBr4Tkgmv4riw3M7uh54fA7Rwz/I3JdXpDkzmriMSnjFBEGYfC9z+NzykFXC5qRDh7s NvVt3bXraKyVCzUFpXelc73Q7EliBIJ+mzXCN5isJ1DqSdCzOntiawjk9NlN0LGoBGUs yCbqSTvwxPnKkpVWkNgJgnfpSsXkb1+5mxKivDQlPkLvXqorouaqK1yjThx5wdVBxZSR 3P/g== 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=mrX69+dn3+oVuZDeV70db6ZbsXdVpmfoFb/1zTtpJllQ0r7lnxbUSZYhEes/uffA3u V0UA72ie035zCkbKDnDnYerFvPG/pGDL0+osqIjnT5M4/FPCKRmdyPda7LrJXjKJEg9o DyJn0P3lioubtCe0WhbPGpkDe23YP4fiSHxD6mWxqnhq0JDZI3WcAKJyISXQFN6gq7GI XgXsotb4f+/84gjvq9ZK5dUKx2qX02x3YiLxSLGq/CBDDmfgzdhEk5tjGj/n41HFIGw6 vY7zPCufICqMDUWxqc5OZIh7kF+IpXb2dHInzqJNBd0+ueeQw/mEG2/NJu/vm/h82HUt AfCQ== X-Forwarded-Encrypted: i=1; AJvYcCUyJLBg4BT4KW9qCkYLkgNumelOjdfsF3zdO69sKd9i9UW65DbUL0kotcbzzBLCsg54oplWwrSgGXUgTXA=@vger.kernel.org X-Gm-Message-State: AOJu0YzdG4t2h6LQ7XpS1gyYjuybvxXw9DX88GV43Yl7AB9i+EphqiiL SAcv0yByI2Jdq6h0+X8TnBI+KES9rpGVaURsPhSTyhPb4+VG7j31EMyfYmW8WZ8l8QoJ27H8cus 92ioCsQ== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D (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 =3D (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" \ --=20 2.47.0.105.g07ac214952-goog From nobody Mon Nov 25 22:32:51 2024 Received: from mail-yb1-f201.google.com (mail-yb1-f201.google.com [209.85.219.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA8811CACEB for ; Wed, 23 Oct 2024 15:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697209; cv=none; b=nuNPKGIfVWUTC9w7iFWDwJneHdy1BNqesQ/a+5qATvkiYmMhfh8ARJAMhAC1R+W7znRxHCimJKR0GwEx9cL05zi8lgC3kFSLja9IX34CQMzdbdwgAfi5GOd3nlfWjc+qlXVAMhnCjy8hFqlzP0j29Uhy/WCWE95kpoMQdkG1JZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729697209; c=relaxed/simple; bh=B5fYkslRkwaBuwyV1YpAJJzIGleZ/3nKyW4XhZgaP44=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=mKlDnEmVVsY3eUZK+w2tmtFmRXhqETp1SpXtMybFkTQ0xNAuHd0JjISrTuUNwhAvemGuaRqYsc7q9TQkGKu5e5iiVhepwyWa1JcQtsA7bISCZtjrWNzmYbCphpdFu5G50Gbrb+Z5znHU+AIsRNCtYnsiO9QGsdd4YZAAS3Px0zU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=u2ea6r3d; arc=none smtp.client-ip=209.85.219.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--rananta.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="u2ea6r3d" Received: by mail-yb1-f201.google.com with SMTP id 3f1490d57ef6-e290947f6f8so12050064276.2 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=vger.kernel.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=u2ea6r3d2DUU5+bl/sZVLf2mxi4D/rLDtSW5oIpRnXZb/HE/6PCPVq9h2iNazmbHQt oXU8vIRfe5neBGFo32fAMSkNM0Mb17GrEAwcENC0Hl3j7pO6z012RFw+WuuJ3P4uS4+b WUEpkKYcOUd7u6KBgAfofZdt8skvAeLRlspJAmGEtZwXjh6WV6G6TwfupgDMdKTlw3ZJ +DljepbT8XN3emQglF5nQSPxF801+XKvQ/jXBNxwOBO9HVfrLTlbZmwfNtacsxTaPEwm 2JEpDGCi9PZGt0W/RfH/Ssk2Iv8TnZ4GEHAYxDKNTR8BH6O7LFVcO1qjzdPRkaD9cSOU F9Tg== 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=msDa9H9stSpKOrYU3ipXknuAYTEBbLhs8OeYuRuS25t4/ASjVzM0gCNqV3gJeVB2SK 60Inspf2oOfR4lFfYqyFhvnOumfCkNQxW8f1JMM2PXKxxjlpzKk2x+EG73dz9lvq1OA7 9hwQCWFOeuKqJC9gxo6eyp18RqQs1HJX2SqnyM1lPSyrlvBrdi4xjulMQTYCBY+zlFd4 WxD3+vaQhbDphgzpB/tExbPRaRsi/iQ/VeOIlF6uat0zCB6Dl+139Ji1QjKIjdmzhG7f 3SyDCuwRM+G4tMgOvHl0rayi6m9NJe8Nd87A9wpM0Blw1WIXKdLSXjF6R8dORVsQ9vOI iWBQ== X-Forwarded-Encrypted: i=1; AJvYcCWlS+l0Jl3t3jMI6PhoGVhocTJUfcSFngziqa35zWN9HXm7QR8+2rMBo6WqcmqbIAwDZekz5dPnvBSrC3w=@vger.kernel.org X-Gm-Message-State: AOJu0YzPt7Khgi+Gv11EkygRdqwrSdIqdDa5CRIlqk3rgPf39eq4ucKx Mj8OG95UpNjX8HtzWBXNt7Ijo8K0O5jEMuuDBq8p1pZflW/qAHgTKNpvO85VNpaYNyQC2u/HwAd hHtXfEw== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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" \ - : "=3Dr" (__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" \ - : "=3Dr" (__val) \ : \ + : "r" (__val) \ : "z0", "z1", "z2", "z3", \ "z4", "z5", "z6", "z7", \ "z8", "z9", "z10", "z11", \ --=20 2.47.0.105.g07ac214952-goog