From nobody Tue Nov 26 03:34:15 2024 Received: from mail-yb1-f202.google.com (mail-yb1-f202.google.com [209.85.219.202]) (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 5800548CFC for ; Tue, 22 Oct 2024 00:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558039; cv=none; b=PqszGqB+qv1kzVO5f2nK3wUZNr9OZFLEv8U/zbdnGWVYnctsoDVxPzdrNk1hKK/gVG45zQVDAh/hEXvhs1Z2wAEuZ76TWSppLZISWu7bggvY2LBj5sb1cwUgY0Z3f/ouT36Betb0ELRcQJD/DKKj+ps1IaV5U3acePxY8gVTqTA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558039; c=relaxed/simple; bh=esQoNZuXsR24jwPl1DfQPAsmfQfBH1AfjOxCgQQxj50=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=irQ8RtLjGIbRtzWB6KSMmkn+1/JBli5KpmbOYvCz2+zYsa4HQE3WRcJ/h87mCkjPKNWPZCnwlkgargoxPB+r00ZBT1uKQvme60QtLLw1lYx7FyOX0rStEfDiVeYbL75cvHlnt2PeLIik4cXsAuFCBaasETw/2MxughZVq3itPgY= 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=pbkfAGXs; arc=none smtp.client-ip=209.85.219.202 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="pbkfAGXs" Received: by mail-yb1-f202.google.com with SMTP id 3f1490d57ef6-e29135d1d0cso8131186276.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=1729558037; x=1730162837; 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=pbkfAGXsw5ltPJxt62qcFHuhxfOFJgiMyuPM/HYpxcY2SUq0RfxjBO/HeDkdl5EqCz 9XK5P0Fl5EfRL1a09o4t/oyrMhg9xOIudUbtcCODAvaCcVF+R9uAcJvXC/GfrOGOH2x2 nksiHK+71Mx4joys+NV7OWJYMt6a9j7e3YDcNSdu3a5bJGp3HH969rI9HHpWlREpwnfK gbNMBFRHU+0+W2TX+DkwftB/rLOvqGwP1It6xH4SXAXZDxIKlZ6ZGe2ojwzw6RdwPVq6 4orxHk1NV/QCqSzxN9XF9r1C7oSY9VhiE/T1XM9FslfSwDxniWeYTUvwi3gY01vvPgbF XBGg== 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=aM7mse83O2MtPnUEhQe77sdOOsXBVcUl1fmN9tT7f2GTgiHtBqICYTV3BKgcAEs87a 7DDOZZLdgn4vPQLR113ujvhFIDxOSegx0iu8xe2hZ2Wfn8QOvtV+keucqDSfMKUt1Y3N O6U4AAv080owMcKBt2pX+HK5J6R5e/n9rqlwnQ3wCxJqpChBk9DIO8lRwNhOzeoAnw0O cVTKgCSozl2IxUnthvnNCqg9CbImDEirFIKMOpnAbdJPidh/+73PdIColejcx5lC/zP9 CpBAEDXNjyivbdM47yKrmutcvy+q5eIdEWndbhDIUfr5Vsx9dOG/9mgrDulNWHYPLT3P +Ngg== X-Forwarded-Encrypted: i=1; AJvYcCUz3dqrcVdC89wxNS6b6jiNdwk98zn17V0/reTIrfEJYQ6zqW7CehssP9WO2aWP4/9a5lYml3y+anArlDo=@vger.kernel.org X-Gm-Message-State: AOJu0Yw+bhWgLgP5umcZxAgtUeYB0HCfzRq8fYMMFhSI5Nl2RBxnJKtJ CKDRC8ADYLi5m3r/yyiHbdgkyGPu2VSxsKg2by25wrxRZqUzVRL/NvH3hkxIYmdFw2eWnFVCKbK LB7rQlg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 Tue Nov 26 03:34:15 2024 Received: from mail-io1-f74.google.com (mail-io1-f74.google.com [209.85.166.74]) (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 07EE183CD9 for ; Tue, 22 Oct 2024 00:47:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.74 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558040; cv=none; b=UEtqhxwo+u4ihD127IFoLMRT9zqBcOLsX7DpUizLtKWw7bRamNInNo5L9fIC7Ro0J6vJB34p4fLOepyP35Inxrvm1pvPIeDKlWiX/1fvshqdGSFhQBQRIKJC4xO6kjtQ6vWqEc1Yy5vo8Dc04DhBcSYNISP4VrLLGgTH9RIVVvw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558040; c=relaxed/simple; bh=3W9iajvimea6YrR9U732pMuKRx3PZLGRnnVS589DTvs=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I+/W1EyFpc2ZFgUVGhZOkZwLmQmG3lNCEcVF0DXFdEDM94b3r47uM0LF+Z1oRRixlCNVGa7FZRoQDiPqc6B9qp40KOCJjXTx9Lit4AMplHxgXfvNi22cRXosYeXJmPEVGrD9Yu5eLroGwIx9CAINAiGR2k4RiunnTgeG0iRwMyw= 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=lYUGgy/Q; arc=none smtp.client-ip=209.85.166.74 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="lYUGgy/Q" Received: by mail-io1-f74.google.com with SMTP id ca18e2360f4ac-832160abde4so385569739f.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=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=lYUGgy/QGwm5mMpygqQrfSTCgpdB085DCm4QVpnUSHMhxvYfVPDpEGIjps5tIZotlk Mn3k17DOA7Pwd9Qf1rLwSR9JC7+zuET2QHoSPcFop04KwGzVzcKpMMAZxJOvmtfEPg8Y 1iEZjtbpjFfxHo+mCu+eljsnP2VA6GyZNA25cUEH9vvvfjVmhsx+0WpfageveMyFcZLm ILD1VfHvupHGObuJG5aRUEkaHaXneUEF3TsDO2+a6fPSIsvgg8YI/uHaXRPxXRmNc2Wn EkWTy2JmwBWENsZMr3g1YcP9cGModOQgqISlwjLfnMkjtlRWEPhJG0YYespkufIhd0aU GOCA== 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=WRU/91xWlOrO5u0eU4xX0Ndzw8gJfazjiZzrBXZs3OU5rNIbhLquoSgQGlgeb+EbZ1 9FyWYUOBcyHDKUi+J1hzkTYIJ+Gx9Z0oLLre8emXLGY5TnmBgoUxMFUX0VHAzLJprf+M IRLhDXxT9Lt6pRw9idjbCyh/DiWchsfEZwx4jTZ4dzQ1i1CJaMEXLkntWH0HcFs02ayG GKIvpuIlLbpAapykwytDm/vUo6X2ekZQqkRB3yqIBKaRxaLkYckxGxrlUBHAQ+Sxs1eu nvEPPz4DcJEqSx2LN3hcP5y+Si60RXcKfZlfbDsCUv4xmdTWFE1B5y5SF4ZBGVJKkfKx T2RA== X-Forwarded-Encrypted: i=1; AJvYcCUw1nFNue6YGZsK1NDwy0B1nZD0O7sKKtIP2Y9YNYOc9hfooEXd8763HzvmITx+nzO4TSAPgbBAtzFS4R0=@vger.kernel.org X-Gm-Message-State: AOJu0YymmlHwPuPYicATl1JWdusYPcjsdwb9vjsm7nHt+NHYoP9Eyh9M CsrU6gSqFDG1trIYoq4Lutg8QKIEFIcX7hCdqn9tggjDpQuidm7ztHYSex2PAxo5gHuv8sQLhuz 7sYDctg== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 Tue Nov 26 03:34:15 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (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 47705127E01 for ; Tue, 22 Oct 2024 00:47:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558042; cv=none; b=ZR2YYkYhbwqvTG3nYo32oasxP9905GijRIx48AMxENyuPYSAiGJzwZ/Ontqunk44iKzALxrL8sN4lw8i/B3IgakHwhIGppWmEiJ0DBjr3Jn9Mrp6TWpEPBXob7JOQsovKeCn/8PUsmE90JJXBoY5nT8w4pSGNxxi4XFLWMzkgbk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729558042; c=relaxed/simple; bh=/ZZM1+dJhOvu0mr/UtOV9hTqZs4pXxjwQKKx0hCIUpU=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=AKhJq59lKhkV4bL5DlFS13RyyWwWMQHiQJx/cIjiGatyK3dw2JWjSY5pqiRGbnjBl2j5Bqx2S7dC+ChU9uW9hwzYvfqLnQjBA0wRHfXEJ7k6lXKHlZM3VNM8tZNSK7r47tPpN0usZ9jXzN2G4JQA/H6HKVd1rOpmTxqiLXFE8Qc= 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=2XneRuG7; arc=none smtp.client-ip=209.85.128.202 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="2XneRuG7" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e0082c1dd0so106010287b3.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=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=60wgcSLTXVxTzPUjoeX/E6FIWkDuwYegYI4IrChLCKo=; b=2XneRuG77wAX6zrNp8ejfDvvLyhrzvmReF2/azXsWlbn2+Sc6Fr9evwo5vQfSHH2ch ie2sVi321yxyA3Gbl0RhzlMg8PHPMA2SdSWQEBsaRUckn2n0TtX1zT6B7fVJMSlOebql 9+orpy2qAy6jFIlxEIlNzAzqNBgErBRYlRypRJ9ZgEFgfu3rKwq3G9sZcPwn1NbojhFV Yig94blRaIjzicOcOn4+qxlWDsr8wLjEm/RpUSxwLMy5zduML2qc7/HkGExJdbpI1zA5 R5XhSHdwzNZA4jqUeyII1lxfzHklpXzpDl/yx1Urep2T0JM6xKztjFEAM661YUzY75nt /Y7w== 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=v4svYVlsCQLF08J9H79udUpDjzREeT9td6sV3l5TetHrmDJ+HEK+3dWUwflYciJfNw UgsxjOaNkSawMPveWd/07//RFxJsBuwpbOa6MsKpFl19V2M1PZmj784cXCJ2ylHVKIvZ +F/PFioQO0PmlN5n37AVnKuTyR7k0rLgT7AohKh0diDi9hFRkwJsJG8PnUzVLkSqhI9l 7vuBMVNNSq8yd96FXFlEhhpXPpOtemQlSrW/dz/DYxWeXDcCZWljiEXrjiApXUyhAzio Vki8CoKx2jU9BjY0rifCFl5EYNWwBAaa38q9PohsZLVRxKraBXlJfUkCOFpfo9EKUbC1 1oeg== X-Forwarded-Encrypted: i=1; AJvYcCUAAwCyz5vVOd8jFzXI6d72L4DgIWg7Ahf2U43eadxG4CADtz61JOiqyvcE6p+b8zMdiCBe4HbpVOgHuBQ=@vger.kernel.org X-Gm-Message-State: AOJu0YyJ0hFEN7GkpHS9rrBeY5UtDHII+Cxp3vGy2soEp4ZocfTioG7M kdTLUMGDxFmRpEUDrPjcJuhWUtcR8aPrwKR4OQIn5fl+Se6gtvo5hA7TIaC9DlsFk2LitRB6tj6 i1m27mQ== 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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 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 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" \ - : "=3Dr" (__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" \ - : "=3Dr" (__val) \ : \ + : "r" (__val) \ : "z0", "z1", "z2", "z3", \ "z4", "z5", "z6", "z7", \ "z8", "z9", "z10", "z11", \ --=20 2.47.0.105.g07ac214952-goog