Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp1717789rdb; Mon, 2 Oct 2023 20:53:10 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEc8xbDk0vNwB2YDN4YC2paeP0yhgJ/e+0ZGbp9boGHPWbbQVNtSk+4WbokoiocI/u3rcQ9 X-Received: by 2002:a17:902:bc8a:b0:1c3:ea2a:9058 with SMTP id bb10-20020a170902bc8a00b001c3ea2a9058mr10558475plb.65.1696305190178; Mon, 02 Oct 2023 20:53:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696305190; cv=none; d=google.com; s=arc-20160816; b=OG04xySC7RPjKA+0Jt9d7vshxRwkzFgo5I6PheYWrgsJqiGfAFvs94eMsY7FLVU5qn LE2bIjnAgeEBDsFL7pGWhJ74EuzH09dg7bU9AFWuc1SbXoA990H6kinQUpeAJJT/+whi VQWQDg9Pvw7xh/aO5zW/MpGUEhtYuNEGkTaDZgEk0vLzptpBRHL6SvTAGno63n1qq0AO BcMninQh+fvwt3zXvYwm3PZJ4hPvzYwDyJcRXgKoPYC4wjKocUioQJ2ToKojj5BvOM9Y 18RQO7VClNnlRnOAqXdvHl5pZmdwdhCwq5ugz/KjiyPB7eU6Em19qy+aARdJV13M2Q8G WR0g== 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=PR9YD+pr7hv0tmO2NOz2gpQmVbaE/cJ/IAsO/LYC7Pc=; fh=Nnw/Dw3prVIT5KLOVQO3DcS15zu3mo0yAEjXPL5Uo9Q=; b=aDdST15PuMNUmpZJzZbKRpN57taf8zWTMoDlQGPtkZ2LoWgxW/Q59EGUNdgyd03+eM 6A6dWzqp3QH2O1crS3gHCiQ6zF1/+s3N/xfZGxIrj0aZ8fwOYTSjDKWXqE3KwoYoD4d3 kU7RUjeiLNhFTrxx86I/+SZNsVxNyap2q2ZhWBq82Os7XfydGLBHnrdAxhiP6c3ncMY8 ArJ3pLaUnx8Gg1THpWIQvJYhUgns9TReCPCxIUnPT7Ve/UX2it4ok6a2VqnIGmZ2xqet QWWJGnm2bbMcUbqlN35nUrrwe0WY81vC6s6NffA+qaGgFiSbMCZiO7WIDCrAobGyX/89 ZAhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=XndW1qrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 21-20020a170902ee5500b001c3a6902ff1si467277plo.288.2023.10.02.20.53.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:53:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=XndW1qrh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 AAD64804C537; Mon, 2 Oct 2023 20:53:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239061AbjJCDxH (ORCPT + 99 others); Mon, 2 Oct 2023 23:53:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51438 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239033AbjJCDxF (ORCPT ); Mon, 2 Oct 2023 23:53:05 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55428DA for ; Mon, 2 Oct 2023 20:52:56 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1c736b00639so3340705ad.2 for ; Mon, 02 Oct 2023 20:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1696305175; x=1696909975; 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=PR9YD+pr7hv0tmO2NOz2gpQmVbaE/cJ/IAsO/LYC7Pc=; b=XndW1qrhTVSGZgMXpNzg31W8cUV7jQiFtUtpcG8iZmQmgibFRs4af+6llaF/WgscTR bhJU3jLvF+1MzNzf9MvoXDAIRAaGy0ZCx34pMBVh0fmoN+p+Xl7GxQ9CZDg69mXsglzz K4JAYafHcHA8Xr4efF83MALAK0eOgEy779VYsKIqwLwfjt8BK16vzHq1XcC01lXA/g3C sDHOQmdxdYvWocjiPuKgXiDg1n8544wAEOIxl6Lk1SN8oD39k5AdClp3DLMlW7lZZ/Wb bRVVBsobZ0hYOdI5ruv6WejKVSNrCpn90ar8weL6zY7dRQ6tEtoFMdm5VRtp9om0PEnh 29Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696305175; x=1696909975; 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=PR9YD+pr7hv0tmO2NOz2gpQmVbaE/cJ/IAsO/LYC7Pc=; b=La+fVpQJo2my7qMfG7b9tKh93xsEprJhHKm44qEYv51909NczTURw6/Z2Hy/tofkj0 gO8Kh+K0rIp9xWV7lkir6/NSmKnOeHjvmZJcPGKjva9+mks9el+jXraPxUCccJAmhQ3M zQUYscfrExWD1oM7rpAeKAse7mwjQuXuohCvUY5TojtNPHc/75MREnmx/AgOykjYLaXH 1T5XcIysRkI4w25EG20TuQI8u6FC50DnMUKhuiYnyggOFvtZYBzHEhgowKLC9w4h432O jU62iVWqleiV2g/0olbK0jepIIZfhpDlQoXwHD2JmK4bJPfKwY0qskDD2e4Lee0n7kcJ iyYQ== X-Gm-Message-State: AOJu0YwxpcybIx3obmVWQTW0OHNZqm1xesvAUuzFFvc7EZsW50ReFOkf faI94LUN5rX95v8Net9OxytSIQ== X-Received: by 2002:a17:903:244d:b0:1c3:2ee6:3802 with SMTP id l13-20020a170903244d00b001c32ee63802mr13278709pls.47.1696305175387; Mon, 02 Oct 2023 20:52:55 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([171.76.84.132]) by smtp.gmail.com with ESMTPSA id ja7-20020a170902efc700b001bf846dd2d0sm277381plb.13.2023.10.02.20.52.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Oct 2023 20:52:54 -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 v3 3/6] RISC-V: KVM: Allow Zicond extension for Guest/VM Date: Tue, 3 Oct 2023 09:22:23 +0530 Message-Id: <20231003035226.1945725-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231003035226.1945725-1-apatel@ventanamicro.com> References: <20231003035226.1945725-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_NONE, 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 lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 02 Oct 2023 20:53:08 -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 b1baf6f096a3..917d8cc2489e 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -138,6 +138,7 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZIFENCEI, KVM_RISCV_ISA_EXT_ZIHPM, KVM_RISCV_ISA_EXT_SMSTATEEN, + 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 388599fcf684..c6ebce6126b5 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -46,6 +46,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), @@ -93,6 +94,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