Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp536878rdh; Wed, 14 Feb 2024 04:40:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXiq86v/KY0V+H17Jxjs/0T/ohLW3gDPFX7jnCsov9phiWnRbVmKV5RR8JIYwO3k3MIKIIO8krfZLf+iA0fY4FO1xdtvAF5zKqqrVKfqQ== X-Google-Smtp-Source: AGHT+IHX/Nhk+X76JlRuoXq6kWGCAdSipYwgQYfLjvp/B6/rF3IyOhKMJTwwvljkcBd8iUt6/DBp X-Received: by 2002:a05:6214:c2f:b0:68c:96d3:a40a with SMTP id a15-20020a0562140c2f00b0068c96d3a40amr2602966qvd.17.1707914403862; Wed, 14 Feb 2024 04:40:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707914403; cv=pass; d=google.com; s=arc-20160816; b=HYygEWH81eiD5eXk04HAYaUdsuSSsIprqVYxZG5VCkxXzPCOlH9TlTzgeH/W7fs56J vqaPER9jtCcd4oPWFZ5ccA/8dU0jsrzNVpSLhKH3/ht836TwCHaDxc/Mdt+MVMzKcctd 6v2K1bTxWQzOLfG0cXB/O+9kce0/i/1HsstdE/5Nrok9FDgDFwD5NcwKlRTv928VqW5D jEcJTAnb9d84kDXWlPWdOUCFOGw3OfixwQiRaZt8jCmuVcPrXKR7iVjfcGruvzsRUzj3 CHzsAd9pxQTUj3f8Dw25kCROd0615lsyUbS9y/piihAdC2MYGgZdvOp8I2lm/pm78Ccw zzIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=hBSxSTn4SzFgJCLw2mwbPUiKLRcghcd12QFIpuWImtY=; fh=D5mq/EMK6kZVHDVvNdZDbik1Lwk4DqdcIojlz0qItXs=; b=YR1d9YppubN+bybK1iCSUTX4E5GWbwjQtSGBWp9p5vvk25NsqyTyDhm8QmJfY/dSBt +rPl9lK0WGWZOyK8cFvSwJkLdBQ3KcPezC/TpfSuICDpQcyBTj1WUMrTYNYWL0npOnog E3fN2eLycYaEYrK2+lyxdpOZNkOSaHKimDsCwP90HqvVYPTTR8LYUgOswx3X/vt/ppmB ArBxG3Hl6d7mbgNJd8O8+eqUwCVwFBCmGQu2cphSd+QYQiBqMD3TuIczKB2uvKY5Bif6 +LLIJQlzZ0EitWGkAJTf/iEuIDK+G7FOtzYugmTPKCYmV/UO0wEP2bdlXEIwS5sP0ajg InEQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=aBEmgJoR; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-65205-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65205-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCXZvJWlwVcahTqaP51bw7MGmtXgeRGvs5TbFdrITU2NCFNaKaxwFe070iP+6xOeh9fLX2+DMLBh0ovYPDZ+i2d/VxIPilznivQUudVP3w== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id hf5-20020a0562140e8500b0068cb008e834si5175765qvb.78.2024.02.14.04.40.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:40:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65205-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=aBEmgJoR; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-65205-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65205-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 9CE3A1C2116E for ; Wed, 14 Feb 2024 12:40:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6608B52F7A; Wed, 14 Feb 2024 12:38:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="aBEmgJoR" Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 44CA9537FC for ; Wed, 14 Feb 2024 12:38:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707914306; cv=none; b=pgVlSewg1b6gUOEkSvyV6vy/Byke1vw/l26NMswoaYURIa94cpDPRa2iAomXl5dVU/sWcpPmIH/T/LoS29Jn0TKW3EJBZTFHn9FSyQdUCXgiBdVEOdzr/M9PypKYo9ZiWv/YpX7zIMBd7hFyHP+pBSUWxmlq0eVN80Fyn0njre4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707914306; c=relaxed/simple; bh=cex5yCjawX5RILzSoRTQj5o40v+xzFY8ga4zlgODdvM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Npi4AMZEW5B5Atua3susKN0Fy+iLHcg4aBg/8ZMZvEWDzydaEjKg4jhY8D9HsfNHnpnDtRdQbX8ZLYFKeB6BoXco82/zo1sauwcBWhSPWs0EC/ReNk8wec1X5Y4YUjs5aToabC/zU/u9B/DCpeXSbyAZQRSAIDa8w1wSckCJLnQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=aBEmgJoR; arc=none smtp.client-ip=209.85.214.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1d7354ba334so45507215ad.1 for ; Wed, 14 Feb 2024 04:38:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1707914303; x=1708519103; 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=hBSxSTn4SzFgJCLw2mwbPUiKLRcghcd12QFIpuWImtY=; b=aBEmgJoRS6SLKU2l0Q9BAGWB0zodE2P2zJWD4EUST677LOW33zQ6GIrpbx9RhcpcRA lyTyr9/BVYDTyYzrv0ubbDb1GcnGUvR+eI00tWH/10eCf2gACaKkN4DHzCCSgKIEUj+y 7NOqgrBKYDbkJxTeJ9o0Z1ddv2yvfIw+ijCssM+MiGXSEq1tQREcicm0MNEt/jIb/tNo CGlXobf/hBob63n1Mw6HSaCvLY9Uo3/rFPd63rAA+4FdctCLiDLaaKdXdqxj8EMq43L3 EZp358EM/Uft6M0+DB+0bazDn41S0Kq7w/ko0VhjXxGvyzQlNdGyTazEsM+Zl2uB0nfI +Q7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707914303; x=1708519103; 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=hBSxSTn4SzFgJCLw2mwbPUiKLRcghcd12QFIpuWImtY=; b=Xq2ot1eobFMlWBjYF//zM22jRZnnv2+GgDiXsRAwDISXYk5IBNAcuuNFUXdKUZcOr5 G4OruEBnVsKbABVYIBawRDkUHMRHeSb1C9Qid8Zv15r12lw16ZVT5tGMiXNzLzSv3jSp uRrmYt1a3Q1tqtsUvp6P/RFH3uU1uiJVsnr476nX5re0qoJhRXtrtYxtWjZCThfReGyJ 1Oibiff9WW6KPUg/uYcUKTb0+4pnmJgRHEUr4yqAYYY7+5ELZfz/VYza/vux2P3zSdOI 8Nae6AIBqDaudHjXzESowz41jGTFq1sON/MrHkk0QgcQ7wR2iy/UE/gaNomlUuI2JSWW 0i3w== X-Forwarded-Encrypted: i=1; AJvYcCV3D2gznpmdj7SsWVY8pd13nyYvQozGJVOkTWZ44/1Zsfr7Icljy5To+eEIkIvfWWetcYt/XH6bkHFiD9Itx1+7D1B474JcSgKfMpdu X-Gm-Message-State: AOJu0YxaiDGbhXqhrju9esggPIYDgCnmoC8pBg4UqdiPk6LRwLIguzLO f8486etO5aDpR92aUTwgXKCeFsVGjnE6OhYk29jEoqu1JgkPZj5AIJXiLU231Q8= X-Received: by 2002:a17:903:32c5:b0:1d8:d5b0:aadb with SMTP id i5-20020a17090332c500b001d8d5b0aadbmr2210794plr.66.1707914303508; Wed, 14 Feb 2024 04:38:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCUoXP00E/iqkcjEmAUlBHrFJKYJoKL4q0+QeKcB6TPtbNEYX7VWrlUX2Uu4YkbXuRUJQslzZEHFfn4RRvKWNaoR1WGgwBvKaBbLuwi1AJnOnuRbkIMSuR7avQ1052diCkJpSrupZ3VKHRgEDuNPXtIbEhll4ygTcHqYxOA/MP4rJGThf+wtAPVi3AFCynE9gkIKexohY7Vd7k4vqbCkAHGmHho00ydthMQHcwzX88GbrObaKy1fPto4j+hoMuCbWMJrPdoFd6zCAhMaSq3mikn72w6/DpzwMNRrJHMsGUiBmghCZoY3PSJ0HRwHl/aGY9OJ1J0rJviin0rxG5PtBlecyMLe7mNfEE+tC7TTqPTFsxyL+evcZjOYIWg/SgZWHHLZB2lm5nnkEvTFrvx8F0KGw0C1erIDuDyRozFYxsy2oK+85SskFZaKJr2sRw== Received: from anup-ubuntu-vm.localdomain ([171.76.87.178]) by smtp.gmail.com with ESMTPSA id o20-20020a170902e29400b001d9b749d281sm3041419plc.53.2024.02.14.04.38.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:38:23 -0800 (PST) From: Anup Patel To: Paolo Bonzini , Atish Patra , Shuah Khan Cc: Palmer Dabbelt , Paul Walmsley , Andrew Jones , Anup Patel , 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 4/5] RISC-V: KVM: Allow Zacas extension for Guest/VM Date: Wed, 14 Feb 2024 18:07:56 +0530 Message-Id: <20240214123757.305347-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240214123757.305347-1-apatel@ventanamicro.com> References: <20240214123757.305347-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit We extend the KVM ISA extension ONE_REG interface to allow KVM user space to detect and enable Zacas extension for Guest/VM. Signed-off-by: Anup Patel --- 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 f8aa9f2ace95..37fb0f70b3e5 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -167,6 +167,7 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZVFHMIN, KVM_RISCV_ISA_EXT_ZFA, KVM_RISCV_ISA_EXT_ZTSO, + KVM_RISCV_ISA_EXT_ZACAS, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index 38f5cf286087..f4a6124d25c9 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -40,6 +40,7 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(SVINVAL), KVM_ISA_EXT_ARR(SVNAPOT), KVM_ISA_EXT_ARR(SVPBMT), + KVM_ISA_EXT_ARR(ZACAS), KVM_ISA_EXT_ARR(ZBA), KVM_ISA_EXT_ARR(ZBB), KVM_ISA_EXT_ARR(ZBC), @@ -118,6 +119,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_SSTC: case KVM_RISCV_ISA_EXT_SVINVAL: case KVM_RISCV_ISA_EXT_SVNAPOT: + case KVM_RISCV_ISA_EXT_ZACAS: case KVM_RISCV_ISA_EXT_ZBA: case KVM_RISCV_ISA_EXT_ZBB: case KVM_RISCV_ISA_EXT_ZBC: -- 2.34.1