Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1424627lqp; Mon, 15 Apr 2024 06:22:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXZIIrjyOa/2yU5yVxjQueUjBwplcppoOdjZEmT+L5HQ8TFRVnAiqcvBaPm19l6sBSP4GMjqZBANJvr6K0UT68/tQgIuCy8mrEqlP/EXw== X-Google-Smtp-Source: AGHT+IF2rBO0r4bKc276a7Ba4wftZyRIIlcTQtb2kLqKRjXQto47cITjwWAUsXBMhbJZu0ESjiMw X-Received: by 2002:a05:6512:2814:b0:518:9d14:34c with SMTP id cf20-20020a056512281400b005189d14034cmr5179834lfb.12.1713187349613; Mon, 15 Apr 2024 06:22:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713187349; cv=pass; d=google.com; s=arc-20160816; b=R99kUh0RDmJ5LvNjvP13d4tw4+F+cwCZbLh6IVNIOl/S6P/DSWf0QYyf83m/t4CJJu PyyG+rf5jCJfoB6wxX0r0zARGG7TkMVqYoa+r5TxqqGTJwI04S1LGboj/y9oERl4cced eCGYv9paq4ZR1HQ4o3qX6CA5XgYtTPzYvUbWvOLy4xVG9ugfRJWV00EoJaxUxWSEnlMT D49qIVTtQb3hRj+tqLScgdlgo1CiTcg7AU2J+jt6hV44Xbh04JTlxbuJVRMiMNrPMTDd rG9ZoaSl+9DbjlwIVCpN7D/czNSUI+b+ROAEn80AOMRxSb+GJoopBWYGK8lzNpxSn+Nj lrug== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0+QRCDHPbz+mQnU+rPEOfZ5PlBfWp32GZiq6bjgpQeA=; fh=/M/ZV+lOaIZjrcAedtsSQkBBHyX9xSYSdwu3dpz0xC0=; b=GKGOI6BCrgchrVfaoEEobguIgdfgg4r1oHcAR3tcWGLjGPjpkYDOrbYGzTFALlPt/9 nB6L7P+sSj99oRy9YKDAd2qecjookOYneCKtPACwdGcBFacWwOgl+G/hghQyU1Zqwjx2 YMdVxKFHYHnWWdJXnhC9VGjTreby+RReuDtCdTXCBSxwdM8580mNVsT7/Em8QZqVlE0O Hzs4uBzf9oL70mIJjK5yZLGASzzkhrgWzRjyGM2tBXCxgZ2ef9wNgtI8CoroWFdI4jze y9zJ+srGB1U1AY0bO4V15SWcdc3weXGG0+zj8z99fBnyKpeKKHYfKvgGk8PrVrZHpTj1 bWrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=pqBdIetp; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145221-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gt19-20020a1709072d9300b00a51c5517900si4665151ejc.1008.2024.04.15.06.22.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:22:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=pqBdIetp; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-145221-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145221-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 2CB721F21BA1 for ; Mon, 15 Apr 2024 13:22:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 81B02763EE; Mon, 15 Apr 2024 13:06:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="pqBdIetp" Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) (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 0EB8C73511 for ; Mon, 15 Apr 2024 13:06:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713186402; cv=none; b=HmI5jM6/3JuI3YeY0NOTykHwqGzf2oAOw9asppSgSAtFXcfy6o1D//ekkJARQIhdJVrfZQu5FmZs56a41JSLgGVupE0XsR+bRO3JkyUqIeXcfsKV8ihsKGmN3g1UtIVHxeiAw2XBpIDD+0OOZl8YrjL+kvrJh0uI3+/zCf6ggFY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713186402; c=relaxed/simple; bh=ROXk9XS99J8mzxWv8tUd/6Kf37JaYFVRZLkuT1TMEa0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=cAxftLlBqVnVcTfpRvQCefKwfmhf6Q5JAXtWWlG2GDgkeVziRkZpFplGTTNoINab66VshyVm1KPsMuR1yI+LEf6NjHNmsXRJOIHKoYNo1v0JB3/WLiCoSFbIoo/n3c6gsGtvceOiWZT6RaRD39rvwderTYRVLriq/J8xSW3Bf2c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=pqBdIetp; arc=none smtp.client-ip=209.85.208.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2da888330b1so11388511fa.1 for ; Mon, 15 Apr 2024 06:06:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1713186397; x=1713791197; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=0+QRCDHPbz+mQnU+rPEOfZ5PlBfWp32GZiq6bjgpQeA=; b=pqBdIetp1ApKhfa07J5SnT+A8wbQo73Ivvy4FEhtJJpDDvhhoWZO/QEVa3Q8z6M5ul qJxt7c8v8F8W4qaeKXAsOI48zUJ145oZcnAzXAqsw+8Xk/R9pZQVwgfISetCpNszOEiD SZF7/GctaDrg3IZHXSae34s6pZLBiQEaP2I75G4luxMUhlqca216vlZ7bY4TVJW8aX+e EkwduIBbbqeN5KW0ukJN0Y7/zA3dYWp8EgRy4l9MsUJV6A35J106u7OfczffMys31OkQ 4F2a639vPxfuPo8N1lGnvV4olcrCtbK0zn3/3vV2KTHToJ3E7wTq01WmIuDeFuDjfQju qlOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713186397; x=1713791197; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=0+QRCDHPbz+mQnU+rPEOfZ5PlBfWp32GZiq6bjgpQeA=; b=v6DDqxSh+umJg4/WBxXI2ikW9zn2cNfgTch628ZoLGGp/A6e+q+9jn44Sv3AK4SFTh 2L1RivfegV0dgaBfZ6AHOk42RMkgUdHOWG3dM9u3rPW4PCfK4Tx9MdG2niYJPd++KagF HxxoVyheX6hHDcTHNcZjkho/ZVKNvhwjJ/+6458E/vOzbsdoqaO0d2PBbYEKtYaVlgiZ ZOi7wcPgcKJRsdappF/GP5cJpjmU+CTg644Ps8824bkYMxnE1KEa5EritkgpGnASkORb BzfE3tKdoFxzuLbHGM5XP350JQ9Zh7NvLvoVU4d99Rh8PeUd9kkNpEFEdQwQsEceVINR V9jg== X-Gm-Message-State: AOJu0YwEIxd/1Gxo61OlnjOh4ofQiIGuMVe9RU7vnFov63M76TCzdGfS F11+4j5fbY5cfakEYjfZofAo/4MZBsIQB3Sk9Xooy1NxxYVFJ0rn9gmjyN7Fth8= X-Received: by 2002:a2e:be8b:0:b0:2d8:dd28:878e with SMTP id a11-20020a2ebe8b000000b002d8dd28878emr7797631ljr.2.1713186397221; Mon, 15 Apr 2024 06:06:37 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id o4-20020a05600c510400b0041624ddff48sm19436126wms.28.2024.04.15.06.06.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 06:06:36 -0700 (PDT) Date: Mon, 15 Apr 2024 15:06:35 +0200 From: Andrew Jones To: Atish Patra Cc: linux-kernel@vger.kernel.org, Ajay Kaher , Albert Ou , Alexandre Ghiti , Alexey Makhalov , 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: Re: [PATCH v6 07/24] RISC-V: Use the minor version mask while computing sbi version Message-ID: <20240415-e229bb33ad53ce43e3534f5a@orel> References: <20240411000752.955910-1-atishp@rivosinc.com> <20240411000752.955910-8-atishp@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240411000752.955910-8-atishp@rivosinc.com> On Wed, Apr 10, 2024 at 05:07:35PM -0700, Atish Patra wrote: > 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 > --- > 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)); The previous version had ((major & major_mask) << major_shift) | minor (parentheses around all the major bits before the OR). Now we have parentheses around everything, which aren't necessary, and no longer have them around all the major bits before the OR. We don't need the parentheses around the major bits, since shift has higher precedence than OR, but I'd probably keep them. Otherwise, Reviewed-by: Andrew Jones > } > > int sbi_err_map_linux_errno(int err); > -- > 2.34.1 >