From patchwork Sat Aug 31 11:27:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786068 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 8B5DB33EA for ; Sat, 31 Aug 2024 11:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.176 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103685; cv=none; b=Ve0wDthODPXxuKqB73gbfF6VSrBpJ560FwrxsSyVqMyCyulvo2/M6ip/jTiI3lBxSyFxfo6DhQrlIAf5uC+DwbRQDbrjoUNGfIQG2fSFFe4YskLtKKx0/WTFV6VgUzwHgtfXyKi/aIvVJjst1tidQbXvww8zrbDAmPfcjmQt6Fo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103685; c=relaxed/simple; bh=XAZpLjGaTatCjl0h+K/byOYY8HXw2mFJT3zVZZIUn2g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NtYu4XxJpEQTZXIYYtekU6b8GomO7ShOeZ6CTI9+PC8zc0FezhaxAwT9ppDcGvEJT06oYurm+ugnE5a5xi6t3Db6HDpzuioUbiDWe4XdyS0m2ZvnSjSpK8e1xWmsBlmtPq2uMMRy9Nc9RdEz+76uRVm3uKMQD/xCA+2pLUCiJX0= 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=GprDlzUq; arc=none smtp.client-ip=209.85.214.176 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="GprDlzUq" Received: by mail-pl1-f176.google.com with SMTP id d9443c01a7336-201fba05363so22372505ad.3 for ; Sat, 31 Aug 2024 04:28:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103683; x=1725708483; 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=/BXM/UjcLm0O8HfweJKHKopg0DzPpx/VDjUX4pXUr5s=; b=GprDlzUqG8jaFD+bvFKczVgh7mPfXRdVz4tCw7ZXZRzAH16zlnS8LG328RKo6OOwfB 78vS9CPDu3dIRevjpPJsQJDPoaP5sfId2u+OJL2+wnppqSmd14euH0aLMYDQxvZh16nx JFuJQw7oEQiPHQeQdcH6lmxr+mCmCyoKTNZZQe/kuipMoNK34tJAm7DM2Gp/QbNHCRnL s9wh2uhfGLOudLZRl06omHPMP/V8vpEfaNiSOslw9XnXerYDO65Rida1LXFRvMJRjWts u/WVNv7Pw9w5EWZkKlfy4MXgSfNWdZde11HGUnlxOZxyA5sdNeDcBMWUWe5Kx+RJ6+Qv IEKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103683; x=1725708483; 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=/BXM/UjcLm0O8HfweJKHKopg0DzPpx/VDjUX4pXUr5s=; b=avSDHp5P43KYFRk+MiZwlVELV/VqgJwOs7lclAORcKrNCegHSzNUkThhNQg1YZZhji BON9sT/3arhAyy7mGjBzHC7cVXoGuyBRhG/FvC59Nfxc+n8DmavuFkZvCJggBzEgqCoX eUdVTuDz5KH3NuT4d1bEeKrEPm4DJ569IiXIzBOdbhx/USA48vbOs5zchzX2xIx5/rJg SQRbBEf6Qpsak9iysGOJP0u3Tgjg6xVhZpYpPeNHw9hKE6zV988bALEn+Yg92QZG5l9i 42jzSxnsHoFQ/qc4l4+gCbSWEL+Uhxu+Brs8mYE+HUa1p+0e36vO6Dz6Ioa8ZIw+ZiDQ B6sg== X-Forwarded-Encrypted: i=1; AJvYcCXhQni1zt0poQFojcsdmE7t4ZFjftd2GjVFC6YMOMimzvOuZ05aNFyQtVNW35DJeImTSQo=@vger.kernel.org X-Gm-Message-State: AOJu0YxoRudjnvdw6nVRGYXmi9AQcBWpLcubacXq4SlQMC5jkl9ff532 COhuq+/PoYPmQTL8KxSnQljBG4pHFirswrVyI9y3SpNyxkybsODjNab1ICK5dYM= X-Google-Smtp-Source: AGHT+IEQIeW8TsJRj3YdPcy+zVYnpU6q86s+Ay93nPwfWubG0G4A/nhUXxKmJgbl2LeoLHyQsp6O+w== X-Received: by 2002:a17:902:d2c2:b0:1fd:67c2:f97f with SMTP id d9443c01a7336-20544514f71mr23150075ad.28.1725103682450; Sat, 31 Aug 2024 04:28:02 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.27.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:02 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 1/8] Sync-up headers with Linux-6.11-rc4 kernel Date: Sat, 31 Aug 2024 16:57:36 +0530 Message-ID: <20240831112743.379709-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 We sync-up Linux headers to get latest KVM RISC-V headers having Zawrs support. Signed-off-by: Anup Patel Anup Patel --- include/linux/kvm.h | 27 ++++++++++++++++++++- powerpc/include/asm/kvm.h | 3 +++ riscv/include/asm/kvm.h | 7 ++++++ x86/include/asm/kvm.h | 49 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 85 insertions(+), 1 deletion(-) diff --git a/include/linux/kvm.h b/include/linux/kvm.h index d03842a..637efc0 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -192,11 +192,24 @@ struct kvm_xen_exit { /* Flags that describe what fields in emulation_failure hold valid data. */ #define KVM_INTERNAL_ERROR_EMULATION_FLAG_INSTRUCTION_BYTES (1ULL << 0) +/* + * struct kvm_run can be modified by userspace at any time, so KVM must be + * careful to avoid TOCTOU bugs. In order to protect KVM, HINT_UNSAFE_IN_KVM() + * renames fields in struct kvm_run from to __unsafe when + * compiled into the kernel, ensuring that any use within KVM is obvious and + * gets extra scrutiny. + */ +#ifdef __KERNEL__ +#define HINT_UNSAFE_IN_KVM(_symbol) _symbol##__unsafe +#else +#define HINT_UNSAFE_IN_KVM(_symbol) _symbol +#endif + /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ struct kvm_run { /* in */ __u8 request_interrupt_window; - __u8 immediate_exit; + __u8 HINT_UNSAFE_IN_KVM(immediate_exit); __u8 padding1[6]; /* out */ @@ -917,6 +930,9 @@ struct kvm_enable_cap { #define KVM_CAP_MEMORY_ATTRIBUTES 233 #define KVM_CAP_GUEST_MEMFD 234 #define KVM_CAP_VM_TYPES 235 +#define KVM_CAP_PRE_FAULT_MEMORY 236 +#define KVM_CAP_X86_APIC_BUS_CYCLES_NS 237 +#define KVM_CAP_X86_GUEST_MODE 238 struct kvm_irq_routing_irqchip { __u32 irqchip; @@ -1548,4 +1564,13 @@ struct kvm_create_guest_memfd { __u64 reserved[6]; }; +#define KVM_PRE_FAULT_MEMORY _IOWR(KVMIO, 0xd5, struct kvm_pre_fault_memory) + +struct kvm_pre_fault_memory { + __u64 gpa; + __u64 size; + __u64 flags; + __u64 padding[5]; +}; + #endif /* __LINUX_KVM_H */ diff --git a/powerpc/include/asm/kvm.h b/powerpc/include/asm/kvm.h index 1691297..eaeda00 100644 --- a/powerpc/include/asm/kvm.h +++ b/powerpc/include/asm/kvm.h @@ -645,6 +645,9 @@ struct kvm_ppc_cpu_char { #define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3) #define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4) #define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5) +#define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6) +#define KVM_REG_PPC_HASHKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc7) +#define KVM_REG_PPC_HASHPKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc8) /* Transactional Memory checkpointed state: * This is all GPRs, all VSX regs and a subset of SPRs diff --git a/riscv/include/asm/kvm.h b/riscv/include/asm/kvm.h index e878e7c..e97db32 100644 --- a/riscv/include/asm/kvm.h +++ b/riscv/include/asm/kvm.h @@ -168,6 +168,13 @@ enum KVM_RISCV_ISA_EXT_ID { KVM_RISCV_ISA_EXT_ZTSO, KVM_RISCV_ISA_EXT_ZACAS, KVM_RISCV_ISA_EXT_SSCOFPMF, + KVM_RISCV_ISA_EXT_ZIMOP, + KVM_RISCV_ISA_EXT_ZCA, + KVM_RISCV_ISA_EXT_ZCB, + KVM_RISCV_ISA_EXT_ZCD, + KVM_RISCV_ISA_EXT_ZCF, + KVM_RISCV_ISA_EXT_ZCMOP, + KVM_RISCV_ISA_EXT_ZAWRS, KVM_RISCV_ISA_EXT_MAX, }; diff --git a/x86/include/asm/kvm.h b/x86/include/asm/kvm.h index 9fae1b7..bf57a82 100644 --- a/x86/include/asm/kvm.h +++ b/x86/include/asm/kvm.h @@ -106,6 +106,7 @@ struct kvm_ioapic_state { #define KVM_RUN_X86_SMM (1 << 0) #define KVM_RUN_X86_BUS_LOCK (1 << 1) +#define KVM_RUN_X86_GUEST_MODE (1 << 2) /* for KVM_GET_REGS and KVM_SET_REGS */ struct kvm_regs { @@ -697,6 +698,11 @@ enum sev_cmd_id { /* Second time is the charm; improved versions of the above ioctls. */ KVM_SEV_INIT2, + /* SNP-specific commands */ + KVM_SEV_SNP_LAUNCH_START = 100, + KVM_SEV_SNP_LAUNCH_UPDATE, + KVM_SEV_SNP_LAUNCH_FINISH, + KVM_SEV_NR_MAX, }; @@ -824,6 +830,48 @@ struct kvm_sev_receive_update_data { __u32 pad2; }; +struct kvm_sev_snp_launch_start { + __u64 policy; + __u8 gosvw[16]; + __u16 flags; + __u8 pad0[6]; + __u64 pad1[4]; +}; + +/* Kept in sync with firmware values for simplicity. */ +#define KVM_SEV_SNP_PAGE_TYPE_NORMAL 0x1 +#define KVM_SEV_SNP_PAGE_TYPE_ZERO 0x3 +#define KVM_SEV_SNP_PAGE_TYPE_UNMEASURED 0x4 +#define KVM_SEV_SNP_PAGE_TYPE_SECRETS 0x5 +#define KVM_SEV_SNP_PAGE_TYPE_CPUID 0x6 + +struct kvm_sev_snp_launch_update { + __u64 gfn_start; + __u64 uaddr; + __u64 len; + __u8 type; + __u8 pad0; + __u16 flags; + __u32 pad1; + __u64 pad2[4]; +}; + +#define KVM_SEV_SNP_ID_BLOCK_SIZE 96 +#define KVM_SEV_SNP_ID_AUTH_SIZE 4096 +#define KVM_SEV_SNP_FINISH_DATA_SIZE 32 + +struct kvm_sev_snp_launch_finish { + __u64 id_block_uaddr; + __u64 id_auth_uaddr; + __u8 id_block_en; + __u8 auth_key_en; + __u8 vcek_disabled; + __u8 host_data[KVM_SEV_SNP_FINISH_DATA_SIZE]; + __u8 pad0[3]; + __u16 flags; + __u64 pad1[4]; +}; + #define KVM_X2APIC_API_USE_32BIT_IDS (1ULL << 0) #define KVM_X2APIC_API_DISABLE_BROADCAST_QUIRK (1ULL << 1) @@ -874,5 +922,6 @@ struct kvm_hyperv_eventfd { #define KVM_X86_SW_PROTECTED_VM 1 #define KVM_X86_SEV_VM 2 #define KVM_X86_SEV_ES_VM 3 +#define KVM_X86_SNP_VM 4 #endif /* _ASM_X86_KVM_H */ From patchwork Sat Aug 31 11:27:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786069 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 AF53533EA for ; Sat, 31 Aug 2024 11:28:07 +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=1725103689; cv=none; b=uBXEkW2KYZ5PE+XpjIhD9bOZY9kZR8UPjO/WE+FetvUlbHvvfVR+syd68rfXtyULq7awkd0PdRFkbPmji1JPIvlL+D1GlKgJIOgja7dc4Y1w5Fb+VcOiNTph7uNx+Qkx0TnQT5rdJp4TlE9rWALh+dDizyhQmWWyLVUnTmoZNrI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103689; c=relaxed/simple; bh=iUeMOxB+bJ6yYs/eVf1WGH0sBRrkfImQ7eFcLyGwVsI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VjgDltksJ3U1LoK7TTIdbzmtV1S147XLYeeEb9nOZQuAUCQ6uJ/v1PinTBdYXG+4f2/C1VYAJT216rr4bTOymAHRvOvrKsJGjGCJUwJX/hja0zByKIuZpvhrDVvVRWBXzzBIlBPiHRYn8odp7O22CEpZeFwcs0ntiTVUSoHkf+c= 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=eJwBl3up; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="eJwBl3up" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2055a3f80a4so181635ad.2 for ; Sat, 31 Aug 2024 04:28:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103687; x=1725708487; 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=amrFrBBY/dGhGTVucOT6fTXuPbDgIkbswePVZ2ud29k=; b=eJwBl3upQKzG2yBwbIhXC8PDnkB7cMTsgrTQy7kUUL+x7eQcGBTCk4uqVaG6o8R17e GGaEADrsEsoeVVla6xTx2knDdtIopNAOi9SA1UT7zEYF116yQ5borxvl0KV9UPJ7Ghca ydXZjgbO1aqGIbYTTPaTiM8BgkXeESwQKmHSuODppMEh+iZ1YVWTjwHDR4FoL671KqRf nkPW77E8OJZ94UyUNnc61kyBernbpi19ZeGLtgTVSjyG9D+NfwvAWc/7I18lDtq55Xoa fjBWykZLuYh/aFpWfHGC/rZjeOROfD2cfUfJVLdzO+V+q1YVzDMCvqgHfvRUNPqW0lQZ usUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103687; x=1725708487; 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=amrFrBBY/dGhGTVucOT6fTXuPbDgIkbswePVZ2ud29k=; b=Lffnzq6mh0aAVKGWcnO/g0fPRPbF9Cmu3VAXsMe9LHXZAFsL9T7Rly/Ww/P/xI6BUQ X7Cj+hTIT5zded6JfxDgaUPlGXe+gR+ViT59EBxCBvUVeL5nNPSPLKAbqclkLKrsVD6G cTUcuuVwIIWuXZfXoc9K+fr1OW0rn8DNdXee5CXaGz5MfCH1IoLxpau8HdRXUEEEMgeg cT+A6Vag0pTjGw5GIS8GB7Kyzjh2cYaDL1OkG7pvIaxrM/X7mOF4+ro8eHm5yS3lCp91 xa3AU3QrS29MVZ26AnlgClRm3ttZi0mFdKrfxIaN77jaoud6rePGDMp13JEr+DyeR+Fj SUcQ== X-Forwarded-Encrypted: i=1; AJvYcCUSCrPc2uR1amqvsFBsKX93AqpcmqJ1hbi+hx4R/O5z+MOtnG7ByQQYEk0DKOEPoTbGYBU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz575Xs2X5+RKsiKPQW2U5Sn7NYPHwFg1a+w1eqVic+TpM74UNd y2lKgPYxqarVLOQVx2egNzecbMQrBVNrY4a7Jcvw5cme+VKKm5mdq3yb7HpppIY= X-Google-Smtp-Source: AGHT+IHNCPuYTkZ5ewBczhrpsP1Fp01YKGsd3IZMcvqfAJZhV9rk5L4wnPoTAfR3/F/G81ss8F83+w== X-Received: by 2002:a17:902:d48c:b0:202:2ed:b3a2 with SMTP id d9443c01a7336-205443ddd83mr23280685ad.8.1725103686583; Sat, 31 Aug 2024 04:28:06 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:06 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 2/8] riscv: Add Zawrs extension support Date: Sat, 31 Aug 2024 16:57:37 +0530 Message-ID: <20240831112743.379709-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zawrs extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index e331f80..9d0c038 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -24,6 +24,7 @@ struct isa_ext_info isa_info_arr[] = { {"svnapot", KVM_RISCV_ISA_EXT_SVNAPOT}, {"svpbmt", KVM_RISCV_ISA_EXT_SVPBMT}, {"zacas", KVM_RISCV_ISA_EXT_ZACAS}, + {"zawrs", KVM_RISCV_ISA_EXT_ZAWRS}, {"zba", KVM_RISCV_ISA_EXT_ZBA}, {"zbb", KVM_RISCV_ISA_EXT_ZBB}, {"zbc", KVM_RISCV_ISA_EXT_ZBC}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 3fbc4f7..0b79d62 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -49,6 +49,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zacas", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZACAS], \ "Disable Zacas Extension"), \ + OPT_BOOLEAN('\0', "disable-zawrs", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZAWRS], \ + "Disable Zawrs Extension"), \ OPT_BOOLEAN('\0', "disable-zba", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZBA], \ "Disable Zba Extension"), \ From patchwork Sat Aug 31 11:27:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786070 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 ADF5433EA for ; Sat, 31 Aug 2024 11:28:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103693; cv=none; b=Gh9ixuzxHrIe0aLL5bonr1P4FAuUkilbpE1AAWYWOQfOjKb0cpBJftGA8fy43t8jdsJPa6Su97/CQsNPtVgGj+DiSw0TBMWfVaExF9KaLuel0XKz5g+SgfWuI6sPuLnGvScNAXeRRFOVJhzZ0fi6ygyDmFxAixTm8ADKNgcFZBw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103693; c=relaxed/simple; bh=FKHQvOo9erP7n7MEe+57gTtAshMO2GWD8mVbGlwKP+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oejk0OSKQEx2WI5NGfsvPVgen19TyY7wYMtU3KPn3HC1QmZMhmr/0xGWoWV1MefNpuAZelTeeDj6vC+V8ELoHzR+UKWj2scku/yvnJcFQiq6ydklHRoNk97evpWo2+ZZZk1CVYj4++6Y7n2yeH1KYoq2494+Z5mFaR6VqaqvdaU= 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=e0u8Cu+i; arc=none smtp.client-ip=209.85.210.178 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="e0u8Cu+i" Received: by mail-pf1-f178.google.com with SMTP id d2e1a72fcca58-7141d7b270dso2218147b3a.2 for ; Sat, 31 Aug 2024 04:28:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103691; x=1725708491; 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=r6po97RhZOZUf+IwPgmxPkXAAKqo/0ExO40UV6np7to=; b=e0u8Cu+iSwSL54/CC1S1ayztN4bvtBa6VPQExcHOr3JaxENNzdYt3JeAvYPlqKprHX lCmXRV0eY8LPKTy1gwdMTpTal93pcEUpq7DlXS0R0dStTPyEHvM9S20BgXz5PrlUWPB5 Ou69iNF+AccftYai8iZQ+zVIgIsOOK9HMWPr4/7kShKK67b2HfWyvehWWA8h17diOdyA NI1n47vjzq2GoNl5qlAo/QFlrjUHGlONDrB7VmP3Yio23KJGMge5puhShewUUxMA1y+v 4mlxsp917oS4uxajmNsANxkpGboUDGeXDbPGhfqBuEheHvB8v+2w7bZhfsUjg7/nKZiv 3x4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103691; x=1725708491; 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=r6po97RhZOZUf+IwPgmxPkXAAKqo/0ExO40UV6np7to=; b=Pd6lVM6yqpC0vqeAfRqYgHdyrSwKTchm0VzByesRa4/ncWbMy2T+R7MVSteKZun97y 6OYpYlLteleRMFpLhq0ZsrMsjyBxxNGXXx/0Vz+JRl+wJJosaPvYyN2ediZlqWkQtosW ncriMxFQtak7Xh9ZR9J6wuJqtvYEJ7acbhKXobdBTqYVNtruehiM5AzqicSaKqMMVkGz Qe1g2/PcrmqIu3IPQX9yImiMzwxkSdPk3iTokwGhTTwrwjRF/s59tzHaoR20xWqTWggA SGJDHD+uRMtpsy1DfFlMXBG79h8gpioUT89QABFkj1PX8DinIw3ri9zEW9BoBBExVfbl NiCA== X-Forwarded-Encrypted: i=1; AJvYcCUD9AQYfg3d2eeF09qeccSggLD2HJVgp4PB2WAtgVKz/xwC5/DLkPHFmiKszzjWysrbWNo=@vger.kernel.org X-Gm-Message-State: AOJu0Yy/h5axeA/hIRA3BucuTXjOQNwU6zl1tUPL0WxykfswACEqaVjK i9WTU48Q+M/tOioDvB7ukfw2OAC2T/9ZD2iPCDzvEZ483oEmhFESKQ+v4J1qeHI= X-Google-Smtp-Source: AGHT+IGCVKzkl5zO2EKWqgNuFwQNK7XHEay2aT6rHxuqgJByJRJTnZ4Qv+QSyrTUaTCGSKYNrf52CA== X-Received: by 2002:a05:6a21:1585:b0:1c0:f2a5:c8dc with SMTP id adf61e73a8af0-1ced6549f90mr512913637.50.1725103690686; Sat, 31 Aug 2024 04:28:10 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:10 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 3/8] riscv: Add Zca extension support Date: Sat, 31 Aug 2024 16:57:38 +0530 Message-ID: <20240831112743.379709-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zca extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 9d0c038..4fe4583 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -32,6 +32,7 @@ struct isa_ext_info isa_info_arr[] = { {"zbkc", KVM_RISCV_ISA_EXT_ZBKC}, {"zbkx", KVM_RISCV_ISA_EXT_ZBKX}, {"zbs", KVM_RISCV_ISA_EXT_ZBS}, + {"zca", KVM_RISCV_ISA_EXT_ZCA}, {"zfa", KVM_RISCV_ISA_EXT_ZFA}, {"zfh", KVM_RISCV_ISA_EXT_ZFH}, {"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 0b79d62..40679ef 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -73,6 +73,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zbs", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZBS], \ "Disable Zbs Extension"), \ + OPT_BOOLEAN('\0', "disable-zca", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCA], \ + "Disable Zca Extension"), \ OPT_BOOLEAN('\0', "disable-zfa", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \ "Disable Zfa Extension"), \ From patchwork Sat Aug 31 11:27:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786071 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (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 0C70917DFF5 for ; Sat, 31 Aug 2024 11:28:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103697; cv=none; b=AKTRI4cvuLjOjcKBvVL7RixH9ks5WwTVEUrzGoT2EtX05xZqbQZcN+Cc7Uwc4tJ5ZMnI96tmX+fhcpVxKae/5eEbqjKGmYKHTWr+Pd27/CUT7pxBZMgLy5WJGSA0mQA/TGT4X7b0pGZ2wYTlGXsCKRB2q0GZKoCEX9O+32bRsh4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103697; c=relaxed/simple; bh=GnxgynmvUgyIqjlMIaCajHTOkjPUbB3pBslWEwlNhY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pYL7KRro7oCRHIpTmmm6rjov83fGZcwgTwN+iIP/kCSx6o7TDRo6K1j5P51SlksdxPxHWHf5wUt/D/Z6zOtPqoO70KOgeTSLQeOu4LKplvmHo1+amAfUT81W0LuvWlyRVRIvBDsHHVsFe2SU7lmTh3MtPIw6TWtj/Ja6NUd8z8c= 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=kXIsS+xC; arc=none smtp.client-ip=209.85.214.174 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="kXIsS+xC" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-2053525bd90so8838115ad.0 for ; Sat, 31 Aug 2024 04:28:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103695; x=1725708495; 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=tXdSRSEmTvo6sMNXYdaHKPgibvgWAOri4J2oivTeXtU=; b=kXIsS+xCV7aHYpZM/y4bl7J8AxZzNvAaWMhqV4EWNILVVnnOXEb6rl6YNIue0y4pbI SDbOK6+riVDSeGNDADGi0r96PYYnCGLwDHkUWxp7541Wrp20wBK01+pb6k7+bKprw94n 5RK8DvdeMQgE+TWE9o51gRmyin31XsEWtehiTF9TOW72zKD0A+8V+3uzNYRt5YSU4EyD sBRt4jMctHUSVLmeEt1+0cETYI4kh/YFiCxoLPgVulQM4YG7bG+rHwy1vX7j8LHVnCpE 79yrXgm0qjyYKW4MceY5ID8Kc/BQc6QmmKbtNQWkxi+0fe1w5eLz0c24gfxu4xham433 Kemg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103695; x=1725708495; 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=tXdSRSEmTvo6sMNXYdaHKPgibvgWAOri4J2oivTeXtU=; b=jw0H/ineXmQjraQXyepJ7MGmWIAiKxad7t3m+Ujn+LiYAeZPyzkTIL3lAdNzpzKqmG PNHxC6U6ugv4K1AhKKRG0LdkNQaZVjn29NK/2zw8V45F6aBYVXS4itC+j/z0SDGwmd0O cjx3fqxqTpjxPquMkMox1TbexdqrHcafUGTB77CSLMoJnQ6uUO/zYq1+89wo+sWroztV Hc1H4JWzrutxIz3iTIYGX1X+/PuXlf+B/RqWAAFk2fPN08+Q32xnk3s0IXPbtIL0TfIF AvVaqYbNHCzvSnhQhNmwu+pPOZKN47PPngSnK54CjKL79AbDoZWcbUdKf+TawxlGjv3v GMag== X-Forwarded-Encrypted: i=1; AJvYcCXUJ5VpG0lGb2v/RYUa8xWA+M3HSwD51ECPUgAKwy5VkNl1f6cR2J64l9yaIZnRTFPeKds=@vger.kernel.org X-Gm-Message-State: AOJu0YxtatjsfJ5eFSQOq3QpS8YkdMtzagHVXVTaUchU7dXUrQIqTYsA 69rUMg9gkr3h/P2DtrhwtFOadKdSp7jUpJup1cEcW6n1L3I0zUvo9mFyf94ZDfE= X-Google-Smtp-Source: AGHT+IGBQF/RklUqRdEy3O8AxYUqet69JKdRJE18Ux3VuXiVLZkLiHhukunLvYx/vAWNbtRyNXDMvA== X-Received: by 2002:a17:902:f34c:b0:202:190e:2adb with SMTP id d9443c01a7336-2054bd15aa9mr7563845ad.36.1725103695192; Sat, 31 Aug 2024 04:28:15 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:14 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 4/8] riscv: Add Zcb extension support Date: Sat, 31 Aug 2024 16:57:39 +0530 Message-ID: <20240831112743.379709-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zcb extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 4fe4583..c62d4a3 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -33,6 +33,7 @@ struct isa_ext_info isa_info_arr[] = { {"zbkx", KVM_RISCV_ISA_EXT_ZBKX}, {"zbs", KVM_RISCV_ISA_EXT_ZBS}, {"zca", KVM_RISCV_ISA_EXT_ZCA}, + {"zcb", KVM_RISCV_ISA_EXT_ZCB}, {"zfa", KVM_RISCV_ISA_EXT_ZFA}, {"zfh", KVM_RISCV_ISA_EXT_ZFH}, {"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 40679ef..68fc47c 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -76,6 +76,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zca", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCA], \ "Disable Zca Extension"), \ + OPT_BOOLEAN('\0', "disable-zcb", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCB], \ + "Disable Zcb Extension"), \ OPT_BOOLEAN('\0', "disable-zfa", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \ "Disable Zfa Extension"), \ From patchwork Sat Aug 31 11:27:40 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786072 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.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 756A133EA for ; Sat, 31 Aug 2024 11:28:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103701; cv=none; b=Iz4GZkf85PDTK3BIjRY11pt+DbqzOk/ykXuobJ6dWMOPhOxNmOcM37ugm64Xylt4ICYjHqAw7fe3LJl5q6QmUUSNurTjaamYeA3VJ87WabwwnY06++1d+MNtiqfBaZpho9FcPqkWK1mSEmCs52NQWvywlScOVSBFuvu7RyObf/U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103701; c=relaxed/simple; bh=TzG26ZihbX4+X9A95svLiNCwHMUILN2mfzdeI8nIjCg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VapcwDAKsKYu1PKRH0c27GuokCL+vklh6GFpBzZyUo8mxEITEBrlQ6cFhm2brqSgKZA1wa9HqFrO0lzUcee0OQaw+h6lBIz34EDIIeIdOs4elzAjOb2NG1VWxY3aagV2cr/C57+gk8AqFhOcYVD0WLpI/SUlmx7LBP3pDAX3D+Y= 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=DIhltsDY; arc=none smtp.client-ip=209.85.210.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="DIhltsDY" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-714262f1bb4so2172702b3a.3 for ; Sat, 31 Aug 2024 04:28:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103700; x=1725708500; 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=IN9zWgfThfW7vB975JaElm6zTXWCeSIChlwuRZr9WjQ=; b=DIhltsDYNY9kIEB7UuBJtR2hbWkkGLMiW2t0B62EKf/yfRO4cYPkFW1timuSS+NUzg dBUO8hiHYUYknl3gGAWrkNBh/1s5D8Zhva1GhP7RpI2g4DmKlekqOqrd/m8gE7Z65V4S ZkptJHraDNQfs8Wp09TzcOrALpO4EvcJpoHqBpaLLeesy0bJGVboTeocuyYv81w3jC+8 +fmGc/Uh9Wz45yr4PfQmMc0oZowPOtyRa6v7XxuFsxbSBkG1CxSa5LiISwLDjL+m5whp s5V4dol03L9Qpcus7Uccgx7MGDUiJj2OxcNcJ2jONmaGNqIQIVp/OMlJAQsP3vLLrEWB fsvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103700; x=1725708500; 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=IN9zWgfThfW7vB975JaElm6zTXWCeSIChlwuRZr9WjQ=; b=NXxcGBbiCvIlePQokp9/fIIi28oeaZ4ZFpazjSvUtvq14qs9ltJOhkZmcBMp5Sivuk 24Igt6w5seZy+xbZeiKSsRZLKnoxq6yE1Jo4wZBIk4Uf2faoPdxSClCIj0BClLNv8ri2 B6kEAnEfQZCBsfNj8hVvSdRUesydcqXuvClmtjCZA+DsYQRQ2tmRixv60jSy1xwARmYl VYfklDLAE7IJ9UJ+Qz0KoY2u6y2vCEZNnedPISPWWQYFY4qNaL1a+6wtRJlmuSftb3gR 2PoXljfIRz8y/MsJ46Sxts3Qa7K5mWKO9Ku5iUDTfOuFBlhnRYOMive36sMI44zgtLsC 57RQ== X-Forwarded-Encrypted: i=1; AJvYcCUDGzJPRv7Rdp8/c3sk1qJQdH6TSFZSWwE3bddOOCmMHEko9kA66WC6yZcVd1V4lZo2NNs=@vger.kernel.org X-Gm-Message-State: AOJu0YzVIvZMZZWBUCfydeaMCc3qeWOQXMuUoc7pSSq0zA1HNsJbUsYd iKEOJpIj1/xGwlDAPLrgqwlc/cwrwtV68kg+OlaqjvL5uXMAna+B1BB8/iaUl5g= X-Google-Smtp-Source: AGHT+IF4Fve2vOx5CS/sqFIy/XsxZ/BrevhiyP3Y+gnDhrSyaPt5YS2F96MtmxwIKsKduhz5mXw+qQ== X-Received: by 2002:a05:6a21:6b0c:b0:1c2:8d33:af69 with SMTP id adf61e73a8af0-1cece5d1678mr2539298637.41.1725103699429; Sat, 31 Aug 2024 04:28:19 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:19 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 5/8] riscv: Add Zcd extension support Date: Sat, 31 Aug 2024 16:57:40 +0530 Message-ID: <20240831112743.379709-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zcd extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index c62d4a3..5587343 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -34,6 +34,7 @@ struct isa_ext_info isa_info_arr[] = { {"zbs", KVM_RISCV_ISA_EXT_ZBS}, {"zca", KVM_RISCV_ISA_EXT_ZCA}, {"zcb", KVM_RISCV_ISA_EXT_ZCB}, + {"zcd", KVM_RISCV_ISA_EXT_ZCD}, {"zfa", KVM_RISCV_ISA_EXT_ZFA}, {"zfh", KVM_RISCV_ISA_EXT_ZFH}, {"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 68fc47c..155faa6 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -79,6 +79,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zcb", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCB], \ "Disable Zcb Extension"), \ + OPT_BOOLEAN('\0', "disable-zcd", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCD], \ + "Disable Zcd Extension"), \ OPT_BOOLEAN('\0', "disable-zfa", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \ "Disable Zfa Extension"), \ From patchwork Sat Aug 31 11:27:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786073 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 757A017DFE4 for ; Sat, 31 Aug 2024 11:28: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=1725103705; cv=none; b=QUWxy+iaXek94AKu8KfvM94Gz9wPgEgrGy5PolYUXfRV7ybLupj9LGKvUD4+5qVjqUdVvv+WjEe4t6hBp/Ic7klkm6VTPl1ecaVFN6dhb+/DbPN12l04UPJofwi52R+35HdJvvBBeU/ATjU+XWxs20m0XlVezIZ44bARsxErvyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103705; c=relaxed/simple; bh=+bJpXEISItHxh9KYf0g3+4m6Lw2Yo1O/Sx4mIWVm6s0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=N9cchnVokvdDeLXJVatI1bqRsIlQ/fboiN8Gr0oU6rsBv2pbbTo2mZGF5cqkjbaSeeHPeQ+4V0/4nbguW+RlAuGwcEpUhz25Y07MZp+nz/10u57uFtveGqfxrqh8qZ2FM6L5eR4wB8I5j/MuEzWH36K55TML3YWGJX76FqyZASU= 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=GSEiFf15; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="GSEiFf15" Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20551eeba95so1600845ad.2 for ; Sat, 31 Aug 2024 04:28:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103704; x=1725708504; 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=tuRFySUd5303Km4p+Lb412XdEn4ed1XKXd6/Xjv+mkE=; b=GSEiFf153G8evRdr5iGWGDfnDHe0DyJDUZ8P/RixzG0s/F80eL4vOTAv9CkX8Z45/4 zjw1RRPraZzb8H//AG9jjNEfv/Z0rJhtjyEkLDVYFrnnFPGjJCMNkgV+tCf5Pij9xCto 4Jz7ftsN8Tr6KGKasyL8tsLN6/jY2OUNh6luXZWemcawugjLwReRso5RrZwWCtPrJWMW U6dIfwt2Wp4tMCb/+yAGI3HD1FmEKQ4Cx1JnueBsmX+MUEoAfkW5pRdkdbsNcuYGpqay FtQE9zsutmlOEbC6Xxu5QLBR4VaVfnTi6LvohihUZ+mNf+xN5VHHoVuJ1c1fplTKi+aI OcwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103704; x=1725708504; 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=tuRFySUd5303Km4p+Lb412XdEn4ed1XKXd6/Xjv+mkE=; b=unlJyH4jyNFZymNeIjGUaYQ2GGY9R4zVu3qtu2rRUZgapQPwxIBQ3awMrBQK439xRu +NAscaqN/M7Ih8aO4EovlKFwyDrNaP0TsWWRG1Qji3nobiqh2xjPq7KH0WDIE9+EY6C+ apOoEA5dSHRmH0Wt6NPNZFqaYnlaVQrOgDs2G1WF/+DEEBRZ7PbXyjeSo50dyZftjPsd 2TxO82s7PezUswRcgJkSZweJMiGcBsw9W5SqbMmIm8H8oEqxrknufQKMvi0XzUVaJKWV a8LF4AA42sbk1bQxO5y2ItOj3SR4rIjPsjTBm1ZNzcfiNNsXOjhlVte9eJnbf9Kvcaxb imdg== X-Forwarded-Encrypted: i=1; AJvYcCVhS/kJG7sh1gwnSlVgLKVcGd+Ow2PUNUR5como/8ipOfY0LGeLFvTKLNImNp7bBK1NO5Y=@vger.kernel.org X-Gm-Message-State: AOJu0Yyz2bjFxnaSVy0H0KfJsaHA162HePJR/mEHhAMo6h7UMP4jbwID jxkHxG0MQSdOao4cQg4kys3wKZ5cZGBvQq+Hifqzuys57LqN3xgRWdYexbq0VdU8gXS2wWl5COw PmJ0= X-Google-Smtp-Source: AGHT+IEaSOkI/cI6vZxDuGm0bHQEb2cbDyK5243XEeb3lPa/1FsXdIRjrM+XMXSYUJC/OBQjDjGeng== X-Received: by 2002:a17:903:3643:b0:202:47a4:7a1e with SMTP id d9443c01a7336-2054bcbbaafmr9803955ad.16.1725103703655; Sat, 31 Aug 2024 04:28:23 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:23 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 6/8] riscv: Add Zcf extension support Date: Sat, 31 Aug 2024 16:57:41 +0530 Message-ID: <20240831112743.379709-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zcf extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 5587343..7d8a39d 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -35,6 +35,7 @@ struct isa_ext_info isa_info_arr[] = { {"zca", KVM_RISCV_ISA_EXT_ZCA}, {"zcb", KVM_RISCV_ISA_EXT_ZCB}, {"zcd", KVM_RISCV_ISA_EXT_ZCD}, + {"zcf", KVM_RISCV_ISA_EXT_ZCF}, {"zfa", KVM_RISCV_ISA_EXT_ZFA}, {"zfh", KVM_RISCV_ISA_EXT_ZFH}, {"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 155faa6..09ab59d 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -82,6 +82,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zcd", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCD], \ "Disable Zcd Extension"), \ + OPT_BOOLEAN('\0', "disable-zcf", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCF], \ + "Disable Zcf Extension"), \ OPT_BOOLEAN('\0', "disable-zfa", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \ "Disable Zfa Extension"), \ From patchwork Sat Aug 31 11:27:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786074 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (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 BB6F417C7CB for ; Sat, 31 Aug 2024 11:28:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103710; cv=none; b=YVp0cvPpYhunZEb282rN9Mt0HCy1EWsTNX1XtN19KtsLc1r0nIPlReuAmMBuuUI0aLr4SA1LpxexcAabnNM65jT7zWpOxAOcYYlN3pmIPlCV91wFubVqgYiXd+TuzhAaIikKCw+Vjl69sKcgnnki12reI03AFjc7HgnW7RRR39c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103710; c=relaxed/simple; bh=s5xEf5d/1JLhg/SRbuetF1Kted25wh7fSZ7aRRXSA1A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=p6TS56f6oF7rHOfWoQit9xcvAsci1dKsqTEVzczfKkY6X+Yl6ZdMz9iLYK4cdTa50m5vWMe2tH1SU2qDybHrIE/zgkj6MV32zZkd/q15lSZTixYUbcx3wy/YthxqSFsrvLaL7CvHlwNBewjcBdMkMeVqvynTq8E+UFHkH7dPhLA= 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=GVdQwYIo; arc=none smtp.client-ip=209.85.210.182 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="GVdQwYIo" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-7141d7b270dso2218237b3a.2 for ; Sat, 31 Aug 2024 04:28:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103708; x=1725708508; 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=dSG2mOQ3WcTVmUmPxjtLmw3x1sU5mFnJXlTn3zaT6k0=; b=GVdQwYIoxpHOw34LgB4HGyOaOaN1vHOxWAAn2ztB9W8D+7jkq6nuFekcahK26tlWdt 5YqMVAISfc6IoPNb6Qt+UHtngXqncmh5kz7DAC3tPTKv+FwU5r4cTGk9zhlwpuRkDiFV otcF3S0xms/NseuNcE5XFWnOhlr6P8Sxy+IGeBgF8wWLfW8ZBuRf5Mzs2lBCCjofm6D3 xROFMAFyhmFx+9GlC2s3A1RiuQElElIJoTknKB8mzbsjZYjOX9WhKJVgZRWEOJxYbw7k apqn3u+H78kf7y4TCphF1mnwBx8CPvgYFVfGS6kD16crsTLseNb6mTD9kP1Wkh8eCjPg zKdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103708; x=1725708508; 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=dSG2mOQ3WcTVmUmPxjtLmw3x1sU5mFnJXlTn3zaT6k0=; b=Tr6r+HdToDo1Zp0AZHAe2Tr9L3oULdLeZK8hm7wv47+cXZgZYcqg7I3wHTU6yTjJzm ymWYZMf/QpMknE9idlJdeNEijdTquVDuOLOiqftvNn65HxzZs9yU/RTdXe5RQqm7EsU+ oPtyvzKA/JdBXRmJ0m+jPmLHxzuJhb6M8vGFpB3duEO+/mZYFwoZxvbTN3I5Masc5sEA EBllkoH6G/UjoT8a16QSlfsTnPQ9ks8k37diipN5JBKGMApxRU4YLD59SMFT0tKoR19z 5bMv/0dDEnStA/Y0agEvoeqYFojVpB2FKVz/6sT32oR3/NL/CuED5PT56INWrOQOX6w6 7rzw== X-Forwarded-Encrypted: i=1; AJvYcCWErpMjH0dwQ4zAqVGXOeo65ratutbKp3z2AT+5yiqeiuQSoJfrgVOYRUc6bjcd8qAQv+k=@vger.kernel.org X-Gm-Message-State: AOJu0YxeoI6PcEULWs6p3JZeeNcXhcTCOhs51pDEIQA+F6g8JC60cv0X o+M0EY5nlyIcr1s5qxuygS2z0MmicXJ7k+HpPS9K6BGOY6iJYO3u+sfy53MQvdI= X-Google-Smtp-Source: AGHT+IFh9Ai8wStJ+N534RDR5PveZM8RSUWaPoQXrVQAjBv83RkO2n3cEqrD7NyYR6ioJJxN+V+nYw== X-Received: by 2002:a05:6a21:6e4b:b0:1c6:ac08:8dd2 with SMTP id adf61e73a8af0-1ced6087aaemr528545637.15.1725103707810; Sat, 31 Aug 2024 04:28:27 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:27 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 7/8] riscv: Add Zcmop extension support Date: Sat, 31 Aug 2024 16:57:42 +0530 Message-ID: <20240831112743.379709-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zcmop extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 7d8a39d..768ee1f 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -36,6 +36,7 @@ struct isa_ext_info isa_info_arr[] = { {"zcb", KVM_RISCV_ISA_EXT_ZCB}, {"zcd", KVM_RISCV_ISA_EXT_ZCD}, {"zcf", KVM_RISCV_ISA_EXT_ZCF}, + {"zcmop", KVM_RISCV_ISA_EXT_ZCMOP}, {"zfa", KVM_RISCV_ISA_EXT_ZFA}, {"zfh", KVM_RISCV_ISA_EXT_ZFH}, {"zfhmin", KVM_RISCV_ISA_EXT_ZFHMIN}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 09ab59d..5d655cf 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -85,6 +85,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zcf", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCF], \ "Disable Zcf Extension"), \ + OPT_BOOLEAN('\0', "disable-zcmop", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZCMOP], \ + "Disable Zcmop Extension"), \ OPT_BOOLEAN('\0', "disable-zfa", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZFA], \ "Disable Zfa Extension"), \ From patchwork Sat Aug 31 11:27:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13786075 Received: from mail-pl1-f169.google.com (mail-pl1-f169.google.com [209.85.214.169]) (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 3073417E005 for ; Sat, 31 Aug 2024 11:28:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.169 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103714; cv=none; b=rmwTwY/yycMrM5N0R3+RsUOVemQKhiaHmGiaQaBCSFwZuXyw8sDWTsqshXDqPjxuLnKeztk38orb6UwZg0ou7e6AUlid5686Bza+D/oRGEwLMKxvA3wHbWZ3VBRUSCVdONhyptj2yvDwpKfOe6yeMfreoCOoFR77hhb01KOX9E4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725103714; c=relaxed/simple; bh=0QyBTci/u+c1w5nD16bwwlBepXxhFcrdPFEPFBNyusA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qJ21utQi/Zz6ImN9n7BIrwdpVY/kTwAY6brE3fVfVvtpVlM3WoiJ/R1rIA/R+Ww0zk3yMVD0WrlylVk1JO5unzV1PfStTtsqXCpOjYwsTSR+FGEMf2nczo/vIDG251cgZAC+DDtx5i6EaJPsY1cBFFgjEw6OSKI81u7/7w0T/hY= 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=XRYQAP5n; arc=none smtp.client-ip=209.85.214.169 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="XRYQAP5n" Received: by mail-pl1-f169.google.com with SMTP id d9443c01a7336-202376301e6so22108985ad.0 for ; Sat, 31 Aug 2024 04:28:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1725103712; x=1725708512; 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=G9W/PvPhY4YAzclM2JSelJpHbbRGL1br7E3OrpY+DrE=; b=XRYQAP5nQUqqs0OmyOqocEQM+qAxqZ/Kw1KbG0ShCrsOep2NOj/xza0WDzgEKt39hO XHmrOY3q8EBqK0xFXcvByeh9ZU1pnkno7v9fL1zDvv7qI/GHNHwy64E6HUnB6VpZX8eE 1RjUfq0gzfvWH0txT7reBv8JjsZDz5sw42LrPp61/Tv65DBR52ez8mRVP7J7mefFrEMC FvSseDAMJw+iqPzWBUMc8Vu1d+LLqC6G8JCQ08NQqLlzJryHyfwFomCAKMHGP9a8O9Se RHYstSjwEE9IKEa1bt7K3EpDHkTFTgxjkqEzQhRaxwSaQ5XyfVpqTgu0vvqI0VEAh3Tf uGVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725103712; x=1725708512; 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=G9W/PvPhY4YAzclM2JSelJpHbbRGL1br7E3OrpY+DrE=; b=w66nyGO+bNw9WDbMf+/qnU4nzi2g7WyhdxRIcp/qDhypkTlF5SLUuoqmNyztejHSxR OCZ84z5a1YD4p19zQ5OA3n6raY8zjSCrvTlCtRBgXIN90s7Eud5EYoQLSfN1sX8qs86C m9CY+No6xBilUm566myUKjuLMLdmqcxdhjjsGmuDfzalNdISL8MZJe/ehyXhwCNRvSZG ziud4sBza/3CCWGRWjVf84PmkMPlIbECMuGVKkjy8eGEu822m0TSxU76IAwSwXCHkBRG +vR24S46LbPMBpAJpGnOX1kaAT8LxixG6/ohou8/j4R01zv4PN67PsqM9xQnbZ2mX7sM 8HuA== X-Forwarded-Encrypted: i=1; AJvYcCUdUh5SoCtmbL2+3inTaS8dbMGIkTeYeXr+jn2gxo5itzS52X2XA1ejwA8tVuLaqFmuyiI=@vger.kernel.org X-Gm-Message-State: AOJu0Yxaq/ZvkiOQ5QuvU+YY5aGnkycXaeTN1iMRHbl7O9NuoXamJ3ow qy0uFvXQ1xF+leVOtCCB7XGPNyRmdTOhbc/+bZTN21lRbWC/zGkG9U5mYHHdp1c= X-Google-Smtp-Source: AGHT+IFrEDhaUx0SUuyIxblepXLqKc+yV2RqLyxEoF9AakA78LY3iMIC9EnV+9+yK3tprr3uVNI74g== X-Received: by 2002:a17:903:1109:b0:203:a0c5:fcfd with SMTP id d9443c01a7336-2050c215d63mr88151465ad.3.1725103712253; Sat, 31 Aug 2024 04:28:32 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20542d5d1b2sm11934415ad.36.2024.08.31.04.28.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 31 Aug 2024 04:28:31 -0700 (PDT) From: Anup Patel To: Will Deacon , julien.thierry.kdev@gmail.com, maz@kernel.org Cc: Paolo Bonzini , Atish Patra , Andrew Jones , Anup Patel , kvm@vger.kernel.org, kvm-riscv@lists.infradead.org, Anup Patel Subject: [kvmtool PATCH 8/8] riscv: Add Zimop extension support Date: Sat, 31 Aug 2024 16:57:43 +0530 Message-ID: <20240831112743.379709-9-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240831112743.379709-1-apatel@ventanamicro.com> References: <20240831112743.379709-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: kvm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the Zimop extension is available expose it to the guest via device tree so that guest can use it. Signed-off-by: Anup Patel Anup Patel --- riscv/fdt.c | 1 + riscv/include/kvm/kvm-config-arch.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/riscv/fdt.c b/riscv/fdt.c index 768ee1f..8189601 100644 --- a/riscv/fdt.c +++ b/riscv/fdt.c @@ -49,6 +49,7 @@ struct isa_ext_info isa_info_arr[] = { {"zihintntl", KVM_RISCV_ISA_EXT_ZIHINTNTL}, {"zihintpause", KVM_RISCV_ISA_EXT_ZIHINTPAUSE}, {"zihpm", KVM_RISCV_ISA_EXT_ZIHPM}, + {"zimop", KVM_RISCV_ISA_EXT_ZIMOP}, {"zknd", KVM_RISCV_ISA_EXT_ZKND}, {"zkne", KVM_RISCV_ISA_EXT_ZKNE}, {"zknh", KVM_RISCV_ISA_EXT_ZKNH}, diff --git a/riscv/include/kvm/kvm-config-arch.h b/riscv/include/kvm/kvm-config-arch.h index 5d655cf..7a9ca60 100644 --- a/riscv/include/kvm/kvm-config-arch.h +++ b/riscv/include/kvm/kvm-config-arch.h @@ -124,6 +124,9 @@ struct kvm_config_arch { OPT_BOOLEAN('\0', "disable-zihpm", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZIHPM], \ "Disable Zihpm Extension"), \ + OPT_BOOLEAN('\0', "disable-zimop", \ + &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZIMOP], \ + "Disable Zimop Extension"), \ OPT_BOOLEAN('\0', "disable-zknd", \ &(cfg)->ext_disabled[KVM_RISCV_ISA_EXT_ZKND], \ "Disable Zknd Extension"), \