From patchwork Sat Oct 5 08:00:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823142 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 7B7B313BC0D for ; Sat, 5 Oct 2024 08:00:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115240; cv=none; b=uc69xPoABgEbtEcU+1tmzwGZ0+//dLaD0nvtjLDVWsM1CuJ452/vwSC3KAWOEIElzFQVXZbNh6oQh7YMKGYetKw7GlSVQf5rW2MID2TSh6PxZdW/dfdStxTTAc4AFzTE7vq/J6cj1lMP7NOitkGSwdlRDej96HSGv5Lz6yRR+2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115240; c=relaxed/simple; bh=bISm15AbbnFVsyVKS1rJGvGAUkByyzepdR6nVr5qNrA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FiDFTBa/aXTEoO2L0i5guxu3hhmLPFsktL7ETfqZ+M+3G1HB2Wj8unyHthqT/43WhbIdQ97h7c95I7XNIitQJpR+Svv5ljDURvkI3hu0AUnsUnKqJN1Gr8L2e6OnlKI/Gv7d9mpXBLDt/ifAH8+C9VoNhr76Xd8x7Pg1lDEFCw4= 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=fmslaeQS; arc=none smtp.client-ip=209.85.216.43 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="fmslaeQS" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-2e0a74ce880so2466868a91.2 for ; Sat, 05 Oct 2024 01:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115238; x=1728720038; 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=/sWS7QAt4/N9QpfhM3GlMbw5FIufz8mceTBIPQoGets=; b=fmslaeQSGB57T4hPscVPg8YbPZagV5inb9sV6HUnYsCqORqssDCexArGf2goiF3SvQ F+sDoXFsKgUKiSioH+KRIoiFB/ih20h2dbYL1PI0PVjgllXiH3MTmgoWTj2ca/KikHMS IFmi0BF3606zKtk7az2oFeIrhobiZ+qiB+jGf3QGBTr0xVu70YhBAgRPaJX2diJdiKLH +TacUltlGgghF7hFGJUwNt7QIXs9w0wJ52Q5baMVKCKrXQ+EcumRlMhaHgC7VTBg1D2v 2w3O1HRoLNjyuH1PdGn/liF1i8IZhl+YDmltAzNUAfn65wQ5zzfiSp/js/IOlUkHchUf rOfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115238; x=1728720038; 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=/sWS7QAt4/N9QpfhM3GlMbw5FIufz8mceTBIPQoGets=; b=c5PNe0Oa6qumC9LU61wM2L9oETCwkYlF/R8kN0XQ6s1TgexrnbCwXOtLBGIVcw5vUJ H9/KY62YH8E1OVIWqQw2VCtH+5oB9kv2rE4m/I2pN9BWCtwODgnIZuWRdgOK+9sJXr4T FG4vnShWxmq2c26inud3mi75xhhWjggoSyGeVtXRVTLk7XgZDjyT5g8gEdHad+e2PmHR ki40jvVOrKuixconeRslO5+P33rzjDOGT3NUCCqZu8QEZg+Hcn2nmnYO5LdrHIkz8vC8 y1vlx7Qv/NX7xzTtAQqNE7qx0r00zNlfyaJbnhtK717dtyWSmxL5jfrgzKLhlAIgnjbR vqCA== X-Forwarded-Encrypted: i=1; AJvYcCVNPLZ3ZRywwUE4u2XyZNr5jNNYAd1f097kaxKIy6KflNQIeeZrh5ZGnQRLLuo9/COvl5U=@vger.kernel.org X-Gm-Message-State: AOJu0YzVMSHwh2ro2Y2vKMzEVKj6h49VIfmnPQ4iG5ObL8lCOwMj0RVi O/GM8uiM6HoQ4SAsMkxrwVP5GaL8FZKQQZg5SpzrhZHZIjssTPq+b0hR7CThAHE= X-Google-Smtp-Source: AGHT+IHh93RIZYuNbGThvVvVMpxxIordQ/uESwOsTOoZeBZX1xZ/v0qBg4GsRWvKsWgREH1GU0mihQ== X-Received: by 2002:a17:90a:f2c4:b0:2e0:9160:1842 with SMTP id 98e67ed59e1d1-2e1e620c8e8mr7348534a91.1.1728115237626; Sat, 05 Oct 2024 01:00:37 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:37 -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 v2 1/8] Sync-up headers with Linux-6.11 kernel Date: Sat, 5 Oct 2024 13:30:17 +0530 Message-ID: <20241005080024.11927-2-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 newly added ISA extensions in ONE_REG interface. Signed-off-by: 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 Oct 5 08:00:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823143 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 083A913049E for ; Sat, 5 Oct 2024 08:00:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115243; cv=none; b=FGzXZSrxndyxMD+lMiEqqXILSBGp6T4QI417SYeuPye1r0n0CHG2RsdMH41F04k/q6ZooztpW++kAIVOiDYaw5y1/LQe1r6qSB/oZ+ugQvNpRw3zc+QvG3gtB1dRf5HupIw89pjWEa+ZAesajgmjym7VoXfMH+zurCNm84i+fUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115243; c=relaxed/simple; bh=vFcSAwaoHjTQIYIuybwWMnD0drvKwXdrD1Fa1FRVis0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rt/knlc6B24gQc8IyI01EM6bN/WhcHfzBc1KoJSpy5QZLbXt404H38hpxKHYDXYONMrp4PxxrIdQXtk6ROoTHEmpETxluTLzRcLrUAEkA7wAWdL3acGrwOsX3rcf3AbqzkfHDotW+e/e0VDgbKXnLXOipYoWJzr/E41iyh4W+YI= 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=m3x3j015; arc=none smtp.client-ip=209.85.216.42 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="m3x3j015" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2e0af6e5da9so2189785a91.2 for ; Sat, 05 Oct 2024 01:00:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115241; x=1728720041; 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=hjTizSTnXElNIJbMBBHecQzJBJ4PN+Q8AQDR1bin79U=; b=m3x3j015GDuouGwcg5ma7fk6v0UuAxTRoJMDfsHC5oJnTLMu0OBsAO26qDQzkpwort azJvKeyYBBLoYvPsyichotCXH+alAzBSIuL787D5WXfASBtMRgznCFNb+uEKlRIqJkSJ mzPhQI8U3ce0edPKlaVZ5xkitpxtvJi40TKYS4/mXdIHwx2iEUTWki6mVXDnazHp8oXd /GbGQnYu7Fa7ojD+FhGy98Me1gGijiqTvd7aY1mOOqsRQ752Graoxr45IVZv4bmsHbyL SavFDIOymLKAJ9E/yEQzKKXw6NWk9wOLm185MgdANDQ8CD/TsRscq1fs/81mFaEUmBcj 7djw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115241; x=1728720041; 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=hjTizSTnXElNIJbMBBHecQzJBJ4PN+Q8AQDR1bin79U=; b=ljSsB/90c7Q9/h0dKvDhZdIxu0W5pKLEVgxekgB+sYBJF5Ibv2tXr+Rkwndey1oaRS l+qtFU+1JIuLoDz+b2LS84xnhbOgRRFCNHilYEKvIGVRpjEZI9fT1oqiS/Q4UJiFknsD ppv+ZIpsnNDVE1fCwcYP9SICwAMOceGkz/YRSxVYS4sfrLMSusJp0s4/tuK5UqHq0+xY I1Ogud213027BDhFRZLr9NqcukPYLQ9LL2w83ljmfwEY7v2BTqJv/bXiQRrs3HQLVxgi S0Br2lOXpKTgPnllbcuR6ZS2IwXIgf3mGiDguFSV2WwadTwj2gE4u3Fh9GZZct4qt6n9 x+zw== X-Forwarded-Encrypted: i=1; AJvYcCXqKFq4uSqx05mmQLy0EAzmLzUoljYvQCzSQRQlKck/tc+E2BWxsQFm1t4QGtl7XLyExiA=@vger.kernel.org X-Gm-Message-State: AOJu0Ywpe4Oz9JXDCSXCZ1isG291QSfaeKMGuwxvaVRqb8xNoT2zoztb H2QIQsKUIuc9vSBRmJ18DZWo3vpA8IzDEq/R5mG60oLEvBe8FW1c8kytfiECSic= X-Google-Smtp-Source: AGHT+IHYFulm8IbiBhdXV1nK9KudvzS9bOu/G90SzgSlUd4JFIZSJ3Z4BWmXHZwIEjLVT7BYG6vLUw== X-Received: by 2002:a17:90a:ead2:b0:2e0:b741:cdc0 with SMTP id 98e67ed59e1d1-2e1e63217efmr6007810a91.32.1728115241103; Sat, 05 Oct 2024 01:00:41 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:40 -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 v2 2/8] riscv: Add Zawrs extension support Date: Sat, 5 Oct 2024 13:30:18 +0530 Message-ID: <20241005080024.11927-3-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823144 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 558C113BACC for ; Sat, 5 Oct 2024 08:00:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115246; cv=none; b=LaUuOvw4L9a/PpcBeXZe+3h0p0mLxpRPRTLEwI98NHwvsqxytWDCnh8FODH/kX3ejZ+rVNL9W2IkZHcYbk0YdrYktoXi+wzhC9tieP60ZoLnetmansZHki5uOkJp///dQ6v+r+lmsqVM1KdJwPQ13Ga5HrLKwUL0E78BKzPHPL4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115246; c=relaxed/simple; bh=XSqULW5lX/44tcrVgEul/UFTu+7LqRrG83usGSEiWXA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tG4OD46j0eq2/Y0UnxMhlgg3Ln3hD91NxgvK47DHtY1TWZQVvN0ILhaqoDQ5cpMDAD9PapZ3R/c1Lm6OnvF0U+dDLUMdGPSVz5axKCzDTzFe3dR1XmnB2m2kG64zdA/YXS3z+C90YNGAGD7DkAy6UAPvDTCw6DiDJTzu+mSo0k8= 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=becPqDEy; arc=none smtp.client-ip=209.85.216.54 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="becPqDEy" Received: by mail-pj1-f54.google.com with SMTP id 98e67ed59e1d1-2e075ceebdaso2155334a91.2 for ; Sat, 05 Oct 2024 01:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115244; x=1728720044; 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=UQsf+jR6aG4NjI4xejRTeVTRkVyoQSxLnCUJFtnhGtw=; b=becPqDEyY7pgWQ/vwWRkf29hdAqgk0j1hQxov8z94ULYyuNxDkGTW9hbW9kJNhzgJe DCoXME+vMU2w80r3JToZnsn+7KdjB4oUNsLU73f8XZk5lPsz5usKM5AQ0m0PRQoLry0e jZ5A+98hrt1yJgt8qK+aJ2oZtmCfqQ2kdZBejPs99vc48j26dz26QEV5NrqUBJQA0krU ydPImICnYXBdUhIr5pnLWjZ4052gEqvIvbq5CmikSjTQNJsP1mv7ucTHh8VsvgFUhbC0 t9ngncW3TdwtRVJ46L46AHt2iw9VUJX6iDefU3m0aAJ9A0abblZsXo+rQQPvspVHAeU7 L1NA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115244; x=1728720044; 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=UQsf+jR6aG4NjI4xejRTeVTRkVyoQSxLnCUJFtnhGtw=; b=W1o2Kl0geh92NV4anmKofb2akt6BlrVAOoQUajGC740h9pX7Guq49N2qMUpKnmcK10 lutUNqgtagiU4zXUVJNUSSCBsHQkHWzW+MX/Jkmpvix4QY4omzJvb7+GUmB0NdGnkxn5 8r84+z3uAVQcS7mqbo5+xbPvBZPW81vh1VhUfECPnaU6t/ruKK2dd3h6MOKtOfF5QgJH CNDsOHkA8tyPQPzYKwAoE1NQteS77o77udH9YPdstCVjivUe5KFDy4kPQd8IGWnlLyTC taLA61Zg1ijfZGXHUJzZ8Vc6g0Cg1jMy+O8DezoogokSprGj2Ph30ofxHTxjNLCycY6B OyQQ== X-Forwarded-Encrypted: i=1; AJvYcCXzg1dDFkbO2vZGLFOX8TKhsvWqaksDpFC+fxCLFUti2kl6joe90tsCVbqViSDPCZcQ6P4=@vger.kernel.org X-Gm-Message-State: AOJu0Yyrz4H8d4V2OjYU6jN9JpStS+i/iE4UEHhAGRr+CMonBpJGi51I eeDY3FI3J48xfWtABrMVtMFba0LmomGs46hNoj7SczWFhhPRZPOIHwRR94ljGh4= X-Google-Smtp-Source: AGHT+IGdz7RXo2myL3SxDLY6yZr6Hkugoz+QUjnFI/C6nrX2W1ljAdcvfo02FUviIgHA+yyHeYhQgw== X-Received: by 2002:a17:90a:2e89:b0:2e0:8e36:128 with SMTP id 98e67ed59e1d1-2e1e620f811mr6961515a91.5.1728115244474; Sat, 05 Oct 2024 01:00:44 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:44 -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 v2 3/8] riscv: Add Zca extension support Date: Sat, 5 Oct 2024 13:30:19 +0530 Message-ID: <20241005080024.11927-4-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823145 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 C6ADE13BACC for ; Sat, 5 Oct 2024 08:00:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115250; cv=none; b=eEyCuLJaOCTiVk7MuKXw6l7S+UZ8HqneDo0l3kNOvmqknHDkuy/0ctedUOUcQhHwL4JCbVaCek24/1RbN1JEys4NY21YZ+Fl4qlNgGU4I0jPsRz1LAJ5ymL65o9Ez2dUsbJRDqYPHe6Rvi3PbNj6p2RLfN+iWPrQsDLN+NLfMqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115250; c=relaxed/simple; bh=yE1Kx4xAasdzYern6qgCDMbQ6t3Ms3GDREOf9fVs0DQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=IZ3auMwEv0lshZHtNV+mTfi/7wDYV56+ZDFuFGXyxuS2RMgQaxTrQpOQVuJS1aMvGG6VtB7OCCEom65YHbWehJr5k3VpLTzj903wqLfni31WsCu2QIgcEujGlSfM1OZglfTi823vWkCLB2K5acVrZgta0Ip6fQdtKIAfdbkE0Ns= 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=LWmN3hXQ; arc=none smtp.client-ip=209.85.216.46 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="LWmN3hXQ" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-2e06acff261so2083438a91.2 for ; Sat, 05 Oct 2024 01:00:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115248; x=1728720048; 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=DM/N+JeqYmdY2NXCjdx0WYlyoYAIQjty9vGRP5j+u3c=; b=LWmN3hXQntkMzJZbXExEECsX9FXOiE0YIPF5ZuwsK1tegDSK4pTWyrLk3MIhJeN+0V yFd8ptAxYdofFFFBOGcYVeHqmag9JRT0TLTP1Vf6kX4SvCiVuXrvujaA3C+Ve+wbLTlN 0w/3rzES0hKZxyeqfDECUjAaHPpS0TFMyG7WKik1LWsEfSRsXncf6EM0G8aIp7+/uKsx RpItBtea03d+08DuZOSsVCJqYTy6eg5ZIMNOIMi2syqK6R6BeYjcnblPaIXtnsKxQYFA W2A1ue0/7T3A8pqsK3/3IOAT5kvwKWZgkIzCfERblOmzvUTTXmLKqn1OtXv7vIGtpi2i Aq5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115248; x=1728720048; 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=DM/N+JeqYmdY2NXCjdx0WYlyoYAIQjty9vGRP5j+u3c=; b=rJAbwKuqy3XJ/bc9YeQPz9rFI06yGFxb/tFhitPWsyZUajphMfOQh6DvvV5O7FlQA8 Rm35xUkrMVseO/I68SspLxHU8jwR7BiFhOqtJOCpsmuIMvyB0d3xJG83j14rGR9syxgv E85fQcwYsOpeQvO3WjEmKPZ7eOFpRb4lByK8/CxBANNoKh1zPog6doLQC3D7gN2bmm18 kXMXMRQz0+mChRFREPhCQiR3SkOQmLRoiNWYZMOcf1F8A2BOcrqxr/jCDBnQJUX5rANZ VLWNYFd6kVgnE7Wmk5CGaHUwGXZ2zRnrDjc+r3vNNAFYQ1a2yBw7mFEdA9CteQGaJdRA 44GQ== X-Forwarded-Encrypted: i=1; AJvYcCUsqZFgdxRLyy+znqVjSK7JV1NErToYLTZaTZlVv9inigwre2bUxACI4DjfTY0XipwTlWM=@vger.kernel.org X-Gm-Message-State: AOJu0YyXHetAv9+jExQZ2FR6nmNCtHcA1b6YsmFMcsC4a16eZeq5a8ba dTqeBiLeAyQCW61G35Iwj6QvJQjNIJq/irQrwS2IPfb9N26lRDgkQVJORzmjXqE= X-Google-Smtp-Source: AGHT+IGI+zpaqn3faEdRdE8+EoO4jUPW+w/Mg8yq3mm05z1gf+V8soWztvDLvAWEaG9XJ94CGTRTBg== X-Received: by 2002:a17:90a:458b:b0:2d3:d09a:630e with SMTP id 98e67ed59e1d1-2e1e6212e23mr6986690a91.1.1728115247905; Sat, 05 Oct 2024 01:00:47 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:47 -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 v2 4/8] riscv: Add Zcb extension support Date: Sat, 5 Oct 2024 13:30:20 +0530 Message-ID: <20241005080024.11927-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823146 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (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 1537F13BACC for ; Sat, 5 Oct 2024 08:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115253; cv=none; b=FkcDOa56e1MgwHrOqod3lTYvCjZihbmVHOB/KmcVYH8KN5Qu2iBv5AZYgSYWBtnM6+aMnzEAZkQfFAZPu3bQX1yT4JdSKwbSq5bqOE66oqRemfezALVe2leO7QziB6s3jDoj3hN44X3MhqTJ3Pish1FtcJEAXSYHNf7VoJBXECU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115253; c=relaxed/simple; bh=f9tV2toc+TQ5K0UcOm5fLBCCM43WQTdgk6longx/02o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lK9vkRZ/xLPhCpqkWEBmtBuWraSmNLndDXyxEt5MS+S3t4oYHPMYxtvxLUBkOS0cayDwypx5g8Yr/ERUO/j2b/XdYVj4KIOMyyI7ls/QHIXPEhFCPWCK+a1VqShIo73FJRbwb/MEU54lypV0jZdQmk2P/Kugwnk33tw1BV4Yu9g= 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=nOdIjOr/; arc=none smtp.client-ip=209.85.215.175 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="nOdIjOr/" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7e9c1a6488aso936040a12.3 for ; Sat, 05 Oct 2024 01:00:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115251; x=1728720051; 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=HljAqjEh40WC0r7IuZKgWy7tz4cBN23W4UZT2AmrxA8=; b=nOdIjOr/HCyOe7pzyYD6W8PaZluC7CFKdJr7KtcKCHs54UOkVvoGzpXq/uymk2o00r Ev1HJ/3hNRFwmNyD11pq4/ueaGfdg+hzjLYUrXu45S4X7AzJ38ZZaphOXsgD8aFoIAfN JXuYMe42ONrVFMaZOsAM1YsUmYbxCNv+GPTtoyXcVWfs9XPgRX86AhuPe2MOI7EnOP60 HPzjA8l2mZgSIwwsUv1mMOxkGo+6rOyP3IOXfbJaTmR0i8k94R2DYqyzYFL/kmlf7zsG FcAkMIF12O3SPy9um2KxQ15Y6jQBOJXo6dtJEmCqfjA3vTOxQHZS+djlWTJ2sIetdHQ5 eoUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115251; x=1728720051; 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=HljAqjEh40WC0r7IuZKgWy7tz4cBN23W4UZT2AmrxA8=; b=FNUifN0d/Mbh40rCBF2po6BEj/dXwTvIZmhi0wocx26nFFF6R27GHlJb4xDxeAsEN7 qS/GT9QfSvfC595wIdQJB+HOg55QSzALn0e6civzSDDofxM7j/uOiTDW6BX+Fq0Iy2rJ Vn9UhketZFB5WONjKPoAUp/2IVfYmK0V+mjdxyyXvcqULNEOIrWTT+YfzSfyi7tEkfTc +qmLVYUqJTc8/CZeTZcL+HzuqkYjUhtRwC8/IHMfQKo7Q1b/lDGZs6g3NEkLHhPozELA Ls75ZtEBbmV4ANsP+Se+8ewdPR/EbcFeTFWXh+9z09qp3ow8z4InCmvHfks1gS5lJTnW 12uQ== X-Forwarded-Encrypted: i=1; AJvYcCV8RZ8Yj1Q7+et5tD6l1S2dwc7cxbuZTVqPxYLt3qTeg3i9gAms/uBuDSp/49LsbR70gS0=@vger.kernel.org X-Gm-Message-State: AOJu0YwvJdTvvTqgXU8+a1pWGUMvHOpz8/pXnq5pcxnH1mH/O1tTUn9c N57MeBSS/P8P5jIlN/ouaCq48yZ71ogJpl7BwiTVIQrIAcS26kdGj18t1rZ5a1I= X-Google-Smtp-Source: AGHT+IEMy+RG9uZADphTMdKJaq51ppmQz37AVvkIvuuTaHCxFJfpj8n4zS76KNrs0Z3Z67iVp2abaQ== X-Received: by 2002:a17:90a:db15:b0:2c9:8105:483 with SMTP id 98e67ed59e1d1-2e1e621d982mr6330721a91.14.1728115251303; Sat, 05 Oct 2024 01:00:51 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:50 -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 v2 5/8] riscv: Add Zcd extension support Date: Sat, 5 Oct 2024 13:30:21 +0530 Message-ID: <20241005080024.11927-6-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823147 Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) (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 803B13BBE5 for ; Sat, 5 Oct 2024 08:00:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.172 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115256; cv=none; b=BOagxp/keD1M2hd5UeTlpI4/AGuYc8amaM5+Y3RbfeGwr4GmpbLeSAE2IRKV/0N0jBG3U+0aEpjb+PdEGRnDW3P2p6p4j8Qebpi2KZtpYcEgCt4qJvCCgwQsFgvFstJPz80UzWeCvdYcuM19iJkTZ71bBhPAQ8zVEEr4X0wp6Bc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115256; c=relaxed/simple; bh=XVF1WQ9KZ76Jsfv7PwKbQ/OrWT6WhW3brR0QdvN3BAQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J29g22tG4KSd6j44M0u1Kv5w21VOqvufNHg7tUvVe1ayWkOloct7DaNDls69/teov2v7UPCmqofw6XfyySLRzZrjGxHp0CsJC+sj2koXYIjOyUDP6sHEyWz3i5RLOdzjThtW8hEQRoy2EibsGFWM4+aj2V+27v63ZnkMHv+vz4s= 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=J4J+59Oc; arc=none smtp.client-ip=209.85.215.172 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="J4J+59Oc" Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-7e9ad969a4fso1738118a12.3 for ; Sat, 05 Oct 2024 01:00:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115255; x=1728720055; 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=LmybTeLafIZrz52+nkI2/NJw79JJM3DNNtuVN/7MlKI=; b=J4J+59OcsgbQv5RbyuYHaBYvnRgTfuB75cSZnwSHqtlD9soXDPnYCKfFBpJjcTBB+4 8KJqgyHPV+sg6FVi2b5c48DJSHKmMsX6UU4ra1k9A5kdquYm/BbA92DQoqZLkgCK+ezU c07juHtYI442QwpuXp8SwyzklRncHNhiZ6fSZ1zb9lpd9jK8vCHCOGi/Ksc+YuvbaQRf GAsbFki9CkYEYb1MzU1dqESI0jdZrkJk4BHZEllbGVta7K+S0lhv2epMys4t+j20Z0tt H/Z/+IJyCqfiE/+pd2mTs+gdK3SgkgNdjNguIuHNf3ALGs9uJBUE3cG71mW3Dak7qO9n ZOuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115255; x=1728720055; 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=LmybTeLafIZrz52+nkI2/NJw79JJM3DNNtuVN/7MlKI=; b=ZZR+8CJigWIZwQ+6E6rCKlTT5ONHjtP7vgdojmh/tSFX1ypoctVB5uUqJK37iiHYmw NWBl5hkX8+fejUP1M8t4OBT1zPvxl40EFpRXXnVXYcP0ENpz5Bu/yh8kX46WCJOCCKHP HdQYEmpgcq6ztjRHRb+RRsAK0m4EcOMBVBQFo949LS26CP6uefDJ0O3LAiNSiLArfM+M COGMQ8jEnnowM4RBlS0U+gLNLFqy0w6Ii8I3wwiXBxsVMM6AovUvlQJE8hX6ZE+zfrhO BnjldkBRSkfX5TnPJloq6kTz6iT5lS0Pg30jneNWnKRAmhWQSfwc/d1gufSeOjzz4JZL q1ag== X-Forwarded-Encrypted: i=1; AJvYcCWj7KLh9Ssnag/9GHZ2FTGShQ6xGP7vAFFJOHzutBz+iCZyHkSX4W8A994l98gNjfrEQaU=@vger.kernel.org X-Gm-Message-State: AOJu0YwQmbEl/ECWfONu/R2GjHLxI3AyQtY+8zIFOs8dV141NaJTR9O9 lN4TPOVP1jO+U89NNoZ9oKnK2+76WYFJ6Agam0YTn0R014qyGUgH74lr8CThsZo= X-Google-Smtp-Source: AGHT+IErnaAyF3ld/LYVn+AMd6izGlb8aMyu0/kmBAaADlnMthfegJsNXGpxI4wvBmpB1P+W7Bh17g== X-Received: by 2002:a17:90b:4c0d:b0:2d3:b438:725f with SMTP id 98e67ed59e1d1-2e1e62a978bmr6436964a91.24.1728115254716; Sat, 05 Oct 2024 01:00:54 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:54 -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 v2 6/8] riscv: Add Zcf extension support Date: Sat, 5 Oct 2024 13:30:22 +0530 Message-ID: <20241005080024.11927-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823148 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 EF6ED13C695 for ; Sat, 5 Oct 2024 08:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115260; cv=none; b=Ri5rn4+HywgnMvwF7q/AE1m7AotrIFo2XMrnMCji4hlBFikAobT60kG8lQvW14nZGDTlXFKReqPXYQO9ZDJY2K4CKIaDPrcV3BB2dqqdgpAQyz7cBK7hwFyMG3ZIeXzhFOBq47A48FO512l2OGuSyh6f/BqIA16BXyLMDh5sOK0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115260; c=relaxed/simple; bh=48fBplDQf/5b31hPKpVYiFGrrKJCSEau4WtSsTZiRoM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=msy8jJHxIhHR7Sj5sF6+9moqdfSFn1XcgbNf28sxZh1NginYOTlZ3f8QXfc+mcNvdt/E1gWJHxksSuVZdQxECYCNLgx2ToGTCNbRHJqsub69Oz36P1GIs7qbkyFmCwvBU3rYJX3i7akI4p8QTGKBeWg9UKjWWCEOz1e/OgVupDg= 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=Sl7k8dk8; arc=none smtp.client-ip=209.85.216.53 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="Sl7k8dk8" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-2e0b93157caso2845372a91.0 for ; Sat, 05 Oct 2024 01:00:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115258; x=1728720058; 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=Gp/7S79lB5Zh9ge2+3juA9ZZ6e+lGqyh8phLoy4Fqkk=; b=Sl7k8dk8bKTzkPKMpQxH4E2ZLzodWycWe690yTikpc4daGSyg5pCz5F6mFOY8PxtXj 42VzjEj7Mu2cdJTgVNQF9r/TfbdQ3ttHa5ZsKX776ZRDNaKK2DWfjEhyWVPEC8RdTK7o zVQOCf78vSt5zEI/4DOhF02O7hNPp6WWVnL9QHV8NRBiWLJ1OaKDNCz49f+FFIuQHQg5 qZIqK4xSHCE2LyvR/tjxhhaPg6BHpfotbziscwSpUZnfKndnp5Y87Kme7P0lBTujXpXq lT9smEmKDQmKIjGTybh7MUptTtNF3QDLZ0fmqLx4R0VtyZQt6ZzqbXY80aRB4khMwGku fccQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115258; x=1728720058; 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=Gp/7S79lB5Zh9ge2+3juA9ZZ6e+lGqyh8phLoy4Fqkk=; b=gn4n1Abwo9rY/OAqbOR8zlJnLP1YvS+fc8Nl2HQvnDULSRv45+pE9klWNvyLqvuGD5 v6x1MiyzXDRkmlj7JUOKOcPbI94hHvk8FMkQW6rR7wBR5G0lZkfUMlzH4w9WvCyz2XJ3 3jtPFIPqbw9g1yE65upZe1guSO8QHsDa7SappsVJqQMk5WFqiMBe2hmr0m+33pCc5lQo Yhu58XTQ2odWVZf2i4wpApdNjAmcT5fSa3myVSigAbkte1AeXJ0xyRLywYJJUfXNh8Yz m17doPw+8q44eK2lQndYKXcWykt+sYYAewttcfWElroDDheuNaoqLAdAn15XCal+dDAD WMeg== X-Forwarded-Encrypted: i=1; AJvYcCUnppZSdvqLDOM4JQXVWEKnCXgJFrdJQUVPW8VKFXvlPxnCU8UVDBz1giVITaspTAD5KqA=@vger.kernel.org X-Gm-Message-State: AOJu0YzjluIj/IW/EfyCjSfVD/+lEd+IhSXVuH9Y8VwqypC6pJ/acRHv hR94XBbzQWiq9fdCLBkUX0Ukg30XTvHQAi9jCG8fiGGcWQeIl6spdwVVO0DDoDE= X-Google-Smtp-Source: AGHT+IEDZJvYZpmKhOvnAXoBzEjVj+AbmrCTo3BeIUBTxFpCKHeb5hYPdw96NRfXJTvlxB8Q4+bATg== X-Received: by 2002:a17:90a:3482:b0:2d8:85fc:464c with SMTP id 98e67ed59e1d1-2e1b38c6e58mr14082877a91.11.1728115258179; Sat, 05 Oct 2024 01:00:58 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:00:57 -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 v2 7/8] riscv: Add Zcmop extension support Date: Sat, 5 Oct 2024 13:30:23 +0530 Message-ID: <20241005080024.11927-8-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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 Oct 5 08:00:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 13823149 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 7DFEE3BBE5 for ; Sat, 5 Oct 2024 08:01:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115263; cv=none; b=i0kP2nuvUJqI1Rkj4NDG/6a62WyE3WAEIQyMMyRD37EjaU5FietJrVrBV0TZiJGLmr1FwSKsSkYn17WguimpIotaIDHDT714kDN+MPWz6HnJsebsZDqtTX16UC/XTADNnwQgb3Au9jmQZaLlE3qojOK3ilWGb17Tc5cpNFMDYho= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728115263; c=relaxed/simple; bh=ZHKp6susW+DmRi09Ty1jgVH69v0kE/OAgAo9YVToyXs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DfqzLiLm+DrxfwsSiojGKy2oG8geYEfHDdAg5QL0NCCJUY+cDefUWY4nhhoVmBsSSS/BB9WlQYSe88UTxw3RAbnGCP6cBLGNRsRUE65urx+yQpBb6ZFoEBT74LaOl9lHdZ3EjmBMYjXa1K3hLXqxXAu0J7zEWN2YdajtyfQBu5U= 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=jsuN7eKg; arc=none smtp.client-ip=209.85.216.42 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="jsuN7eKg" Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-2e1c91fe739so1996817a91.2 for ; Sat, 05 Oct 2024 01:01:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1728115262; x=1728720062; 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=LnTudTyVELXhybVtVq++J6lTF/E6Jxcldx86tlZwzWc=; b=jsuN7eKgJ7FwY5O1rYyqeGvkCIOMGVhdK8Uf3DBfvHsjVVF9Ld08Qd2iJDW2qUOyN3 E0nbv8qO0UUDuACwT1/msRh3YruvTm/Gisuuaq7Vm8e9IcOoXkMM8CwRCYiwS/2fJcBc QRveV7j+fnCf7/Ka4mA6LEvkPdQmYdsfc0C29xNtRjhNsQlAmL1rqDH/rpjptTftPFBo idA+1dXLBgZfS8Xrf3YPWzyeqJnmS4dN+J7KPZnJnMR8vmFWu5WMFgIZxh3JWoJxVB7r YOej+B6WVwT7Kz04yDoB8o9hyfaaVF4v/TrsZSx2bWtLY2t3a2679fn353UZQq7UVIdY ywTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728115262; x=1728720062; 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=LnTudTyVELXhybVtVq++J6lTF/E6Jxcldx86tlZwzWc=; b=W/AAk115beNuvYeguZh71UlMPr7CdbNWM2ihLOD7xkLHPdB4rlOMJNKYugjyvGE35z FWSnJ5CE1OT1sAnmuYRzKeJZ3hk5ZBGQF2IR6MC0DK3/LFdUQZw1Ff9rfmUNtja/HmoL 1Bf5+Rq8f3jojrXmDgdZSN+NrBuOtSkrs5EeHS1/APWYsaVotVkvz4ZBhfwuDFCnUpvK qtZrbUfTw8zuxdwikSVh7rohVCjzb4a69VOD/0PrPTonn5nyi+3Xisu17lB7kHNsFtH6 g8cJ84PMgioHdA8uz49wyBHn6WGfzzsfiQEj4LiiZbj/Wj/eYICqmUQKrJpd9FX+A8eX YZ3A== X-Forwarded-Encrypted: i=1; AJvYcCX22TKVxWcQ+zQMPdG4T54nvU98LkBEyE6Fwb2yw5lEAWmE/wqKZAtgmoFU++7uoaVfEyA=@vger.kernel.org X-Gm-Message-State: AOJu0Yz02CUGVE7SVGOY8Fs1iAglrapZEN6k9KvYu1bcWnGqaWFddwuD QzzAjx1d0OwbwMM93u+ppi2E2Lh+X9mVBkUn7fteEqf3fJBETOoVnzHW90oNGgE= X-Google-Smtp-Source: AGHT+IEnuOzukj3EhhTiLkX34VWObsDOqzoeGnbWToEK7upZYPpjOZtBKbVZDiiQSLbHdYOq3pg6gQ== X-Received: by 2002:a17:90a:e7c7:b0:2e0:9b59:c0d0 with SMTP id 98e67ed59e1d1-2e1e63e3315mr4881500a91.41.1728115261841; Sat, 05 Oct 2024 01:01:01 -0700 (PDT) Received: from anup-ubuntu-vm.localdomain ([223.185.135.6]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e20ae69766sm1259172a91.8.2024.10.05.01.00.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Oct 2024 01:01:01 -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 v2 8/8] riscv: Add Zimop extension support Date: Sat, 5 Oct 2024 13:30:24 +0530 Message-ID: <20241005080024.11927-9-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241005080024.11927-1-apatel@ventanamicro.com> References: <20241005080024.11927-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 --- 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"), \