Message ID | 20231128145357.413321-3-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 o2csp3978954vqx; Tue, 28 Nov 2023 06:54:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmWU6q+SdYL/axJeHu7X8R34hEfWG1h6JUe+iwcxQgCdNwM/oE7Kh34NcMcxiDaRzlKMje X-Received: by 2002:a05:6a20:a12b:b0:18c:f9f9:4198 with SMTP id q43-20020a056a20a12b00b0018cf9f94198mr510446pzk.14.1701183273401; Tue, 28 Nov 2023 06:54:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701183273; cv=none; d=google.com; s=arc-20160816; b=O0C+ACHtGJVk96kgZp9/2GDttXb0cWKvZs8B8Poo4JJ7mPCtdvtKS6chWjOixlAmdC TWmdPfYdqkwUsV5ENBA0ORFihiO68Q9jfUvZp7DrpSvqDeTsc96AMiItRKB5u+p77Tpu qOuqOZWGlQsOFDfzFlxe9pNdrFvYsU4SYfekJRH6yKXvWQ/nGapgivo1TJvo7A58DkAH 5M2qlOKo1ADgk6RdcKdU2MqFgjyGxnDHHfqE4HgFjB8g4DtqHx80tBKpXrCf1sMdqRsX 0QdhJk0+LkbYOGjRFKM1aB4TkglXm1TekiZlFqjlnyG7tPZvJk+/C/HdEx8EmWq+ejtp F0nA== 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=zWjJzXo4ydUM1qBdZFj/A/LBdPnzjXBTEeDQn9bxklc=; fh=+jOfndtgkMGLet8rfMfGblttrnHjUS2P+rQOE/pONQo=; b=k3AfgP/jUcJLsZ6f4Ekn1CctUQkwR0OzQVxB5cUhwtxt0iH4hOnFcHLiDXgbj8aZ2e Q340gCNDjmy8QDBLI9HOrnvae7AWAp84EnM/aL1xQx20gq39sVM4mqpRoNG7128GqMEZ d2mCohL+GijvpuViBuIF+NoA7NUU5B035jQtErPe4fl0ENe0P6r6kX8zVU+l4otQ0q6E glquR6YP3patf+2U9nZ6xlkDXL6bUmCutLZPgmR+hp6LxY46hOwvmgJCRetxrQuRTQuW pRouPYF87VxzaFNCSfKNWjLBh922tGCb1FSq5s+Vi9JZPXvJHd9aixks6sMVzG5x+woy 9reA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=SR+B9bwQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id v70-20020a638949000000b005891f742957si12232379pgd.570.2023.11.28.06.54.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:54:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=SR+B9bwQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 5467280B231A; Tue, 28 Nov 2023 06:54:32 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346429AbjK1OyS (ORCPT <rfc822;toshivichauhan@gmail.com> + 99 others); Tue, 28 Nov 2023 09:54:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345866AbjK1OyL (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 28 Nov 2023 09:54:11 -0500 Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7415C10CC for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 06:54:18 -0800 (PST) Received: by mail-pg1-x52f.google.com with SMTP id 41be03b00d2f7-5c1acc1fa98so4804301a12.0 for <linux-kernel@vger.kernel.org>; Tue, 28 Nov 2023 06:54:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1701183258; x=1701788058; 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=zWjJzXo4ydUM1qBdZFj/A/LBdPnzjXBTEeDQn9bxklc=; b=SR+B9bwQXi1BDIf/KEeufLybH3ombV18cVXRQqpJImYLpG8SpO+cdSbaVDIqnQ2z84 JLxtK+Wynfvo7HT3RPHaPeNVq1IGraDhjzk9PYH5I+QPmIjjeBz76mM0BLj3ZJEWGKMZ 5emkb6wQAPk1p0MEFurduanGw9AI6Pt8s+mBDGdd4PuJrkRLJj0LZEIGn1KBXftxHaB2 v0ZM5QIt/I8JhGLB5o/BGhfMGFBFzzyFJLRQotvpMz6FpTHlYUpE4P3k2Y8L9MtxOfu4 SzJzILJYi2fMEC4+nbRwzoKTHpLHu75c/QblP+axsASgrroErSlhMupJTxipK3jTpdpR dyaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701183258; x=1701788058; 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=zWjJzXo4ydUM1qBdZFj/A/LBdPnzjXBTEeDQn9bxklc=; b=SFwO5Bugw8n5v0nEen9S3v0Mf02bH4mP8k36quJc0tMD3j170L7gS09stBUInlLGcL YWStnvRLZXVF7SH6K1nNHf/QJLSirAOb0mWhMa97eHFqkIvekksWxEPrYCHb4MD09XUG AybTZQXbQJq0/4dxMWpzNU0iVBnYb/1pDl0/dh+uDGu4B8Hmh6lw0f6VtYqXr+WPh+dH 8YUhzYw1KukBcFFfdZrI4WYapnd6X9QxuQNDtaHq4rwV8i0Cxop/oiAQbRmWzpYyBDFE AgkbmafIW4ZafwqHB2l3UyiJh1vWODAN0qFHpupTr2Uj913PYCZ8qkKzWrzDcH0RaHkK iagw== X-Gm-Message-State: AOJu0YzdDUuWwB6vcK794eD8gZQS8ign04FsTsUPSt6sd8+I8ERwWKbr 27YmikeULL7m+8N1RjuFXrblKg== X-Received: by 2002:a17:90b:4b0e:b0:285:b687:b831 with SMTP id lx14-20020a17090b4b0e00b00285b687b831mr14391825pjb.10.1701183257699; Tue, 28 Nov 2023 06:54:17 -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.54.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 06:54:17 -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 02/15] RISC-V: KVM: Allow Zbc extension for Guest/VM Date: Tue, 28 Nov 2023 20:23:44 +0530 Message-Id: <20231128145357.413321-3-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=-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,T_SCC_BODY_TEXT_LINE autolearn=ham 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]); Tue, 28 Nov 2023 06:54:32 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1783819951650365060 X-GMAIL-MSGID: 1783819951650365060 |
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 Zbc extension for Guest/VM.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
---
arch/riscv/include/uapi/asm/kvm.h | 1 +
arch/riscv/kvm/vcpu_onereg.c | 2 ++
2 files changed, 3 insertions(+)
Comments
On Tue, Nov 28, 2023 at 08:23:44PM +0530, Anup Patel wrote: > We extend the KVM ISA extension ONE_REG interface to allow KVM > user space to detect and enable Zbc extension for Guest/VM. > > Signed-off-by: Anup Patel <apatel@ventanamicro.com> > --- > arch/riscv/include/uapi/asm/kvm.h | 1 + > arch/riscv/kvm/vcpu_onereg.c | 2 ++ > 2 files changed, 3 insertions(+) > > diff --git a/arch/riscv/include/uapi/asm/kvm.h b/arch/riscv/include/uapi/asm/kvm.h > index 60d3b21dead7..518b368b41e5 100644 > --- a/arch/riscv/include/uapi/asm/kvm.h > +++ b/arch/riscv/include/uapi/asm/kvm.h > @@ -139,6 +139,7 @@ enum KVM_RISCV_ISA_EXT_ID { > KVM_RISCV_ISA_EXT_ZIHPM, > KVM_RISCV_ISA_EXT_SMSTATEEN, > KVM_RISCV_ISA_EXT_ZICOND, > + KVM_RISCV_ISA_EXT_ZBC, > KVM_RISCV_ISA_EXT_MAX, > }; > > diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c > index f8c9fa0c03c5..f789517c9fae 100644 > --- a/arch/riscv/kvm/vcpu_onereg.c > +++ b/arch/riscv/kvm/vcpu_onereg.c > @@ -42,6 +42,7 @@ static const unsigned long kvm_isa_ext_arr[] = { > KVM_ISA_EXT_ARR(SVPBMT), > KVM_ISA_EXT_ARR(ZBA), > KVM_ISA_EXT_ARR(ZBB), > + KVM_ISA_EXT_ARR(ZBC), > KVM_ISA_EXT_ARR(ZBS), > KVM_ISA_EXT_ARR(ZICBOM), > KVM_ISA_EXT_ARR(ZICBOZ), > @@ -92,6 +93,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) > case KVM_RISCV_ISA_EXT_SVNAPOT: > case KVM_RISCV_ISA_EXT_ZBA: > case KVM_RISCV_ISA_EXT_ZBB: > + case KVM_RISCV_ISA_EXT_ZBC: > case KVM_RISCV_ISA_EXT_ZBS: > case KVM_RISCV_ISA_EXT_ZICNTR: > case KVM_RISCV_ISA_EXT_ZICOND: > -- > 2.34.1 > 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 60d3b21dead7..518b368b41e5 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -139,6 +139,7 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZIHPM, KVM_RISCV_ISA_EXT_SMSTATEEN, KVM_RISCV_ISA_EXT_ZICOND, + KVM_RISCV_ISA_EXT_ZBC, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index f8c9fa0c03c5..f789517c9fae 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -42,6 +42,7 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(SVPBMT), KVM_ISA_EXT_ARR(ZBA), KVM_ISA_EXT_ARR(ZBB), + KVM_ISA_EXT_ARR(ZBC), KVM_ISA_EXT_ARR(ZBS), KVM_ISA_EXT_ARR(ZICBOM), KVM_ISA_EXT_ARR(ZICBOZ), @@ -92,6 +93,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_SVNAPOT: case KVM_RISCV_ISA_EXT_ZBA: case KVM_RISCV_ISA_EXT_ZBB: + case KVM_RISCV_ISA_EXT_ZBC: case KVM_RISCV_ISA_EXT_ZBS: case KVM_RISCV_ISA_EXT_ZICNTR: case KVM_RISCV_ISA_EXT_ZICOND: