From patchwork Thu Apr 11 00:07:35 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: 1922283 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=xz8Jcuw2; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=ldQuivrG; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=patchwork.ozlabs.org) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VFKmZ5S8xz1yYB for ; Thu, 11 Apr 2024 10:08:46 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=niE6zcFOCcRnL1FqPAftuK7eYX3Oz3VbBlTpBurhGrs=; b=xz8Jcuw2JNJTD5 MWACZXBRKKEmTz7avCegQh50O0DZk9XKOu9Bij/mTGDmEYqRA3Ra2hp1kN5vWhE9mO6HJm1SAeaXp qXKl7fUtN93GauztgX2bsSfOIWcDFdjI1XiGOoOyG4IMs0qtl5dFVNr+utmqpZ/e+AdNAFnHg7/21 3mNyPSdTD0nnQ2iSB+dyuBDLEDvGslehY8AwaReXqn8zZckMQwXeL7K01eOF7BIJOXAOmbn2zcnS3 QjOIIikOmr2HfIARxOBDq87jsnAFeP7xmSMOl88nBi2q1x1qB+PjHjVNgN35h2gT0dvTFoHFwUDAI WYHcEDNh1haTUB2XrZBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruhzg-00000009ZtX-4640; Thu, 11 Apr 2024 00:08:45 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1ruhzP-00000009ZeA-3CrL for kvm-riscv@lists.infradead.org; Thu, 11 Apr 2024 00:08:34 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1e3e56c9d2cso38855075ad.1 for ; Wed, 10 Apr 2024 17:08:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1712794106; x=1713398906; darn=lists.infradead.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=9Ogf9r7p61Rc1oGw0oa8bhNwO/iV9jqlxUmzvsZGcz8=; b=ldQuivrGqdeGZ7tLYd2fE13TCOaKWgSs0E/zjIQt90vWf2BTqk+I1YR2vUemZA3DAr ySn4K09i5JllmGII3u2ZgNrnl86xicZMJmr+1A4ipu+1sxO9R5PhQ6bgvsL5RasOKDUm cMhA1ALNvjEAXT+BU0Cd+y5mb+Zt8vyojC5TbPwfgFtO827JW/ERYsaeMZbw3fmEJ9II Q7zMw6e/oVUpAXzks1SpO8+KbsWfRxrlypwEoCCi/lwxjr0b0SGFIBJ9zLepl5e3cMtH wq+GfdNXJdtWREIIlORAzLJEY5aI+xfwRzjWMKKJbp6Gn9O0CrgJ3h22VWe0Yb62KtAW KD3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712794106; x=1713398906; 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=9Ogf9r7p61Rc1oGw0oa8bhNwO/iV9jqlxUmzvsZGcz8=; b=Te/i28OSi3DV2qDhya6qu3GMqqlg0qcsm4xw5A4cY3Q9PhNRH1HDWvVD+P4/1z7Zv/ W6UUat+hFRYT+t9hsi2FkGDgVi3rV8rqOQS3TeJf3EZVPrbXSukxmgHvlABUEF66lhrO BDdzicTqYShH20vw9LOjJp8IqR7sHcVVvDCePD/BgKw/eRBbFLm67mqFTIgaGxb5hXr0 GUSFhguzoP9L6cW2ykaGkr31kni4aLsvHR+s7zAFrNweMm2lKoKlJmmfUek5fVW/ZZCH YRvwkrcTh1xX7e1ZTv/HGMIIPGv+3bWlTwP0/EZBnvOJcNTUy9A7cbsM5G3sYUimrFw/ JaPw== X-Forwarded-Encrypted: i=1; AJvYcCUvTlsbDxfqwoRdA8sllOnEbVplLYuCnP8UNNN/mEn2pk8Gq7arAfUXXN5Dh5xLAHuUQqqbMyxrbseO0jVP2woX6Nz70vTVIWzqX6Mepg== X-Gm-Message-State: AOJu0YwhmmAfmn53Dh2Zn1H1y4MPU6FbzkCayeXbqRirmXWiEdimnuN6 /8t2FAyK/JI+V6MX/QrsuYC3FSY2H7H5HB7oOmkcPg+HWypu98fAuy7M8DbZYJs= X-Google-Smtp-Source: AGHT+IG/gd//TA1TkjWqM9vD82L3r8r0JszUDH21ZhI6QqZDs4OR9Y/ESBK0GgL0mQ8WNU4EjNB6Kg== X-Received: by 2002:a17:902:c944:b0:1e4:911b:7a6b with SMTP id i4-20020a170902c94400b001e4911b7a6bmr5362603pla.61.1712794105838; Wed, 10 Apr 2024 17:08:25 -0700 (PDT) Received: from atishp.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id f7-20020a170902684700b001e3d8a70780sm130351pln.171.2024.04.10.17.08.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Apr 2024 17:08:25 -0700 (PDT) From: Atish Patra To: linux-kernel@vger.kernel.org Cc: Atish Patra , Ajay Kaher , Albert Ou , Alexandre Ghiti , Alexey Makhalov , Andrew Jones , Anup Patel , Atish Patra , Broadcom internal kernel review list , 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 v6 07/24] RISC-V: Use the minor version mask while computing sbi version Date: Wed, 10 Apr 2024 17:07:35 -0700 Message-Id: <20240411000752.955910-8-atishp@rivosinc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240411000752.955910-1-atishp@rivosinc.com> References: <20240411000752.955910-1-atishp@rivosinc.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240410_170828_554718_5A03FA6A X-CRM114-Status: GOOD ( 12.87 ) X-Spam-Score: 0.0 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: 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. Content analysis details: (0.0 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:62b listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: kvm-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kvm-riscv" Errors-To: kvm-riscv-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org 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. Signed-off-by: Atish Patra Reviewed-by: Andrew Jones --- 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..935b082d6a6c 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);