Message ID | 20230919035343.1399389-1-apatel@ventanamicro.com |
---|---|
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 h50csp3113654vqi; Mon, 18 Sep 2023 20:54:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyhavyvkl5CZiq5LT57fUe0V+2OlWy98iSMGq59zyXNw6gvdiFvR4A65ntv+2YH6mMIxNo X-Received: by 2002:a05:620a:4712:b0:76d:268b:9741 with SMTP id bs18-20020a05620a471200b0076d268b9741mr12062791qkb.17.1695095655724; Mon, 18 Sep 2023 20:54:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695095655; cv=none; d=google.com; s=arc-20160816; b=PhSZOvnVX5h13aJc0QWsAkUCa+iXk7XkF+eOEsk1Z1YyMtvnZ6v7IyL3BbQoSGcJJI EhrV1tiCGaOAdsCCEu4rPMX6YQIxLCkVBKbjg+U/R9YerjLj8hMORgPHdqR6AtHea5Qw e36Mtc3e3Q8XIakDphOoLEzp2+WqTyjxGBir+6VwwLjCmVhXtQbnBzL4KHDHm0ECtHM7 OcS8eHXrMqdri5s55sMNhtVIhCLA8qfn03eMhFOkl95+7Ad6njtooRJExoBSsxApul7I ozdbqpLFUvcERzPcdjh1+QIHCQI9qvLbSAx7WJvaYFpn1QNkewKTsmVpy4Xo0h81v2+x 4xBA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Rvg3SR+EIFOsYy/qoodlQ+dG3JVvlqb84MODfhL50Kc=; fh=Nnw/Dw3prVIT5KLOVQO3DcS15zu3mo0yAEjXPL5Uo9Q=; b=p9IxsWsF9nmAxdmb3h0G433wqcWdPZ5Sp5yJ+c6MHQOVK+2S5MFj3N+nojd3BkVEfS 1nxW0QklII2UbGRRyoWLXk27a4IkVhTcCKVOrrGajyTRF15Yh7M+RoLkvUsQz0twIBYY kJ1HWWbauW6XNnW9b95M27y+RQyZ8pi0rJmts/qsbOi0g62WYX0T+Fw13s1fl0jBmpNV rNkdFLd9u7MWWIXb6a6FKP3y/MY6ikeD1RPpimx/39qG59jG/J2T9xsmWiIn61Ul6Gdx a1CcqRxwmleEEQpTomOuEz3wIzI+ZBxH8FJpTNDaD2ZQvl2DBe+VeTeFQSq7/PKxVadT jkgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=JbPJU5nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id 13-20020a63010d000000b0056c297d1644si8681255pgb.510.2023.09.18.20.54.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 20:54:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=JbPJU5nn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id 71406811EDB6; Mon, 18 Sep 2023 20:54:12 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231384AbjISDyD (ORCPT <rfc822;toshivichauhan@gmail.com> + 26 others); Mon, 18 Sep 2023 23:54:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231190AbjISDyB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 18 Sep 2023 23:54:01 -0400 Received: from mail-oi1-x229.google.com (mail-oi1-x229.google.com [IPv6:2607:f8b0:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 41C62FD for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 20:53:56 -0700 (PDT) Received: by mail-oi1-x229.google.com with SMTP id 5614622812f47-3ab3aceaf2aso3643938b6e.2 for <linux-kernel@vger.kernel.org>; Mon, 18 Sep 2023 20:53:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695095635; x=1695700435; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Rvg3SR+EIFOsYy/qoodlQ+dG3JVvlqb84MODfhL50Kc=; b=JbPJU5nnSbZaYZRt/oSridjA3Sc5nGiFWsmhl2f4b9Scu0J0+1j+n46ahtGANrMbf9 3430+ft1eqOnzQdd5Y016/Co+b35IwhN9oyoxmw6Uy8y/EEH+vnxFWBwRk3fL+QkXxCS OAFpeE83shtFUk6E2B8Mz2dji+brCY8PUJBEtCtrxZbUnoJUh1eqe6Js7w1gB7+M6S/A RL4knlAjhS4knF40tpkS+AMYTw4nZL51u/JoHGFfhid3JSrvTlV+7OCNACimSRs1f278 jl/fsewlsqJ6Rf4591gOqOSwmAh4ce2ZtGSdqReZomoft1xZJ7GG/FIG8ConRuL2VLKe ipbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695095635; x=1695700435; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Rvg3SR+EIFOsYy/qoodlQ+dG3JVvlqb84MODfhL50Kc=; b=mTyB9x+lu/4FKCZwGhRx8RaS42bXRifsuetPdLcn7BHfI2LdjUVpqI+XaIXhbsoTj7 wmHeJ8pDTPRoMz+mqIvOcXMgEUNWR6nXqx5Q7fUFf60zoSzwIoyG8y1zNRHoDqBYuxI/ RDn8its7Vcbz9yVliUxg3q75o9Q3zAhDmpUaWofI8R/jDbBHBK8XI8fh9RAF/ddFw/OR /RfeRSyy1CzUy30rs03JnDOh07TH2Murw7dOjOmCqWL+xzaIehMOrusp+1ikJvkFtRWa 8xjvY67lHBtMjuPAfajclYXXiUQGAQxkaX1QBlgh42fgj0PeOzpPmqlOf2S/6oJjyxZ1 qrvA== X-Gm-Message-State: AOJu0YxLzU170lfAfn7rO7yw2iq8wxjIi3KntjcTxebbNL7afXHL85uU Jr2v9pe5vK396KnFOr335Oyeyg== X-Received: by 2002:a05:6808:b0c:b0:3a9:c25d:176a with SMTP id s12-20020a0568080b0c00b003a9c25d176amr12387561oij.36.1695095635453; Mon, 18 Sep 2023 20:53:55 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id 3-20020a17090a034300b00273fc850342sm4000802pjf.20.2023.09.18.20.53.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 20:53:54 -0700 (PDT) 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>, Conor Dooley <conor@kernel.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Shuah Khan <shuah@kernel.org> Cc: Andrew Jones <ajones@ventanamicro.com>, Mayuresh Chitale <mchitale@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 0/7] KVM RISC-V Conditional Operations Date: Tue, 19 Sep 2023 09:23:36 +0530 Message-Id: <20230919035343.1399389-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Mon, 18 Sep 2023 20:54:12 -0700 (PDT) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1777436622118972233 X-GMAIL-MSGID: 1777436622118972233 |
Series |
KVM RISC-V Conditional Operations
|
|
Message
Anup Patel
Sept. 19, 2023, 3:53 a.m. UTC
This series extends KVM RISC-V to allow Guest/VM discover and use conditional operations related ISA extensions (namely XVentanaCondOps and Zicond). To try these patches, use KVMTOOL from riscv_zbx_zicntr_smstateen_condops_v1 branch at: https://github.com/avpatel/kvmtool.git These patches are based upon the latest riscv_kvm_queue and can also be found in the riscv_kvm_condops_v1 branch at: https://github.com/avpatel/linux.git Anup Patel (7): RISC-V: Detect XVentanaCondOps from ISA string RISC-V: Detect Zicond from ISA string RISC-V: KVM: Allow XVentanaCondOps extension for Guest/VM RISC-V: KVM: Allow Zicond extension for Guest/VM KVM: riscv: selftests: Add senvcfg register to get-reg-list test KVM: riscv: selftests: Add smstateen registers to get-reg-list test KVM: riscv: selftests: Add condops extensions to get-reg-list test .../devicetree/bindings/riscv/extensions.yaml | 13 ++++++ arch/riscv/include/asm/hwcap.h | 2 + arch/riscv/include/uapi/asm/kvm.h | 2 + arch/riscv/kernel/cpufeature.c | 2 + arch/riscv/kvm/vcpu_onereg.c | 4 ++ .../selftests/kvm/riscv/get-reg-list.c | 41 +++++++++++++++++++ 6 files changed, 64 insertions(+)
Comments
On Tue, Sep 19, 2023 at 09:23:38AM +0530, Anup Patel wrote: > The RISC-V integer conditional (Zicond) operation extension defines > standard conditional arithmetic and conditional-select/move operations > which are inspired from the XVentanaCondOps extension. In fact, QEMU > RISC-V also has support for emulating Zicond extension. > > Let us detect Zicond extension from ISA string available through > DT or ACPI. > > Signed-off-by: Anup Patel <apatel@ventanamicro.com> Same applies here w.r.t. splitting in two. Thanks, Conor. > --- > Documentation/devicetree/bindings/riscv/extensions.yaml | 6 ++++++ > arch/riscv/include/asm/hwcap.h | 1 + > arch/riscv/kernel/cpufeature.c | 1 + > 3 files changed, 8 insertions(+) > > diff --git a/Documentation/devicetree/bindings/riscv/extensions.yaml b/Documentation/devicetree/bindings/riscv/extensions.yaml > index cad8ef68eca7..7ea90e2dbc5b 100644 > --- a/Documentation/devicetree/bindings/riscv/extensions.yaml > +++ b/Documentation/devicetree/bindings/riscv/extensions.yaml > @@ -225,6 +225,12 @@ properties: > ratified in the 20191213 version of the unprivileged ISA > specification. > > + - const: zicond > + description: > + The standard Zicond extension for conditional arithmetic and > + conditional-select/move operations as ratified in commit 8fb6694 > + ("Update Gemfile") of riscv-zicond. > + > - const: zicsr > description: | > The standard Zicsr extension for control and status register > diff --git a/arch/riscv/include/asm/hwcap.h b/arch/riscv/include/asm/hwcap.h > index b7efe9e2fa89..15bafc02ffd4 100644 > --- a/arch/riscv/include/asm/hwcap.h > +++ b/arch/riscv/include/asm/hwcap.h > @@ -60,6 +60,7 @@ > #define RISCV_ISA_EXT_ZIHPM 42 > #define RISCV_ISA_EXT_SMSTATEEN 43 > #define RISCV_ISA_EXT_XVENTANACONDOPS 44 > +#define RISCV_ISA_EXT_ZICOND 45 > > #define RISCV_ISA_EXT_MAX 64 > > diff --git a/arch/riscv/kernel/cpufeature.c b/arch/riscv/kernel/cpufeature.c > index 3a31d34fe709..49b6551f3347 100644 > --- a/arch/riscv/kernel/cpufeature.c > +++ b/arch/riscv/kernel/cpufeature.c > @@ -174,6 +174,7 @@ const struct riscv_isa_ext_data riscv_isa_ext[] = { > __RISCV_ISA_EXT_DATA(zba, RISCV_ISA_EXT_ZBA), > __RISCV_ISA_EXT_DATA(zbb, RISCV_ISA_EXT_ZBB), > __RISCV_ISA_EXT_DATA(zbs, RISCV_ISA_EXT_ZBS), > + __RISCV_ISA_EXT_DATA(zicond, RISCV_ISA_EXT_ZICOND), > __RISCV_ISA_EXT_DATA(smaia, RISCV_ISA_EXT_SMAIA), > __RISCV_ISA_EXT_DATA(smstateen, RISCV_ISA_EXT_SMSTATEEN), > __RISCV_ISA_EXT_DATA(ssaia, RISCV_ISA_EXT_SSAIA), > -- > 2.34.1 >