From patchwork Sat Apr 20 15:17:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Atish Kumar Patra X-Patchwork-Id: 13636827 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 1CBFF143896 for ; Fri, 19 Apr 2024 23:47:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713570479; cv=none; b=cX34Dqr7oXC6lkORi5Ef1JL/+W00/GnIHIndbgl9ExlMz6JbZVTGdnRxSSAweKGbjoVvxPqVzT29UOjNnAYIwMiLhh1luH6Srsm3ltI6pxorsd/auCXoidnuyE2H475UZXBpkXFTKdKVn6PeQMor21WYGH6V0ssoRan6KYsGyq4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713570479; c=relaxed/simple; bh=H8usdALoznAt2isX7oNnrfLpFcaNKxvOOWa8DDbamCs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=CdxJ4dZ7sGR/5Fc4yfll1s6qx+ekrFYJsiU3dw88Jn13gTKtvMbQYV8oVhAP5He4088J3QMuA5HDd+KY2Kc6EXSkKFUURcffHlhONFrLx51PZxH6BVbB4Ud6HhRP5PkN3g+OQWTxAgz3tmua3bX7NzB85ZSXeumGNF1k3GuoIWo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=OMD8wsZK; arc=none smtp.client-ip=209.85.215.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="OMD8wsZK" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-5dbf7b74402so1579315a12.0 for ; Fri, 19 Apr 2024 16:47:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713570477; x=1714175277; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=rU9bTQzimBlb4bBeVGV64JD8vBjMh3ZSXWmumJprSMc=; b=OMD8wsZKCRdjJvZGYl+Ya9IqIPLUZN8Us5XJWfHNYzlhwyLm4likvuiWW6LVNW3IYE QU/Srx4vAkmXgdvUwKtwJaZWCykHAgaudHZKtq4SKk7HN63XIwXGxRpzofIGz3gbcCqO 357XHJEuOzF/l+GTioGQAaLZuoS/lfAShwkiGc2PMHLF+EBfLUu2ac9wQwzCm7CfFEmG gNKJnSoRazQ7Yox/coXpMl++jZ0OW+T2J0q6yFtlaRwncB7uq/9qBwDk8c3ce8LZ10td C8qi/t2EQnGp7OFdkE5qUlQM3Xg3EsweW/ZuGLTY8NgW4A2nrc1gHBbJUl4DPUEmEP9Z zkQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713570477; x=1714175277; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rU9bTQzimBlb4bBeVGV64JD8vBjMh3ZSXWmumJprSMc=; b=KQizxFqRwOxiW8QnMqKB+uXs2byKxswkbHwUOeVcNEblDrbITTXpdj+GlcGrEafPzR NaCFXF1wnOvn8dt/c6bGEDgraevqQkWgutm07OmnDgpnhZ4lPlOk4CThpwUDUen1ed0B /Q3puFiaaZikFVwQMyK3kcS1FXdnkUvQCWxd19xo+AZpCjDLkJXVH4Wv7R0Ef64gBstS MexaUEWZyyy/8HMDgKBO/p/vW7no4kEbTypqHsccHfTsHLzqwr38B2jVwKuPGyHE+A6Z JZgKONasiksBKSh4+5oXB7vBDeN1MCkCcqJ7x6+rqxapNLkYxevFp60ukwr/POHfmv9Y p6LA== X-Forwarded-Encrypted: i=1; AJvYcCWpGm+7n8JTWQLbOWzONfo/HE8sA4l2jrKlkr+ih7moz9eyJALc0ie6T5V/8GwX8UVjNumlWnRk7V6VV1CopFsrCayB X-Gm-Message-State: AOJu0Yx36BuGz8f46xLsZM++SMqS5WbEuCoTfBezj4fYc7pwg/+gcRBF uRSjbRAadFpzZxiNZdDxkXPBqCT6fvSxJEz/dLFN5CRmXlcctSMotHWR/QHA1B0= X-Google-Smtp-Source: AGHT+IEp4LLA0ETVFj3v2NTREBIL9JwLMfd8wP55jjHsvOjY9dRaboqfqB73D1IRQCndgtBmMeDbdg== X-Received: by 2002:a05:6a20:8422:b0:1a7:336c:555c with SMTP id c34-20020a056a20842200b001a7336c555cmr4805991pzd.60.1713570477483; Fri, 19 Apr 2024 16:47:57 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id w17-20020a170902d11100b001e42f215f33sm3924017plw.85.2024.04.19.16.47.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 16:47:57 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Andrew Jones , Ajay Kaher , Albert Ou , Alexandre Ghiti , Anup Patel , samuel.holland@sifive.com, Conor Dooley , Juergen Gross , kvm-riscv@lists.infradead.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-riscv@lists.infradead.org, Mark Rutland , Palmer Dabbelt , Paolo Bonzini , Paul Walmsley , Shuah Khan , virtualization@lists.linux.dev, Will Deacon , x86@kernel.org Subject: [PATCH v8 07/24] RISC-V: Use the minor version mask while computing sbi version Date: Sat, 20 Apr 2024 08:17:23 -0700 Message-Id: <20240420151741.962500-8-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240420151741.962500-1-atishp@rivosinc.com> References: <20240420151741.962500-1-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 As per the SBI specification, minor version is encoded in the lower 24 bits only. Make sure that the SBI version is computed with the appropriate mask. Currently, there is no minor version in use. Thus, it doesn't change anything functionality but it is good to be compliant with the specification. Reviewed-by: Andrew Jones Signed-off-by: Atish Patra --- arch/riscv/include/asm/sbi.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/riscv/include/asm/sbi.h b/arch/riscv/include/asm/sbi.h index f31650b10899..112a0a0d9f46 100644 --- a/arch/riscv/include/asm/sbi.h +++ b/arch/riscv/include/asm/sbi.h @@ -367,8 +367,8 @@ static inline unsigned long sbi_minor_version(void) static inline unsigned long sbi_mk_version(unsigned long major, unsigned long minor) { - return ((major & SBI_SPEC_VERSION_MAJOR_MASK) << - SBI_SPEC_VERSION_MAJOR_SHIFT) | minor; + return ((major & SBI_SPEC_VERSION_MAJOR_MASK) << SBI_SPEC_VERSION_MAJOR_SHIFT) + | (minor & SBI_SPEC_VERSION_MINOR_MASK); } int sbi_err_map_linux_errno(int err);