From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C99D1C46CA1 for ; Mon, 18 Sep 2023 18:07:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229803AbjIRSHL (ORCPT ); Mon, 18 Sep 2023 14:07:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229614AbjIRSHI (ORCPT ); Mon, 18 Sep 2023 14:07:08 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1324122 for ; Mon, 18 Sep 2023 11:07:01 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c39a4f14bcso45023175ad.3 for ; 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=TUdGAbA4+uQe3zd1zSJFmNB1w+tuKs9hDzx6hvGP3WyRjCei+INHswNyh+go70uIjb oMwCFQDns1+l8haqQcj3Y9txYSsv35pj5p6B6r0akmePw5WyKkDsnNrZNysMgtALmjFW B8UUZIsvJIKBe8nT/6QDaGBfxV0ugYgMFTv+YH1cs5zQG/bt2XLdpqyYeC2mHnTl24ka Fhu6Eb/rIF5zRnFRI+MN9K2aCWSVDYf4P2LJqqVpjZDCZ7Lbn4YDBVME9IlG2AhhbHlg pNjAjjPRrB9Fcc5wVNpW6AtZDai4wmPCCkpdNlfBfOUd5Z0hp4KSixaWGtgoFuNt9plV 8dNw== X-Gm-Message-State: AOJu0YzPRhkr/4w1xMgp4Ccyt+ViI4d1/ZoMYvBT27ibEpx5+4E6Bzc/ MWejwccQG0HGTFDsnPz2YHwENA== X-Google-Smtp-Source: AGHT+IFDMbQdNhGOLSD6ilndqDb8cXhJ+CzNk5FP+g+eBNqALQDifdWhN3LJ8Nfabjtn2qCQLRxJug== 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 To: Paolo Bonzini , Atish Patra , Shuah Khan Cc: Palmer Dabbelt , Paul Walmsley , Andrew Jones , 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 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 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 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