Message ID | 20230918180646.1398384-2-apatel@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:172:b0:3f2:4152:657d with SMTP id h50csp3070262vqi; Mon, 18 Sep 2023 18:43:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGgnO55Gmt4vhIhpP3bmECHkt74ROp/fwHJVyYqGoaIYi128lz0UU4Ub3kAdDPxPOhmmEjK X-Received: by 2002:a05:6808:1897:b0:3ab:5e9e:51ff with SMTP id bi23-20020a056808189700b003ab5e9e51ffmr12079715oib.33.1695087783923; Mon, 18 Sep 2023 18:43:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695087783; cv=none; d=google.com; s=arc-20160816; b=Od4x5zIjPACfGdM1I0W1Uq3x/G0S8dnRwZm8LXFbn/VpgIGOliNC0P1OXVUWf1oQ7N xWggqyifURmxRGwdibJv6Xn0W8stGtAfPQAAJahQoBFHyrTvQqqFVuhEYLegKIhi2tRa s19EC/62Vuy+FnpNngtEXQL4ZwQkTgqmTa4gZFobMybpgPx+lOV0cXQ2fygUYV2+kfO9 DdYV9Ow749IQFDAXgZ1yfWrZF9eTs5CvL4aVo9ZxnDcQ7Pb/v9kpI8BqyOlJ86oniSOV KpEOsG3JwTMS8d0L+2DTPIyoqE9UL1AUA5RGtOX/lIxaB0NJokUW7MSuj4f7cktGAzyi FWiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/FxLJCDRi2+AhF6FOTSx+aBMLtSpJjy7MQNwR3R94og=; fh=2S+54NKBCousR9yNCeiEbYlRCvnfU9LmKXxbaD6jKe8=; b=HECYpuKxH2mrQ4YkwL/X6FvTJvE+YtmuP4xxBZKkuE7LtwcuJPGeextO7WtPFS+tr/ Zbv5OMWxDu8ARtWmXQqijJQ3EXdLvP4QpL1Uk2cSVqbblXJe9SSVf++VuHpjn3amKVPo /dcJrs2ZY2noB+SBaWwFV2B9BhderZV5YPSIB3W5g6GCfslMZqRyCQ2pBHOfEe5RH6Gk vfMXIGxhy5CVHSFSOEObwF8yXKTBKJOLshOVajFOoB9pZR/dZSGw9/OEX8h9dlm3PA1M OGJObKxJaq3tishjljaKK95goZp1W1C0sMIHQdaibzs4EKhpZP/5Q3A97XdQkhh17gmD eF7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=EBj53UQw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id z11-20020a6553cb000000b005774bb908d0si8668211pgr.132.2023.09.18.18.43.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 18:43:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=EBj53UQw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id 8305F81444E5; Mon, 18 Sep 2023 11:07:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229842AbjIRSHL (ORCPT <rfc822;kernel.ruili@gmail.com> + 25 others); Mon, 18 Sep 2023 14:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229680AbjIRSHI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 14:07:08 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA866123 for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 11:07:01 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id d9443c01a7336-1c364fb8a4cso45197195ad.1 for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 11:07:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695060421; x=1695665221; 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=/FxLJCDRi2+AhF6FOTSx+aBMLtSpJjy7MQNwR3R94og=; b=EBj53UQwykWiQU8EeKXFnAZED+FFwvyq0XglEGPU04QSCReR2gRhAkrK27I2V+ERON lgRVORA2U19ayHSDeZj/m+w8N8SSwhsgwYuOJOMFxiq1TeUZgpTtZzLFFmmpiTlfB1SB i75nWmPSsLo9mEeh33LB0RfnoZzxfFA0w6M3Lsqq3YzFAvLKc1a41tj73YpjrLVgzcw4 qwpooow5ZexzXW3INHhQOOIQy+ywa3V2gxKPuajEMCzVOsB9A7IoNLZ+Ef9b+y6zMkfg JX2PI1NYgMnxvgZbIUfYFoBjxNZdBAQ7sADttLIlPdjcqRzK+eqU7Y50NKJmhthQ/4MV ADtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695060421; x=1695665221; 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=/FxLJCDRi2+AhF6FOTSx+aBMLtSpJjy7MQNwR3R94og=; b=BN//Dws9icrI/9Ol1PdyDa+Kil00Vp95fkyUWHbMyX+P59QSc5x4z2+DZdp+2nSKaY jyUA2FqCAejj99cyE9KGQzMz1e/FFUaa32Pd1MkMM/iqjEmLP/p0WoUaL7XpNvGBXXyK zsdPcdeN+3dnrzhs2cJsXpInlMYDsADrxph/6K76dMOP/Aab+R0U8RVfZnuI0abDtiM1 TeG2Hl0QuU17SnsvBTRllOnR4B1ITDlaklIoahWx+RY+5LMby6EflDC/BY3EmkveEQv9 bv8vgYSKVgsjRSRF58yKeILIE15kJckdI9ry/8wh7s1+FAcIS8RuHB2W3EnXoKzUm3xO Au2w== X-Gm-Message-State: AOJu0YxnACS2SJ5q1JB4XRl1CRDPDiI2hjj07zySNn2hvrj6jCuO/aJD Mv6DE7czhyfYlZR8Q2R1HKgfeA== X-Received: by 2002:a17:903:1247:b0:1c1:ecff:a637 with SMTP id u7-20020a170903124700b001c1ecffa637mr11725339plh.15.1695060421024; Mon, 18 Sep 2023 11:07:01 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id h7-20020a170902704700b001aaf2e8b1eesm8556720plt.248.2023.09.18.11.06.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 11:07:00 -0700 (PDT) From: Anup Patel <apatel@ventanamicro.com> To: Paolo Bonzini <pbonzini@redhat.com>, Atish Patra <atishp@atishpatra.org>, Shuah Khan <shuah@kernel.org> Cc: Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Andrew Jones <ajones@ventanamicro.com>, kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, Anup Patel <apatel@ventanamicro.com> Subject: [PATCH 1/4] RISC-V: KVM: Fix KVM_GET_REG_LIST API for ISA_EXT registers Date: Mon, 18 Sep 2023 23:36:43 +0530 Message-Id: <20230918180646.1398384-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230918180646.1398384-1-apatel@ventanamicro.com> References: <20230918180646.1398384-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 18 Sep 2023 11:07:20 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777428367848031331 X-GMAIL-MSGID: 1777428367848031331 |
Series |
KVM RISC-V fixes for ONE_REG interface
|
|
Commit Message
Anup Patel
Sept. 18, 2023, 6:06 p.m. UTC
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 <apatel@ventanamicro.com>
---
arch/riscv/kvm/vcpu_onereg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Sep 18, 2023 at 11:07 AM Anup Patel <apatel@ventanamicro.com> 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 <apatel@ventanamicro.com> > --- > 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: Atish Patra <atishp@rivosinc.com>
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 <apatel@ventanamicro.com> > --- > 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 <ajones@ventanamicro.com>
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) {