Message ID | 20231128145357.413321-13-apatel@ventanamicro.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:ce62:0:b0:403:3b70:6f57 with SMTP id o2csp4016764vqx; Tue, 28 Nov 2023 07:41:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJS5U5yQZweqEATYaUlj8GrMVZG1mt1evnYQ4bXH3MquSb/v+lnkkrm+L4Ndhskk/pD5Vz X-Received: by 2002:a05:6a20:2d0a:b0:188:1125:88bd with SMTP id g10-20020a056a202d0a00b00188112588bdmr24472329pzl.43.1701186085395; Tue, 28 Nov 2023 07:41:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701186085; cv=none; d=google.com; s=arc-20160816; b=PFSdWmh4epfeSennsAvZjFkQRlGNLy7J11dv9KwwqNLE3czjji1C28yLZRWVI631KP 7jyb8ZaIV5XJ9iE3oY9i6vYnJUjOuPhtnF/y3zTWo/tEVoq58gydnddfPZigBnuWGAAJ 3MHtFmxZvLNlSN7hgCE5sw8xJlEtFuNYTbJ5PNCpULZiUZf/Lm/mGUn8EsrwmG0K2J9+ 0/9+Db5tWm6HoVkuEgsHpkJgmeVIzRqq98HTRP+3DEdLriNFt+UGoCw3NeIWRWzga+Nx SiAxIARGhSYBcy8tqQ1S9JpsXPJ4jmm/YDA1YaniPnXXS9k+ayweDPtNBan5PPBRcQjo OSSA== 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=airu/v47wgDNqhAY8kBHQ9N6G4glvU45jZqVuvQoU4M=; fh=+jOfndtgkMGLet8rfMfGblttrnHjUS2P+rQOE/pONQo=; b=nabamm4g3a1YVV1ypFQjEaVTHHk/SiUNyl720zDI8LKk54NZMcy90Kqh5pbJRga7jJ RXdPNeIXuS0mcpj6vPQ1jSyeyA4atcyplOyNBEXl6rtgcROmG0Vh72Nj7yojWQ7BWqL2 k99V4OYhcJAg8OUGNpzTJw8B8aoXNSJeMXy1N+oyWR11WOf0NT50v+MlW3sgbLHmlf1E YiW1Z7gN8rLOVGvDoMll4cR0hsrQAMKHzbAdTutPQ2f3TGjkpY7vf+2At5tTXCAQExE5 naplUqyurzxgVZHot8UJQ0Ed0kY1wlUruPBbKnUvtqyKQC0iJHwdpCPYypMmuwti2KSV ppdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="BU3gv/si"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id em10-20020a17090b014a00b00285864ca8a0si10628027pjb.180.2023.11.28.07.41.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 07:41:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b="BU3gv/si"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id BEE118061C1A; Tue, 28 Nov 2023 07:41:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345919AbjK1PlD (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 10:41:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346532AbjK1Oz1 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 09:55:27 -0500 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 135911BF9 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 06:55:11 -0800 (PST) Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1cf98ffc257so41908565ad.3 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 06:55:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1701183311; x=1701788111; 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=airu/v47wgDNqhAY8kBHQ9N6G4glvU45jZqVuvQoU4M=; b=BU3gv/sik7JGzsYntxTVPetFJLPNqWByjFpBs7k/3HkOMFPlL50YQw5bXzkgkMs53c O4xC/3PNpTJaChDbOnDw/pQ/X6BhCVjD2dyvd11iorQi1LobCsRYcLqEcCSjK+n8Dutw C+OU0DN+Mkx6LC0N+tWvHmFSLKeoV4IC38oetWbGx7RrLE7/MoV6j4OCGNYZ4ZX7Hgxv tAuCIvhkIppqMhJ/Oir/bq58QuW3IJrC+Efq52iYfuJEVLrcHVHtVWONZGub/qYuBYG4 OIms+iC9YkWnv9ElVB1iXgxx4oAnTaMpgF7cl06YxNxegK8nozCKo+4pJmvCYSVq9DMc oSbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701183311; x=1701788111; 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=airu/v47wgDNqhAY8kBHQ9N6G4glvU45jZqVuvQoU4M=; b=g9PI0X+andomywwJrwRDqa/7IxXPpp1UM+/98uI6AmaRIRhCK3qOhvghbiCU7fxUrL lonT+A7RHmqF/L/DWgP0uSNXNR68+uDAe0z+9dihHDIWdb1CQ+gX1o7JN4zsFIsHvXNg vbjb7Wt9vnnP84OSYDSEx6sB47/EwuP8DY/w0HFkN/8sQkcMb79sWDsUUGeqmRuOcfP/ 0nfpwVauvEFJbYHP1X3ciN2SesgnizYqU11WCwwZoz9t92HwiXnvIVp+UgGePfui0Hu7 BV2lD0Zusqd9Plk6gjkkXyJpMmxxQEDHSxbMvaX1uWNupyfA/3wMSaFhjgeI8TxaEF1v XBgQ== X-Gm-Message-State: AOJu0YyLYlnacCyb9Xf2rA9WncbShW8So9pDaSlRKlKBLXxf81dHdZj6 wj3pWshicn2KU6PN79ZeBgeS5g== X-Received: by 2002:a17:902:e88f:b0:1cf:cf40:3cef with SMTP id w15-20020a170902e88f00b001cfcf403cefmr6689569plg.64.1701183311308; Tue, 28 Nov 2023 06:55:11 -0800 (PST) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id u11-20020a170902e80b00b001bf11cf2e21sm10281552plg.210.2023.11.28.06.55.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:55:10 -0800 (PST) From: Anup Patel <apatel@ventanamicro.com> To: Paolo Bonzini <pbonzini@redhat.com>, Atish Patra <atishp@atishpatra.org>, Palmer Dabbelt <palmer@dabbelt.com>, Paul Walmsley <paul.walmsley@sifive.com>, Shuah Khan <shuah@kernel.org> Cc: Anup Patel <anup@brainfault.org>, Andrew Jones <ajones@ventanamicro.com>, devicetree@vger.kernel.org, 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 12/15] RISC-V: KVM: Allow Zvfh[min] extensions for Guest/VM Date: Tue, 28 Nov 2023 20:23:54 +0530 Message-Id: <20231128145357.413321-13-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231128145357.413321-1-apatel@ventanamicro.com> References: <20231128145357.413321-1-apatel@ventanamicro.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Tue, 28 Nov 2023 07:41:18 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783822900947149091 X-GMAIL-MSGID: 1783822900947149091 |
Series |
KVM RISC-V report more ISA extensions through ONE_REG
|
|
Commit Message
Anup Patel
Nov. 28, 2023, 2:53 p.m. UTC
We extend the KVM ISA extension ONE_REG interface to allow KVM
user space to detect and enable Zvfh[min] extensions for Guest/VM.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
arch/riscv/include/uapi/asm/kvm.h | 2 ++
arch/riscv/kvm/vcpu_onereg.c | 4 ++++
2 files changed, 6 insertions(+)
Comments
On Tue, Nov 28, 2023 at 08:23:54PM +0530, Anup Patel wrote: > We extend the KVM ISA extension ONE_REG interface to allow KVM > user space to detect and enable Zvfh[min] extensions for Guest/VM. > > Signed-off-by: Anup Patel <apatel@ventanamicro.com> > --- > arch/riscv/include/uapi/asm/kvm.h | 2 ++ > arch/riscv/kvm/vcpu_onereg.c | 4 ++++ > 2 files changed, 6 insertions(+) > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h index 0ed5b0f8a230..32c7ff23ecce 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -163,6 +163,8 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZFH, KVM_RISCV_ISA_EXT_ZFHMIN, KVM_RISCV_ISA_EXT_ZIHINTNTL, + KVM_RISCV_ISA_EXT_ZVFH, + KVM_RISCV_ISA_EXT_ZVFHMIN, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index ba0a44b6b757..6b2d81c8cfe7 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -67,6 +67,8 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(ZKT), KVM_ISA_EXT_ARR(ZVBB), KVM_ISA_EXT_ARR(ZVBC), + KVM_ISA_EXT_ARR(ZVFH), + KVM_ISA_EXT_ARR(ZVFHMIN), KVM_ISA_EXT_ARR(ZVKB), KVM_ISA_EXT_ARR(ZVKG), KVM_ISA_EXT_ARR(ZVKNED), @@ -139,6 +141,8 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_ZKT: case KVM_RISCV_ISA_EXT_ZVBB: case KVM_RISCV_ISA_EXT_ZVBC: + case KVM_RISCV_ISA_EXT_ZVFH: + case KVM_RISCV_ISA_EXT_ZVFHMIN: case KVM_RISCV_ISA_EXT_ZVKB: case KVM_RISCV_ISA_EXT_ZVKG: case KVM_RISCV_ISA_EXT_ZVKNED: