Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1346056rdh; Mon, 25 Sep 2023 09:50:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6QEiVWnXFhVOR7zOhUDCm8RVoa3DyK1WcL/OQWXtYflHcrfEV/XnR76PT3CFMsH3Grzb0 X-Received: by 2002:a05:6358:9143:b0:133:7c4:e752 with SMTP id r3-20020a056358914300b0013307c4e752mr8029416rwr.26.1695660632404; Mon, 25 Sep 2023 09:50:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695660632; cv=none; d=google.com; s=arc-20160816; b=oeRMnlRoT1t0CzupQF9afdM+lpwTfBOoTrTM1d/R92Rbms501Ysy4D1KyrH5qgYGA2 rEomyO/VRuwnMWoHJ6QRT2bVDlhyPEUwLh6+qtkhp49E9JfrtuXNSxbXT+zIUeHAuoIY CzSRWq7hYyIJYWC0i4uwnjqQpAMUvPE3+XWUCzujtOBwcSrwTQ01Ggl21ZGVbnva9Uox /LIb3CNBT+T6mlZicBG0Qne/fOW8kpfdNn2k+n4AVqV+UeZnXDpjwWWswJN7HbJfp4cb H7ITb+f6UfL5BfBs8QvqecL2o1yPJf+WJ435jPWMoA5eNuiaaFrCHeGcIBwI9XHYBpZf CxWA== 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=aiGfuZzpdgt2mtsTil9OGkblf0k2xd+WLhVWfEwORCk=; fh=Nnw/Dw3prVIT5KLOVQO3DcS15zu3mo0yAEjXPL5Uo9Q=; b=p3bkOLqk+QUA5+xXjEzWFHPzmDDDPCDsnMyHb62TPYqDh3rICA4NVdd2LMyuz1QjRj D3H11PRfaeP1cLOBm8s17n9ENk6puX6og1xlElhosQxdUC2UeI+kO7JzpNCuddgBXaIE qUHk4iLMgeB/frWUidMUlgikwZQSXNDynHxL/86xylKL/I/2bVRc2riKZHnUPQohCPmW jObyMocZ7gEVyPBxiTIVaA+Y9GK6eqxV82mlnh3WqWiku1iH8biwfHBPDqh3Ue5DcnB3 DUgdh7Rf88NhgR4faLXmqrmLL41PbF0Z99RHEKc9lr/5m+Y9qBoBAy6ccx6Cm/LGwEJc dK2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Mtu8skHn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b9-20020a63d809000000b0057c29fec784si9782352pgh.110.2023.09.25.09.50.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 09:50:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Mtu8skHn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 903CC807614D; Mon, 25 Sep 2023 06:40:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231967AbjIYNkL (ORCPT + 99 others); Mon, 25 Sep 2023 09:40:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232130AbjIYNkF (ORCPT ); Mon, 25 Sep 2023 09:40:05 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1828199 for ; Mon, 25 Sep 2023 06:39:53 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1c4194f769fso44152315ad.3 for ; Mon, 25 Sep 2023 06:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1695649193; x=1696253993; 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=aiGfuZzpdgt2mtsTil9OGkblf0k2xd+WLhVWfEwORCk=; b=Mtu8skHnKMZ1tDeS8xWQ+k9fraQqEy15mdC4zQ0Me5H0qxj7R501Jk2vzha461+grv ILXGp1b3QGaI6oEAngel0mv79laEExmctmmY9C6SJU3LSIk3MXv7PvBiGyucD49PFPyC eMUQBgN0XoYp1oAc4OfTsvNX7OLvvJ3DNPgRgy+2nZ7UG2/s3bsK21G8CMwZ32U2nkTC LkVs0KGwdibQFB/k6uFrPr8IHK9G3i32+SEkOcU1d5/a6l2XVW4YpkJTvvMMSIJM4aOT UpjPO9EhtROsZD7eaM21Xmsv88kmCYkVWRzrXvnowBo3XabRKldn/isyE/lIZ6fu6zFm 3IuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695649193; x=1696253993; 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=aiGfuZzpdgt2mtsTil9OGkblf0k2xd+WLhVWfEwORCk=; b=XLrZ8ddoWog1lABEbRlYwf0gX0okvW9hO/8HU/fPEvegO2yhgPUa3Op0Uamo9eH6FG LPEULwsKplqnRkLcZGBXLBGcAW2UIRawVQTctNbLxu220SEO5ay+JNapRtEL82k9yy9c hjIp1f0S5nPfpgzTxBo8MWMuUu6q/5yJ3OPwcTy9d9B0zDlAIMH2ecIwIs1blnO0nZnx /SiOWW+NtIqDIH7EJ95HEMlYwjax5i2/JTIHKEZQFkKA1mC+USTsfxbnQrrI1fXElM7L NPj6M5WACW3MTLWE8ceTqHrT0rhlMFhkiMplu4x/MJDzk0KJQN6vokSj1OihawnjfDax iKTA== X-Gm-Message-State: AOJu0Yxe5z/FU7xj67NYDhqlGWCt/E/KFOjuMKN0pUbwnncqxve/fISj ezMaOuE1LIjp9rRzAYFiCmhMCg== X-Received: by 2002:a17:903:24c:b0:1bf:6ad7:2286 with SMTP id j12-20020a170903024c00b001bf6ad72286mr6241708plh.43.1695649193249; Mon, 25 Sep 2023 06:39:53 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id p11-20020a170902eacb00b001c625d6ffccsm969433pld.129.2023.09.25.06.39.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 06:39:52 -0700 (PDT) From: Anup Patel To: Paolo Bonzini , Atish Patra , Palmer Dabbelt , Paul Walmsley , Conor Dooley , Rob Herring , Krzysztof Kozlowski , Shuah Khan Cc: Andrew Jones , Mayuresh Chitale , 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 Subject: [PATCH v2 6/9] RISC-V: KVM: Allow Zicond extension for Guest/VM Date: Mon, 25 Sep 2023 19:08:56 +0530 Message-Id: <20230925133859.1735879-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230925133859.1735879-1-apatel@ventanamicro.com> References: <20230925133859.1735879-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 autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 25 Sep 2023 06:40:21 -0700 (PDT) We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zicond extension for Guest/VM. Signed-off-by: Anup Patel Reviewed-by: Andrew Jones --- 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 e030c12c7dfc..35ceb38a4eff 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_XVENTANACONDOPS, + KVM_RISCV_ISA_EXT_ZICOND, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index 17a847a1114b..d3ca4969c985 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -47,6 +47,7 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(ZICBOM), KVM_ISA_EXT_ARR(ZICBOZ), KVM_ISA_EXT_ARR(ZICNTR), + KVM_ISA_EXT_ARR(ZICOND), KVM_ISA_EXT_ARR(ZICSR), KVM_ISA_EXT_ARR(ZIFENCEI), KVM_ISA_EXT_ARR(ZIHINTPAUSE), @@ -95,6 +96,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_ZBB: case KVM_RISCV_ISA_EXT_ZBS: case KVM_RISCV_ISA_EXT_ZICNTR: + case KVM_RISCV_ISA_EXT_ZICOND: case KVM_RISCV_ISA_EXT_ZICSR: case KVM_RISCV_ISA_EXT_ZIFENCEI: case KVM_RISCV_ISA_EXT_ZIHINTPAUSE: -- 2.34.1