Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1210429rdb; Wed, 20 Sep 2023 02:55:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHkbQQVJqf+DL5mpJCUkgH2T0XkLSIIQPgxNw9kHYRSVxcpPSRUThnPK3+gkMHbwDGltSpt X-Received: by 2002:a17:90b:1191:b0:26d:49a0:2071 with SMTP id gk17-20020a17090b119100b0026d49a02071mr3084846pjb.13.1695203700792; Wed, 20 Sep 2023 02:55:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695203700; cv=none; d=google.com; s=arc-20160816; b=BCNLj/30v0SyLYjCTiqjJ8x1O2scjq0wOyKVpx3MAXG3vyS3HDPtg/w4u+WLNduZ8R UpTlaLNWNMCsyfCqp6G+R7ANkYy3bqzssFb71Qb9vsiCjHhq28IAyr360b5tpZReCZXZ MT9NJa/wT9oA1IHNthJuIhDDZXZFn+K/6qyBe+UZVEWKMuznd2GB9BXqfHLOK+5TxrxD VfHwjXnoFHb76lqjkwrw/Mb2ne2idbO8pdfv+rrONgLv9OZnZ6xIPLNBh+4jRxSZVkCQ o5UqoMUF3a52PRcLOTpJ8xJvbJN5gIH4ePnGeY/7/a7EC7T9qOgOT5b8kG0CALiauptB X3rg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=c+3/wOOicjYC2xAjvdjrTiizxDM62+8wq1jD8pVAYJM=; fh=nyUiyAsrvrmzhT78twm/HjZK3HoXiwGs/QcgTn/TSA0=; b=qmjBpua1w9Gpt5moHzlQVyQEnL1aTTRqXOU3Tvo9YPtWkn20vykfDBSblOuPVHeG2/ EWNw1nimQlQ6IzX0v4jG3kazmFzJpmUIVfJw779bBFtSagpcDDGSl5Bk6+o98kx9TW4n +jY3Q8gimy6BlUXudY2bOLXc+71cQeBj6e2gWIjMl1afOHrkKEnGuH2J190DsMaDQlzA h2DU0Q+9K2Vv5LgHPUfwh4sfXffUrfxZeEJGePjhM5UlyD0bQiSxzBOXgbt3mywEkQ8I 6AwifN+p0sYCQmBDVs7hDCFy4Lg6XuCZEe2P0jABoHB7i3fQDXFHC+vfqemUFBeOvCiZ Q0mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=GVKCBrVy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id gv12-20020a17090b11cc00b002749baa2edesi1226906pjb.24.2023.09.20.02.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 02:55:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=GVKCBrVy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 9C8D482B5143; Tue, 19 Sep 2023 22:03:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231979AbjITFDY (ORCPT + 99 others); Wed, 20 Sep 2023 01:03:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjITFDW (ORCPT ); Wed, 20 Sep 2023 01:03:22 -0400 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF9659F for ; Tue, 19 Sep 2023 22:03:16 -0700 (PDT) Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-32003aae100so297236f8f.0 for ; Tue, 19 Sep 2023 22:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695186193; x=1695790993; 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=c+3/wOOicjYC2xAjvdjrTiizxDM62+8wq1jD8pVAYJM=; b=GVKCBrVy2HKF/bepzP0e/OjjmI4zNnEwEJizGC9dZQYT1hNZReL6LKFO3fc0OdJtQ5 cMfA++en6RbNBtGqQwM9iVbxKmDXLNmxwMa+SHZ7Y78D1LMQMp5+Ky+fQ0FVSex2VCqr jEuh28Q7zr99fmUiATcyFgVYapcbuctgf5BELXbcCVAGwBYLHS/qZEu5QlHSUoz6Nypm RgfxEq1mp2G/XUTamd5HPuvAdjHEKC18hmLSlf9CHOiIWfHICDO7PeF9KgIAu16klBrl zU9A2v7QsiYYlVIb2+JpjVsJJD9qUCpm2BiZvQcESjyTGOwL07BmFadDWaKa7RA8YzE5 PQcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695186193; x=1695790993; 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=c+3/wOOicjYC2xAjvdjrTiizxDM62+8wq1jD8pVAYJM=; b=LJcxNGBb0+3NAr3YreK9E99RZUL56kBTDSLfWzQf/Y88Qx6DkMfZXRbNjwOUrMTbuf 671P3K8JEf4aKCNp/k3ta7NrpqhpK7t0ho8GFsTAEQFGcyqmuD8lLfWdKYVd3rRr/dJv 9rG897tfXfTvQd1RX6nsX66+UQR72c9Yx3Yp5lcMULMKPfrKikxIIxjAXgoBA0ilJote DGMJHjBFgE6hzSVxley5klQCam+YP9eSC3jhAIvyNLpFCw48I0egT6fZfCX91Dc1hl2J bM9pL1YJScVGvxAXHBF059RETwq6d7LlRxpaYpU4H8FiusV6gy56jqulHLcCVX9iuqjY 9x/w== X-Gm-Message-State: AOJu0Yw8VX9Q8WsNFH5lM2lwmCWPMuelm72a9bKctKxmF8KNjvc8mIDG VItB9GPIBiZjVOVP7Rna/AakzQ== X-Received: by 2002:adf:e6d1:0:b0:315:a235:8aa8 with SMTP id y17-20020adfe6d1000000b00315a2358aa8mr3313895wrm.2.1695186193391; Tue, 19 Sep 2023 22:03:13 -0700 (PDT) Received: from localhost (cst2-173-16.cust.vodafone.cz. [31.30.173.16]) by smtp.gmail.com with ESMTPSA id q24-20020a7bce98000000b003fbca942499sm834220wmj.14.2023.09.19.22.03.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 22:03:13 -0700 (PDT) Date: Wed, 20 Sep 2023 07:03:12 +0200 From: Andrew Jones To: Anup Patel Cc: Paolo Bonzini , Atish Patra , Shuah Khan , Palmer Dabbelt , Paul Walmsley , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: Re: [PATCH 1/4] RISC-V: KVM: Fix KVM_GET_REG_LIST API for ISA_EXT registers Message-ID: <20230920-6ef044ecc94ec729f2f6ca37@orel> References: <20230918180646.1398384-1-apatel@ventanamicro.com> <20230918180646.1398384-2-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230918180646.1398384-2-apatel@ventanamicro.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Tue, 19 Sep 2023 22:03:24 -0700 (PDT) On Mon, Sep 18, 2023 at 11:36:43PM +0530, Anup Patel wrote: > The ISA_EXT registers to enabled/disable ISA extensions for VCPU > are always available when underlying host has the corresponding > ISA extension. The copy_isa_ext_reg_indices() called by the > KVM_GET_REG_LIST API does not align with this expectation so > let's fix it. > > Fixes: 031f9efafc08 ("KVM: riscv: Add KVM_GET_REG_LIST API support") > Signed-off-by: Anup Patel > --- > arch/riscv/kvm/vcpu_onereg.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c > index 1b7e9fa265cb..e7e833ced91b 100644 > --- a/arch/riscv/kvm/vcpu_onereg.c > +++ b/arch/riscv/kvm/vcpu_onereg.c > @@ -842,7 +842,7 @@ static int copy_isa_ext_reg_indices(const struct kvm_vcpu *vcpu, > u64 reg = KVM_REG_RISCV | size | KVM_REG_RISCV_ISA_EXT | i; > > isa_ext = kvm_isa_ext_arr[i]; > - if (!__riscv_isa_extension_available(vcpu->arch.isa, isa_ext)) > + if (!__riscv_isa_extension_available(NULL, isa_ext)) > continue; > > if (uindices) { > -- > 2.34.1 > Reviewed-by: Andrew Jones