From patchwork Tue Apr 16 18:44:04 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: 13632323 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (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 F0D8E13A3E7 for ; Tue, 16 Apr 2024 18:44:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713293093; cv=none; b=bDcGyXpTBp6Hx24xHNI1sNcrbLDHtikKlmo56RZGYfaIS00ZwF9RiSMXyKP/3Fz2NzM3uD2NJL26csGIcErE/00JUC/U9Jc0i57i92OQEzVkqIplOp1OdsqnF8EdwAgBcFqvhE4FCWtGS0skwps7OWk7h7i9EvnbfQjF+zaaoIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713293093; c=relaxed/simple; bh=H8usdALoznAt2isX7oNnrfLpFcaNKxvOOWa8DDbamCs=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Os4Q6KAW6553KDzY8sEpL69stkWkS4okurt06iwGkcxsbQZi4cIDdYdDnsYChG9g+C5UX2PMMPhKeeaIf09w+AdqcCXTLOb2JzJwOb8uinYXp43ELAJ80pD6GcXHxNy3WKKhd6MmVT4tdNBpuQNI0HZ8Dd9R+uKNNsgOaPor5HM= 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.49 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="sih91rTS" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2a526803fccso2773864a91.1 for ; Tue, 16 Apr 2024 11:44:51 -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=pICdReiUaQMBoJXRuh8qTULpohvpYLMWR6QsvLPei6N7i32sV0ZrEdQ/1hxosHGVm9 E2/L71lb/Uv/4H6UbgAeW87mC1MGKCcQoTO/ZDM02k1k6IWb+gekNQFoYXKgqGwCukne UDSOK7cekXMobt60Smge4dveM4RC/0Q67dv4vALh1djLex0bzvFdrIAznDl2QqTrKicZ 3uPu0zUnrkATMPqSm7ezJ1BORWVdr3iZaM2Y1HXWGMubAQeOxbCqKaPNN6NlqW20dnPC CA1tyAzVf6CUVUa3+nXMnJfwkYVZY4dEFuNWPH+hDED8jIIJuH4yTna+ntj8ydK384ik IWHQ== X-Forwarded-Encrypted: i=1; AJvYcCXGAT6qK77/tqBZBSorsKgEVVO9NWc3VdkgHmHlt7VTwGZaMhN3jSYesBpQugTuEq1H5pi9Mfo2d19PGf8pySko5znt X-Gm-Message-State: AOJu0YyBoGWsFNePRQzQsJku4cdyvW6qxuVeYET8gpcZWW8+QfWG5w4s 3Qwr0hOHKLvMRsyAoXOZxIcfTj4wvhfeWNvp5qkkTc1rNtmN7B+t84Vka824P5o= X-Google-Smtp-Source: AGHT+IFO7gBokex9KDHR7FMDDghsIz2thvCcgFt0g1hVdtn3kLkpEMXY9Ea3s80HyJZdLNzoP7x/LQ== 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: 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);