Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp541297rdh; Wed, 14 Feb 2024 04:49:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDsdB68sg/PsNPDeUuoAUoj7IqIyEs/3dOltNA1ON6BYrSWCJqvqsxv8UDRT9TG3EqQXhbKIZkd97+9f7CJpd9Mx0LUSVPBy+G0wepPg== X-Google-Smtp-Source: AGHT+IE3TUJJh8F2ysf7a8Pg9OQuxWKwR9BxqF+hfkAUk6vLSEnbm+g1LccmYKZHfdPl7JRqcvzI X-Received: by 2002:a05:6a00:26c9:b0:6e0:8718:eac2 with SMTP id p9-20020a056a0026c900b006e08718eac2mr1991224pfw.23.1707914964018; Wed, 14 Feb 2024 04:49:24 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707914964; cv=pass; d=google.com; s=arc-20160816; b=DR969iU6iiBgu4QgX8N3v4lkU0NJNGeNHxyALBnKiP6KdNGBoVQdrdYlTkIpusYMwp wrCYrfYGj/+oxy6bTdglnLBconqXeVkbDgnC3im06gm3YUw67gGqPbapLjnwH7WWQMqi IgNAi9pyJ3hyfxSyOm4HPbydqXbOfYAK5V5vxNr5C5K8vO2c2vTp5WDh4BpzbcQcNLZ/ RnPbGBCr5kIOwuYEqBIMcrO+Qg8Zyqk1I58A+3vKJNT2J44EaFy3twiTfmKC8MS3aOR8 DLdJUzu9bMGS4YXRmnC0aiV0sTqTVOLgNm/MqykIBJsUGHqcqI2KV3I6ropupWOHy0+q bcjw== 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=48Kvlzn+su9jY0Vm4vzOkE0bGPI59LwwBJsDVuHcE+Y=; fh=fRtjowlZW320UBuevDeLV9GkXgLCs3k2Erc/LH9TGN8=; b=KEjFBm0GHdkRZu5ZYe37H6BJeRFn2b9RdRmgeu3dQdfEcIeJF3L21gK+e1+IUyxqEo DVbCm93fViSVPLvMTtSTLaQSIYLM/0n4SZmVHGtWSGJTWrMbq95ySqMEURGc7t4ki/Bo qyv0ZE4lSKTYEQtGjDyakJOeLlmOkTfsjWPImmNr3cfMhkkdusQu35uKpnYOU5Q8PiKx lvYc51mWgtejWLE6lx9wfBaPlKOB2MAOniOdxkcOaBYgLDxyKOA+cBIT0hRFATbFXLOy MvG6y6ADQT/GlP9DpShtbEwMWgC7qgvRV8CAXali2CY32fxqGGgWIZ4m86cM/dwprEMh CFhg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Ge47c348; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-65202-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65202-linux.lists.archive=gmail.com@vger.kernel.org" X-Forwarded-Encrypted: i=2; AJvYcCVo3hm+kDuQG92cBRlCLsxPdcl7G0yY6OUQe2EQhsd6pIJK+BjmJ0OWdCBLZESfaU9PV4p4ixCiUjYDJQcWEKOZtPQBAk0qt1UoqFwxlA== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q5-20020a056a00084500b006e0f5ee407asi3241251pfk.79.2024.02.14.04.49.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:49:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65202-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@ventanamicro.com header.s=google header.b=Ge47c348; arc=pass (i=1 spf=pass spfdomain=ventanamicro.com dkim=pass dkdomain=ventanamicro.com); spf=pass (google.com: domain of linux-kernel+bounces-65202-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65202-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id D593BB230DA for ; Wed, 14 Feb 2024 12:39:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D6D35535B8; Wed, 14 Feb 2024 12:38:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="Ge47c348" Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 B2B5E5339C for ; Wed, 14 Feb 2024 12:38:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707914297; cv=none; b=rCX5pSq5UBzHbCqv8EfkGGjmXo6gCWlOSfp2Eckp6bZ/HYfTcOREHMmruUxHevDMf8yOs7o59Upvz2ZF6pUkRkxNTgWssT2tu17rwSP6F/J8jGeKMbXaOWhHFZRaMnWuzK7rm7G/+gPtJecEQ0p61Ek78/q24EMTmw77DhXP4ms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707914297; c=relaxed/simple; bh=6QZeD1AO6jaMPVgZLUW3lzdEd9llclpipK765KkoodM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=Vk1hNCEKoIMa8E5/XeUwFRv6y0LxZnWQHNDScr1xS3lsb9fawQbqDa0lFZFrson9S4giPNOAOTMdA2vUJKQ69cl4T6NVuCN6Dv9MjSOFV0yHD53n1VMTDblSznQpSjokUz1JSqGx3UtplgkdwRJhNjf5Ml7z2vqJuPUXbDRwK9U= 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=Ge47c348; arc=none smtp.client-ip=209.85.214.177 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-f177.google.com with SMTP id d9443c01a7336-1d95d67ff45so40396385ad.2 for ; Wed, 14 Feb 2024 04:38:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1707914295; x=1708519095; 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=48Kvlzn+su9jY0Vm4vzOkE0bGPI59LwwBJsDVuHcE+Y=; b=Ge47c348Q7koa2fKV8W2zDI3ujFKZRqRl284TAZkPedA/xhXiZUqpjlZrsyYPFyZaz KA/UG2KZRpK/GbcbD/5IDKjdVUL8X+heHv8iLjj7fol2FFOG+XFLBQgcgKdQPTgWBW2O wWlBocPBe7rIQdpmdYrb/vpvy5R1iGf8rhDaZh3B2ZIs0vYVN9eHsNQuXKvYqKqmh5pp IiE9xzOSTzei/JRCisGNpzdP74PKKxm8DdTKlXDhgTjecrb3aUPbZPz6MdDVFkHVoDvj 4e+ezJ5Tr0OQaOWr+JNeH4v2/rt0KtLC8D2xUPPVTSWIVbiAOPImuZGGfhpSFcMB7Jdf sqhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707914295; x=1708519095; 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=48Kvlzn+su9jY0Vm4vzOkE0bGPI59LwwBJsDVuHcE+Y=; b=TnRk88ya6e5KrPARTfRn1ueKcrGpuAPZbsFT8V2jiCTz4Y7aKwh7hPf2V/RQTAH31+ T+JuG+81MU9SIPyWbHAaB+D1ObEm8KcaECkMfP5RFqwzMki3GWjGbnvf4Afk8P1mIVkl nlCLHVQnkMa7T0GZu6m2wgYBMjlfgNWs/HbuZP90eb52AP3ggs3FnLaBd5pE7azDAmQr OwMQqe4XXOMY68DmOjXXUKYWMPQ2e8r2i4ypMtH+UUz+/1tzwcGVwAXMxJga+dSdIvaZ 8MsNBtiGKCbdfk1jzWz4Jc+qsl3GkztTWLhqQpjmHmgAFy1h+1ir7X1Vn67uhvNJAiXt b1pQ== X-Forwarded-Encrypted: i=1; AJvYcCUki6SRCasTGo0VHzFiWtdyJ0vt5wbdgJsbQUGZNXN7Cwn9/j2BsA1gu3yLLW/IA6OMTkT6Ivn1lh8U0nM2P7wwI3bn31C45KkbRnLv X-Gm-Message-State: AOJu0YxFj2enLSqmXtOIeZpQJsZpAJKgb/OKUTHNX8PCsb80vSca8vFE 6TfxUFGB68l6GTBwv0f7MEZf8JI5ic7dkQN9YGbJmCx9p0PjDud/WpMfkUr20Ug= X-Received: by 2002:a17:902:6945:b0:1da:1d3d:7937 with SMTP id k5-20020a170902694500b001da1d3d7937mr2048287plt.34.1707914294910; Wed, 14 Feb 2024 04:38:14 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCVki2Z3WrTpY40NRvm8tEbiYTni2BOP+Vz/m0jnkq1LJ5nIO+BXlYi1+YpL55P6nAAeZ70tS6rcQ9FXBc3LngUk1k5rap6lkZDxjXcts6p25eXLJDfrYH7vS9egyGB4UHfdtL/1enUDxsGQhB+OI80ygbonY7xSQ64wveTP7NsHYgjG5ApUhwmP3Rhzv+qeKdHkfrgeOQHom7tgaE6ui7DbZayXPXniP3TFPS5Uu7E2sjC02J19Jd+MMwctwL9ae1I2h7DIr9BCekEbCMx/1AiUv4xIM/eYG2FTJJPp/HKszsYT8lcYdkaCYxNlCgP7Pq60zX306awYmLYC4LXuI6hvQ/LWXp4r16jEs6NgAfdlLjGPeotzI52MIwUqO5jWp1uTmrPuRVKHejbViJrghAPCZryiembfyb62EeNV7B5Z1eWNyeJDtBjasn0tww== 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.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 04:38:14 -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 2/5] RISC-V: KVM: Allow Ztso extension for Guest/VM Date: Wed, 14 Feb 2024 18:07:54 +0530 Message-Id: <20240214123757.305347-3-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 Ztso 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 7499e88a947c..f8aa9f2ace95 100644 --- a/arch/riscv/include/uapi/asm/kvm.h +++ b/arch/riscv/include/uapi/asm/kvm.h @@ -166,6 +166,7 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZVFH, KVM_RISCV_ISA_EXT_ZVFHMIN, KVM_RISCV_ISA_EXT_ZFA, + KVM_RISCV_ISA_EXT_ZTSO, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/arch/riscv/kvm/vcpu_onereg.c b/arch/riscv/kvm/vcpu_onereg.c index 5f7355e96008..38f5cf286087 100644 --- a/arch/riscv/kvm/vcpu_onereg.c +++ b/arch/riscv/kvm/vcpu_onereg.c @@ -66,6 +66,7 @@ static const unsigned long kvm_isa_ext_arr[] = { KVM_ISA_EXT_ARR(ZKSED), KVM_ISA_EXT_ARR(ZKSH), KVM_ISA_EXT_ARR(ZKT), + KVM_ISA_EXT_ARR(ZTSO), KVM_ISA_EXT_ARR(ZVBB), KVM_ISA_EXT_ARR(ZVBC), KVM_ISA_EXT_ARR(ZVFH), @@ -141,6 +142,7 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext) case KVM_RISCV_ISA_EXT_ZKSED: case KVM_RISCV_ISA_EXT_ZKSH: case KVM_RISCV_ISA_EXT_ZKT: + case KVM_RISCV_ISA_EXT_ZTSO: case KVM_RISCV_ISA_EXT_ZVBB: case KVM_RISCV_ISA_EXT_ZVBC: case KVM_RISCV_ISA_EXT_ZVFH: -- 2.34.1