Received: by 2002:a05:6500:1b45:b0:1f5:f2ab:c469 with SMTP id cz5csp165718lqb; Tue, 16 Apr 2024 11:47:25 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGoeq4ImVCQ0DPy6Rsv3Rh2KIRsyrlEWL9I7fUXW8bJ7yIhkNrBtT+3bCVBBMxwW2xCM4ZDc2JTUrNyk9k0hQSM2W/0o6aN/yWk6G5kw== X-Google-Smtp-Source: AGHT+IH8zLD076v4GnJjsxDG8LB4RerdxAletc07ruwQRHxLJp0x/xA79Mm420cx/6X01iPSpwCM X-Received: by 2002:a50:d7d5:0:b0:56e:2c34:cff2 with SMTP id m21-20020a50d7d5000000b0056e2c34cff2mr2711671edj.19.1713293245176; Tue, 16 Apr 2024 11:47:25 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713293245; cv=pass; d=google.com; s=arc-20160816; b=wRXMGemK3dPde08Aaiu0FiaMO4GL8KuTmTAd1KJa3Yvn4mYRDTB14yphgh20f9pxAi O8smfEuuuZp5RU9y8wkUVGjpbL1QnhoH5Xroy+nCGgn5Fp4+8x7MVHjKTd4PIcI57wrb ybcyfmNGMMetwPOSk7TR3MsSRzye4+oqHM912s9ncFcIF1yS8h7lNn+kiGELn+7q0RmI 7QdI5umW7Ptoi/tMo7WW0KBf8eD5Zz3WkQ7xCAWxzakn+3PzZcCw+c6qgyIx+DBw9amA AKGtOKNeu0DT/IR/jyWK4ec8V31Aw2+5k3Ckoen0oIaE2w3j6nLKfm5mq4hXfIzH1e84 exoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=rU9bTQzimBlb4bBeVGV64JD8vBjMh3ZSXWmumJprSMc=; fh=Rp1+u4PMjowggwvpRu96VEneDwGpmH5BAOjZCbMCQT4=; b=M4GqfPxIgsitke3S+BpfOXox6WIrJroPI+V3r5pkYiyJ7/YjOxWu6XSY5wzsBda7W/ hggz2nH0x7delnMHcbN12olO3sNllJaMo9DIXVhiOWoShbB2K7Ww/FfSTccYvRzKum9Y NndV5Qnq8+Kfoyn4uqChGYowxJo/T30AtXGA5efqhGVIkWCLaZ6GEaihy4mGuHaLdsua Y/wD/qIxk7hjh6dreMD1ws/ozPiLxxiMCBhZeH61LotbsbdI6IYZjFTTTzUsCKwCDWub UfvPRaEgI6tMWGpqyYUQoLHVXuT2rsoBhAeUF64rTQv7uM5H2MQ8ZLwm/RhvUAAXmvYr laHA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=sih91rTS; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-147406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147406-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id u18-20020a50c052000000b0057003b8a99csi4314499edd.305.2024.04.16.11.47.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 11:47:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-147406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=sih91rTS; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-147406-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-147406-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D6A461F21688 for ; Tue, 16 Apr 2024 18:47:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D871213AA56; Tue, 16 Apr 2024 18:44:54 +0000 (UTC) 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="sih91rTS" Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 C4B3A13A410 for ; Tue, 16 Apr 2024 18:44:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713293094; cv=none; b=sYfzbhKG13QtYCHgMQsJfxT44mn9qUy4r7nXRjHy2cl3QWCL3Y579EdQUVJoXy7Yd8qFU5197ZjMBNJz3dnw7UQX2rmoP4WTiQ8kMfT5WjbH60d0r79ev5j9tu2Ju6eDEEuJy0Md4ORcfNFzebrGs/Gc9f73pebwe25Xfb7C3YA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713293094; c=relaxed/simple; bh=H8usdALoznAt2isX7oNnrfLpFcaNKxvOOWa8DDbamCs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=RybjcYg+uyRQJZyWUj9VXBqovh6qSpWhQp9T2RvZGHAnjg1Ddz6fDyirBLW5pukkT0aeMsaUGVl2AvhNVudvFQCoLwNl5RtVfmWtDXWGl/I3hfBJVhhu1mZTwL8GeqSXr9pFH/i/cnWk30AvG4DLrDtKc88+WoIu4yYiYEruecc= 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=sih91rTS; arc=none smtp.client-ip=209.85.216.54 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 Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2a475bdd4a6so2768470a91.2 for ; Tue, 16 Apr 2024 11:44:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1713293091; x=1713897891; 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=sih91rTShDqoyV9/xzv6ODbOQ9WzXUI0NA2N1u5hPo4SN8KN0LHQo1ZKOgYVCGwTup ooHHf3cdnJAc8xN7jJgrHvCGIXVIZ64R18tYAbskUBMrZBHusxX4d5LgQmPbWDAJAzF0 Fae4+KQcuB9wmkjoliYD5KUG9qO3YBVeZrBEfAlO7lGQ43bbJCvCyNer94VMG1OpDuiT N+TEOuIfBx/WJqG/ajyuJimeA8ZpQGEmEpYu3eyAItpFJWMbcP+6Rt0oCw9D+w9+0+bK HThFiybcQVw+QrT04+tgmTVeQyP4IzdlRbwj62zlatrQP0ZVf/tXoXPzmHM8xZBHL8So KxEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713293091; x=1713897891; 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=LnFaOtmC9rjLcEc9lv2U5hJ9fCP620weLhYINxDP+B/F+jVVjARVK6clAsEP3VeRGF 4tD+mN/fqdyZDHsM6yAkdd29GQ2kPGIYiwUUgqvHNCa+lfg/+KWEHUPqndcOGQXd4L6e 3Q//pnpb5FG38ND3BMDt7kJ3PckFzonEm3/F8+jgDdlO3UDy3a9c9H3kxm6iKDCsXBbR frYGaGxm4vXykVo4kVnL5AWTKSM/+nv1Qawcfjg858QT38TYD9RC+JJgG77/WVKi4OOK eSFb2AQNRbqbSO/kPs5psZGlJVddcKsU91cYOBwUW9SyLwxgE6xn/d2pczhCP2jxLFrK TUyg== X-Gm-Message-State: AOJu0YybKmYgZZy4jXKFsZMubA2CfGii5lqezO7KnpQzcqiWQnnSJxoO He0lMt03x3EW+4aDtyYBU5Vs2Viz1rzFPdR3fLNpvKEspsFLrSKjBhmbVcruw7meo30NhesEXRW g X-Received: by 2002:a17:90b:46c8:b0:2a2:50ef:ece2 with SMTP id jx8-20020a17090b46c800b002a250efece2mr12099952pjb.17.1713293091321; Tue, 16 Apr 2024 11:44:51 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id o19-20020a17090aac1300b002a269828bb8sm8883645pjq.40.2024.04.16.11.44.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Apr 2024 11:44:50 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Andrew Jones , Ajay Kaher , Albert Ou , Alexandre Ghiti , Anup Patel , 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 v7 07/24] RISC-V: Use the minor version mask while computing sbi version Date: Tue, 16 Apr 2024 11:44:04 -0700 Message-Id: <20240416184421.3693802-8-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240416184421.3693802-1-atishp@rivosinc.com> References: <20240416184421.3693802-1-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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); -- 2.34.1