Re: [PATCH 4/4] hw/net: Fix the transmission return size

2024-06-03 Thread Fea Wang
I just encountered this issue when running Linux, and the trouble will be fixed after the patches. So I think they work. Sincerely, Fea On Mon, Jun 3, 2024 at 6:31 PM Edgar E. Iglesias wrote: > On Mon, Jun 3, 2024 at 7:48 AM Fea.Wang wrote: > >> Fix the transmission return size because not all

Re: [PATCH 2/4] hw/dma: Break the loop when loading descriptions fails

2024-06-03 Thread Fea Wang
Hi Edgar, thank you for the advice, I will squash them in the next version of the patch series. Sincerely, Fea On Mon, Jun 3, 2024 at 6:21 PM Edgar E. Iglesias wrote: > On Mon, Jun 3, 2024 at 7:48 AM Fea.Wang wrote: > >> When calling the loading a description function, it should be noticed >>

[PULL 29/45] i386/sev: Add the SNP launch start context

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh The SNP_LAUNCH_START is called first to create a cryptographic launch context within the firmware. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-16-pankaj.gu...@amd.co

[PULL 42/45] i386/sev: Allow measured direct kernel boot on SNP

2024-06-03 Thread Paolo Bonzini
From: Dov Murik In SNP, the hashes page designated with a specific metadata entry published in AmdSev OVMF. Therefore, if the user enabled kernel hashes (for measured direct boot), QEMU should prepare the content of hashes table, and during the processing of the metadata entry it copy the conten

[PULL 37/45] i386/sev: Invoke launch_updata_data() for SNP class

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta Invoke as sev_snp_launch_update_data() for SNP object. Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-27-pankaj.gu...@amd.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/target/i386/sev

[PULL 05/45] host/i386: assume presence of SSE2

2024-06-03 Thread Paolo Bonzini
QEMU now requires an x86-64-v2 host, which has SSE2. Use it freely in buffer_is_zero. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - util/bufferiszero.c | 4 ++-- util/cpuinfo-i386.c | 1 - 3 files changed, 2 ins

Re: [PATCH v2 4/4] vga/cirrus: deprecate, don't build by default

2024-06-03 Thread Mark Cave-Ayland
On 03/06/2024 12:40, Daniel P. Berrangé wrote: On Thu, May 30, 2024 at 01:22:11PM +0100, Mark Cave-Ayland wrote: On 30/05/2024 12:40, BALATON Zoltan wrote: On Thu, 30 May 2024, Gerd Hoffmann wrote: stdvga is the much better option. Signed-off-by: Gerd Hoffmann --- hw/display/cirrus_vga.c  

[PULL 20/45] i386/sev: Move sev_launch_finish to separate class method

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta When sev-snp-guest objects are introduced there will be a number of differences in how the launch finish is handled compared to the existing sev-guest object. Move sev_launch_finish() to a class method to make it easier to implement SNP-specific launch update functionality late

[PULL 30/45] i386/sev: Add handling to encrypt/finalize guest launch data

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh Process any queued up launch data and encrypt/measure it into the SNP guest instance prior to initial guest launch. This also updates the KVM_SEV_SNP_LAUNCH_UPDATE call to handle partial update responses. Signed-off-by: Brijesh Singh Co-developed-by: Michael Roth Signed-of

[PULL 31/45] i386/sev: Set CPU state to protected once SNP guest payload is finalized

2024-06-03 Thread Paolo Bonzini
From: Michael Roth Once KVM_SNP_LAUNCH_FINISH is called the vCPU state is copied into the vCPU's VMSA page and measured/encrypted. Any attempt to read/write CPU state afterward will only be acting on the initial data and so are effectively no-ops. Set the vCPU state to protected at this point so

[PULL 10/45] target/i386/tcg: Fix RDPID feature check

2024-06-03 Thread Paolo Bonzini
From: Zhao Liu DisasContext.cpuid_ext_features indicates CPUID.01H.ECX. Use DisasContext.cpuid_7_0_ecx_features field to check RDPID feature bit (CPUID_7_0_ECX_RDPID). Fixes: 6750485bf42a ("target/i386: implement RDPID in TCG") Inspired-by: Xinyu Li Signed-off-by: Zhao Liu Message-ID: <202406

[PULL 45/45] hw/i386: Add support for loading BIOS using guest_memfd

2024-06-03 Thread Paolo Bonzini
From: Michael Roth When guest_memfd is enabled, the BIOS is generally part of the initial encrypted guest image and will be accessed as private guest memory. Add the necessary changes to set up the associated RAM region with a guest_memfd backend to allow for this. Current support centers around

[PULL 43/45] memory: Introduce memory_region_init_ram_guest_memfd()

2024-06-03 Thread Paolo Bonzini
From: Xiaoyao Li Introduce memory_region_init_ram_guest_memfd() to allocate private guset memfd on the MemoryRegion initialization. It's for the use case of TDVF, which must be private on TDX case. Signed-off-by: Xiaoyao Li Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <

[PULL 41/45] i386/sev: Reorder struct declarations

2024-06-03 Thread Paolo Bonzini
From: Dov Murik Move the declaration of PaddedSevHashTable before SevSnpGuest so we can add a new such field to the latter. No functional change intended. Signed-off-by: Dov Murik Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-23-pankaj.gu...@amd.

[PULL 36/45] i386/sev: Invoke launch_updata_data() for SEV class

2024-06-03 Thread Paolo Bonzini
Add launch_update_data() in SevCommonStateClass and invoke as sev_launch_update_data() for SEV object. Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-26-pankaj.gu...@amd.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 11 --- 1 file changed, 8 insertions(+), 3

[PULL 26/45] i386/sev: Don't return launch measurements for SEV-SNP guests

2024-06-03 Thread Paolo Bonzini
From: Michael Roth For SEV-SNP guests, launch measurement is queried from within the guest during attestation, so don't attempt to return it as part of query-sev-launch-measure. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-13-pankaj.gu...@amd.com>

[PULL 44/45] hw/i386/sev: Use guest_memfd for legacy ROMs

2024-06-03 Thread Paolo Bonzini
From: Michael Roth Current SNP guest kernels will attempt to access these regions with with C-bit set, so guest_memfd is needed to handle that. Otherwise, kvm_convert_memory() will fail when the guest kernel tries to access it and QEMU attempts to call KVM_SET_MEMORY_ATTRIBUTES to set these range

[PULL 38/45] i386/kvm: Add KVM_EXIT_HYPERCALL handling for KVM_HC_MAP_GPA_RANGE

2024-06-03 Thread Paolo Bonzini
From: Michael Roth KVM_HC_MAP_GPA_RANGE will be used to send requests to userspace for private/shared memory attribute updates requested by the guest. Implement handling for that use-case along with some basic infrastructure for enabling specific hypercall events. Signed-off-by: Michael Roth Si

[PULL 18/45] i386/sev: Introduce "sev-common" type to encapsulate common SEV state

2024-06-03 Thread Paolo Bonzini
From: Michael Roth Currently all SEV/SEV-ES functionality is managed through a single 'sev-guest' QOM type. With upcoming support for SEV-SNP, taking this same approach won't work well since some of the properties/state managed by 'sev-guest' is not applicable to SEV-SNP, which will instead rely

[PULL 14/45] linux-headers: Update to current kvm/next

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta This updates kernel headers to commit 6f627b425378 ("KVM: SVM: Add module parameter to enable SEV-SNP", 2024-05-12). The SNP host patches will be included in Linux 6.11, to be released next July. Also brings in an linux-headers/linux/vhost.h fix from v6.9-rc4. Co-developed-b

[PULL 23/45] i386/sev: Add sev_kvm_init() override for SEV class

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta Some aspects of the init routine SEV are specific to SEV and not applicable for SNP guests, so move the SEV-specific bits into separate class method and retain only the common functionality. Co-developed-by: Michael Roth Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupt

[PULL 13/45] update-linux-headers: move pvpanic.h to correct directory

2024-06-03 Thread Paolo Bonzini
Linux has , not . Use the same directory for QEMU's include/standard-headers/ copy. Reviewed-by: Thomas Huth Signed-off-by: Paolo Bonzini --- include/standard-headers/{linux => misc}/pvpanic.h | 0 hw/misc/pvpanic-isa.c | 2 +- hw/misc/pvpanic-pci.c

[PULL 24/45] i386/sev: Add snp_kvm_init() override for SNP class

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta SNP does not support SMM and requires guest_memfd for private guest memory, so add SNP specific kvm_init() functionality in snp_kvm_init() class method. Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816

[PULL 27/45] i386/sev: Add a class method to determine KVM VM type for SNP guests

2024-06-03 Thread Paolo Bonzini
SEV guests can use either KVM_X86_DEFAULT_VM, KVM_X86_SEV_VM, or KVM_X86_SEV_ES_VM depending on the configuration and what the host kernel supports. SNP guests on the other hand can only ever use KVM_X86_SNP_VM, so split determination of VM type out into a separate class method that can be set acco

[PULL 39/45] i386/sev: Enable KVM_HC_MAP_GPA_RANGE hcall for SNP guests

2024-06-03 Thread Paolo Bonzini
From: Michael Roth KVM will forward GHCB page-state change requests to userspace in the form of KVM_HC_MAP_GPA_RANGE, so make sure the hypercall handling is enabled for SNP guests. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-32-pankaj.gu...@amd.c

[PULL 28/45] i386/sev: Update query-sev QAPI format to handle SEV-SNP

2024-06-03 Thread Paolo Bonzini
From: Michael Roth Most of the current 'query-sev' command is relevant to both legacy SEV/SEV-ES guests and SEV-SNP guests, with 2 exceptions: - 'policy' is a 64-bit field for SEV-SNP, not 32-bit, and the meaning of the bit positions has changed - 'handle' is not relevant to SEV-SNP To

[PULL 25/45] i386/cpu: Set SEV-SNP CPUID bit when SNP enabled

2024-06-03 Thread Paolo Bonzini
From: Michael Roth SNP guests will rely on this bit to determine certain feature support. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-12-pankaj.gu...@amd.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 1 + 1 file changed, 1 insertion

[PULL 17/45] i386/sev: Replace error_report with error_setg

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta Signed-off-by: Pankaj Gupta Message-ID: <20240530111643.1091816-2-pankaj.gu...@amd.com> Signed-off-by: Paolo Bonzini --- target/i386/sev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/sev.c b/target/i386/sev.c index d30b68c11e4..67ed3

[PULL 03/45] meson: assume x86-64-v2 baseline ISA

2024-06-03 Thread Paolo Bonzini
x86-64-v2 processors were released in 2008, assume that we have one. Unfortunately there is no GCC flag to enable all the features without disabling what came after; so enable them one by one. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- meson.build | 10 +++--- 1 file ch

[PULL 32/45] hw/i386/sev: Add function to get SEV metadata from OVMF header

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh A recent version of OVMF expanded the reset vector GUID list to add SEV-specific metadata GUID. The SEV metadata describes the reserved memory regions such as the secrets and CPUID page used during the SEV-SNP guest launch. The pc_system_get_ovmf_sev_metadata_ptr() is used to

[PULL 40/45] i386/sev: Extract build_kernel_loader_hashes

2024-06-03 Thread Paolo Bonzini
From: Dov Murik Extract the building of the kernel hashes table out from sev_add_kernel_loader_hashes() to allow building it in other memory areas (for SNP support). No functional change intended. Signed-off-by: Dov Murik Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Message-ID: <2

[PULL 33/45] i386/sev: Add support for populating OVMF metadata pages

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh OVMF reserves various pages so they can be pre-initialized/validated prior to launching the guest. Add support for populating these pages with the expected content. Signed-off-by: Brijesh Singh Signed-off-by: Michael Roth Co-developed-by: Pankaj Gupta Signed-off-by: Pankaj

[PULL 35/45] hw/i386/sev: Add support to encrypt BIOS when SEV-SNP is enabled

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh As with SEV, an SNP guest requires that the BIOS be part of the initial encrypted/measured guest payload. Extend sev_encrypt_flash() to handle the SNP case and plumb through the GPA of the BIOS location since this is needed for SNP. Signed-off-by: Brijesh Singh Signed-off-by

[PULL 34/45] i386/sev: Add support for SNP CPUID validation

2024-06-03 Thread Paolo Bonzini
From: Michael Roth SEV-SNP firmware allows a special guest page to be populated with a table of guest CPUID values so that they can be validated through firmware before being loaded into encrypted guest memory where they can be used in place of hypervisor-provided values[1]. As part of SEV-SNP g

[PULL 19/45] i386/sev: Move sev_launch_update to separate class method

2024-06-03 Thread Paolo Bonzini
From: Pankaj Gupta When sev-snp-guest objects are introduced there will be a number of differences in how the launch data is handled compared to the existing sev-guest object. Move sev_launch_start() to a class method to make it easier to implement SNP-specific launch update functionality later.

[PULL 11/45] target/i386: fix xsave.flat from kvm-unit-tests

2024-06-03 Thread Paolo Bonzini
xsave.flat checks that "executing the XSETBV instruction causes a general- protection fault (#GP) if ECX = 0 and EAX[2:1] has the value 10b". QEMU allows that option, so the test fails. Add the condition. Cc: qemu-sta...@nongnu.org Fixes: 892544317fe ("target/i386: implement XSAVE and XRSTOR of

[PULL 22/45] i386/sev: Add a sev_snp_enabled() helper

2024-06-03 Thread Paolo Bonzini
From: Michael Roth Add a simple helper to check if the current guest type is SNP. Also have SNP-enabled imply that SEV-ES is enabled as well, and fix up any places where the sev_es_enabled() check is expecting a pure/non-SNP guest. Signed-off-by: Michael Roth Signed-off-by: Pankaj Gupta Messag

[PULL 07/45] host/i386: assume presence of POPCNT

2024-06-03 Thread Paolo Bonzini
QEMU now requires an x86-64-v2 host, which has the POPCNT instruction. Use it freely in TCG-generated code. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - tcg/i386/tcg-target.h| 5 ++--- util/cpuinfo-i386.c | 1 -

[PULL 09/45] target/i386: fix memory opsize for Mov to/from Seg

2024-06-03 Thread Paolo Bonzini
From: Xinyu Li This commit fixes an issue with MOV instructions (0x8C and 0x8E) involving segment registers; MOV to segment register's source is 16-bit, while MOV from segment register has to explicitly set the memory operand size to 16 bits. Introduce a new flag X86_SPECIAL_Op0_Mw to handle thi

[PULL 15/45] update-linux-headers: import linux/kvm_para.h header

2024-06-03 Thread Paolo Bonzini
Right now QEMU is importing arch/x86/include/uapi/asm/kvm_para.h because it includes definitions for kvmclock and for KVM CPUID bits. However, other definitions for KVM hypercall values and return codes are included in include/uapi/linux/kvm_para.h and they will be used by SEV-SNP. To ensure that

[PULL 16/45] machine: allow early use of machine_require_guest_memfd

2024-06-03 Thread Paolo Bonzini
Ask the ConfidentialGuestSupport object whether to use guest_memfd for KVM-backend private memory. This bool can be set in instance_init (or user_complete) so that it is available when the machine is created. Signed-off-by: Paolo Bonzini --- include/exec/confidential-guest-support.h | 5 +

[PULL 21/45] i386/sev: Introduce 'sev-snp-guest' object

2024-06-03 Thread Paolo Bonzini
From: Brijesh Singh SEV-SNP support relies on a different set of properties/state than the existing 'sev-guest' object. This patch introduces the 'sev-snp-guest' object, which can be used to configure an SEV-SNP guest. For example, a default-configured SEV-SNP guest with no additional information

[PULL 12/45] update-linux-headers: fix forwarding to asm-generic headers

2024-06-03 Thread Paolo Bonzini
Afer commit 3efc75ad9d9 ("scripts/update-linux-headers.sh: Remove temporary directory inbetween", 2024-05-29), updating linux-headers/ results in errors such as cp: cannot stat '/tmp/tmp.1A1Eejh1UE/headers/include/asm/bitsperlong.h': No such file or directory because Loongarch does not have a

[PULL 04/45] host/i386: assume presence of CMOV

2024-06-03 Thread Paolo Bonzini
QEMU now requires an x86-64-v2 host, which always has CMOV. Use it freely in TCG generated code. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - util/cpuinfo-i386.c | 1 - tcg/i386/tcg-target.c.inc| 15 +-

[PULL 02/45] host/i386: nothing looks at CPUINFO_SSE4

2024-06-03 Thread Paolo Bonzini
The only user was the SSE4.1 variant of buffer_is_zero, which has been removed; code to compute CPUINFO_SSE4 is dead. Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- host/include/i386/host/cpuinfo.h | 1 - util/cpuinfo-i386.c | 1

[PULL 08/45] target/i386: fix SSE and SSE2 feature check

2024-06-03 Thread Paolo Bonzini
From: Xinyu Li Features check of CPUID_SSE and CPUID_SSE2 should use cpuid_features, rather than cpuid_ext_features. Signed-off-by: Xinyu Li Reviewed-by: Zhao Liu Message-ID: <20240602100904.2137939-1-lixinyu...@ict.ac.cn> Signed-off-by: Paolo Bonzini --- target/i386/tcg/decode-new.c.inc | 4

[PULL 06/45] host/i386: assume presence of SSSE3

2024-06-03 Thread Paolo Bonzini
QEMU now requires an x86-64-v2 host, which has SSSE3 instructions (notably, PSHUFB which is used by QEMU's AES implementation). Do not bother checking it. Reviewed-by: Richard Henderson Signed-off-by: Paolo Bonzini --- util/cpuinfo-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-

[PULL 01/45] virtio-blk: remove SCSI passthrough functionality

2024-06-03 Thread Paolo Bonzini
The legacy SCSI passthrough functionality has never been enabled for VIRTIO 1.0 and was deprecated more than four years ago. Get rid of it---almost, because QEMU is advertising it unconditionally for legacy virtio-blk devices. Just parse the header and return a nonzero status. Signed-off-by: Pao

[PULL 00/45] mostly i386 patches for 2024-06-04

2024-06-03 Thread Paolo Bonzini
The following changes since commit 3b2fe44bb7f605f179e5e7feb2c13c2eb3abbb80: Merge tag 'pull-request-2024-05-29' of https://gitlab.com/thuth/qemu into staging (2024-05-29 08:38:20 -0700) are available in the Git repository at: https://gitlab.com/bonzini/qemu.git tags/for-upstream for you t

Re: [PATCH v5 0/4] RISC-V: Modularize common match conditions for trigger

2024-06-03 Thread Alistair Francis
On Tue, Jun 4, 2024 at 2:42 PM Alvin Chang via wrote: > > According to RISC-V Debug specification ratified version 0.13 [1] > (also applied to version 1.0 [2] but it has not been ratified yet), the > enabled privilege levels of the trigger is common match conditions for > all the types of the trig

Re: [PATCH 1/4] hw/dma: Enhance error handling in loading description

2024-06-03 Thread Fea Wang
Hi Edgar, Thank you for recommending to me. I will make the change in the next version of the patch series. Sincerely, Fea On Mon, Jun 3, 2024 at 6:19 PM Edgar E. Iglesias wrote: > On Mon, Jun 3, 2024 at 7:47 AM Fea.Wang wrote: > >> Loading a description from memory may cause a bus-error. In t

Re: [PATCH v5 37/65] i386/tdvf: Introduce function to parse TDVF metadata

2024-06-03 Thread Duan, Zhenzhong
On 2/29/2024 2:36 PM, Xiaoyao Li wrote: From: Isaku Yamahata TDX VM needs to boot with its specialized firmware, Trusted Domain Virtual Firmware (TDVF). QEMU needs to parse TDVF and map it in TD guest memory prior to running the TDX VM. A TDVF Metadata in TDVF image describes the structure o

Re: [PATCH v2 1/3] stdvga: fix screen blanking

2024-06-03 Thread Marc-André Lureau
Hi On Mon, Jun 3, 2024 at 7:18 PM Gerd Hoffmann wrote: > > In case the display surface uses a shared buffer (i.e. uses vga vram > directly instead of a shadow) go unshare the buffer before clearing it. > > This avoids vga memory corruption, which in turn fixes unblanking not > working properly wi

Re: [PATCH v2 00/37] target/sparc: Implement VIS4

2024-06-03 Thread Mark Cave-Ayland
On 28/05/2024 22:29, Mark Cave-Ayland wrote: On 26/05/2024 20:42, Richard Henderson wrote: Now tested with RISU, using a Solaris M8 host as reference. This exposed a few bugs in the existing VIS1 support as well, so fix those before anything else.  It also exposed a few bugs in the implementat

[PATCH v3 6/6] target/riscv: Reserve exception codes for sw-check and hw-err

2024-06-03 Thread Fea.Wang
Based on the priv-1.13.0, add the exception codes for Software-check and Hardware-error. Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: LIU Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu_bits.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu_bi

[PATCH v3 4/6] target/riscv: Add 'P1P13' bit in SMSTATEEN0

2024-06-03 Thread Fea.Wang
Based on privilege 1.13 spec, there should be a bit56 for 'P1P13' in mstateen0 that controls access to the hedeleg. Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: Weiwei Li --- target/riscv/cpu_bits.h | 1 + target/riscv/csr.c | 8 2 files changed, 9 insertions(+)

[PATCH v3 1/6] target/riscv: Reuse the conversion function of priv_spec

2024-06-03 Thread Fea.Wang
From: Jim Shu Public the conversion function of priv_spec in cpu.h, so that tcg-cpu.c could also use it. Signed-off-by: Jim Shu Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: LIU Zhiwei Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 2 +- target/riscv/cpu.h

[PATCH v3 3/6] target/riscv: Support the version for ss1p13

2024-06-03 Thread Fea.Wang
Add RISC-V privilege 1.13 support. Signed-off-by: Fea.Wang Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: Weiwei Li Reviewed-by: LIU Zhiwei --- target/riscv/cpu.c | 6 +- target/riscv/tcg/tcg-cpu.c | 4 2 files changed, 9 insertions(+), 1 deletion(-) diff --g

[PATCH v3 5/6] target/riscv: Add MEDELEGH, HEDELEGH csrs for RV32

2024-06-03 Thread Fea.Wang
Based on privileged spec 1.13, the RV32 needs to implement MEDELEGH and HEDELEGH for exception codes 32-47 for reserving and exception codes 48-63 for custom use. Add the CSR number though the implementation is just reading zero and writing ignore. Besides, for accessing HEDELEGH, it should be cont

[PATCH] qtest/x86/numa-test: do not use the obsolete 'pentium' cpu

2024-06-03 Thread Ani Sinha
'pentium' cpu is old and obsolete and should be avoided for running tests if its not strictly needed. Use 'max' cpu instead for generic non-cpu specific numa test. CC: th...@redhat.com Signed-off-by: Ani Sinha --- tests/qtest/numa-test.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) d

[PATCH v3 0/6] target/riscv: Support RISC-V privilege 1.13 spec

2024-06-03 Thread Fea.Wang
Based on the change log for the RISC-V privilege 1.13 spec, add the support for ss1p13. base-commit: 915758c537b5fe09575291f4acd87e2d377a93de * Correct the mstateen0 for P1P13 in commit message * Refactor commit by splitting to two commits [v2] * Check HEDELEGH by hmode32 instead of any32 * Remo

[PATCH v3 2/6] target/riscv: Define macros and variables for ss1p13

2024-06-03 Thread Fea.Wang
Add macros and variables for RISC-V privilege 1.13 support. Signed-off-by: Fea.Wang Reviewed-by: Frank Chang Reviewed-by: Weiwei Li Reviewed-by: LIU Zhiwei --- target/riscv/cpu.h | 4 +++- target/riscv/cpu_cfg.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/target/r

Re: [PATCH] hw/core: Rename CpuTopology to CPUTopology

2024-06-03 Thread Zhao Liu
On Tue, Jun 04, 2024 at 07:29:15AM +0200, Markus Armbruster wrote: > Date: Tue, 04 Jun 2024 07:29:15 +0200 > From: Markus Armbruster > Subject: Re: [PATCH] hw/core: Rename CpuTopology to CPUTopology > > Zhao Liu writes: > > > On Mon, Jun 03, 2024 at 01:54:15PM +0200, Markus Armbruster wrote: >

Re: [PATCH v5 13/17] aspeed/soc: Add AST2700 support

2024-06-03 Thread Cédric Le Goater
On 6/4/24 07:44, Jamin Lin wrote: Initial definitions for a simple machine using an AST2700 SOC (Cortex-a35 CPU). AST2700 SOC and its interrupt controller are too complex to handle in the common Aspeed SoC framework. We introduce a new ast2700 class with instance_init and realize handlers. AST2

Re: [PATCH v5 15/17] aspeed/soc: fix incorrect dram size for AST2700

2024-06-03 Thread Cédric Le Goater
On 6/4/24 07:44, Jamin Lin wrote: AST2700 dram size calculation is not back compatible AST2600. According to the DDR capacity hardware behavior, if users write the data to the address which is beyond the ram size, it would write the data to the "address % ram_size". For example: a. sdram base add

Re: [PATCH v5 10/17] aspeed/smc: Add AST2700 support

2024-06-03 Thread Cédric Le Goater
On 6/4/24 07:44, Jamin Lin wrote: AST2700 fmc/spi controller's address decoding unit is 64KB and only bits [31:16] are used for decoding. Introduce seg_to_reg and reg_to_seg handlers for ast2700 fmc/spi controller. In addition, adds ast2700 fmc, spi0, spi1, and spi2 class init handler. AST2700 i

Re: [PATCH v5 09/17] aspeed/smc: support different memory region ops for SMC flash region

2024-06-03 Thread Cédric Le Goater
On 6/4/24 07:44, Jamin Lin wrote: It set "aspeed_smc_flash_ops" struct which containing read and write callbacks to be used when I/O is performed on the SMC flash region. And it set the valid max_access_size 4 by default for all ASPEED SMC models. However, the valid max_access_size 4 only suppor

Re: [PATCH v5 05/17] aspeed/sdmc: Add AST2700 support

2024-06-03 Thread Cédric Le Goater
On 6/4/24 07:44, Jamin Lin wrote: The SDRAM memory controller(DRAMC) controls the access to external DDR4 and DDR5 SDRAM and power up to DDR4 and DDR5 PHY. The DRAM memory controller of AST2700 is not backward compatible to previous chips such AST2600, AST2500 and AST2400. Max memory is now 8Gi

Re: [PATCH 2/2] target/ppc/cpu_init: Synchronize HASHKEYR with KVM for migration

2024-06-03 Thread Nicholas Piggin
On Mon Jun 3, 2024 at 9:53 PM AEST, Shivaprasad G Bhat wrote: > The patch enables HASHKEYR migration by hooking with the > "KVM one reg" ID KVM_REG_PPC_HASHKEYR. > > Signed-off-by: Shivaprasad G Bhat > --- > linux-headers/asm-powerpc/kvm.h |1 + > target/ppc/cpu_init.c |4 ++-- >

Re: [PATCH v2] chardev: add path option for pty backend

2024-06-03 Thread Marc-André Lureau
On Tue, Jun 4, 2024 at 1:22 AM Octavian Purdila wrote: > > Add path option to the pty char backend which will create a symbolic > link to the given path that points to the allocated PTY. > > This avoids having to make QMP or HMP monitor queries to find out what > the new PTY device path is. > > Ba

[PATCH v5 03/17] aspeed/sdmc: remove redundant macros

2024-06-03 Thread Jamin Lin via
These macros are no longer used for ASPEED SOCs, so removes them. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/misc/aspeed_sdmc.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/hw/misc/aspeed_sdmc.c b/hw/misc/aspeed_sdmc.c index 64c

[PATCH v5 08/17] aspeed/smc: support 64 bits dma dram address

2024-06-03 Thread Jamin Lin via
AST2700 support the maximum dram size is 8GiB and has a "DMA DRAM Side Address High Part(0x7C)" register to support 64 bits dma dram address. Add helper routines functions to compute the dma dram address, new features and update trace-event to support 64 bits dram address. Signed-off-by: Troy Lee

[PATCH v5 16/17] test/avocado/machine_aspeed.py: Add AST2700 test case

2024-06-03 Thread Jamin Lin via
Add a test case to test Aspeed OpenBMC SDK v09.01 on AST2700 board. It loads u-boot-nodtb.bin, u-boot.dtb, tfa and optee-os images to dram first which base address is 0x4. Then, boot and launch 4 cpu cores. ``` qemu-system-aarch64 -machine ast2700-evb -device loader,force-raw=on,addr=

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > > > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. >> In set call, a new str

[PATCH v5 04/17] aspeed/sdmc: fix coding style

2024-06-03 Thread Jamin Lin via
Fix coding style issues from checkpatch.pl Test command: scripts/checkpatch.pl --no-tree -f hw/misc/aspeed_sdmc.c Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/misc/aspeed_sdmc.c | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) diff --

[PATCH v5 07/17] aspeed/smc: support dma start length and 1 byte length unit

2024-06-03 Thread Jamin Lin via
DMA length is from 1 byte to 32MB for AST2600 and AST10x0 and DMA length is from 4 bytes to 32MB for AST2500. In other words, if "R_DMA_LEN" is 0, it should move at least 1 byte data for AST2600 and AST10x0 and 4 bytes data for AST2500. To support all ASPEED SOCs, adds dma_start_length parameter t

[PATCH v5 05/17] aspeed/sdmc: Add AST2700 support

2024-06-03 Thread Jamin Lin via
The SDRAM memory controller(DRAMC) controls the access to external DDR4 and DDR5 SDRAM and power up to DDR4 and DDR5 PHY. The DRAM memory controller of AST2700 is not backward compatible to previous chips such AST2600, AST2500 and AST2400. Max memory is now 8GiB on the AST2700. Introduce new aspe

[PATCH v5 17/17] docs:aspeed: Add AST2700 Evaluation board

2024-06-03 Thread Jamin Lin via
Add AST2700 Evaluation board and its boot command. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- docs/system/arm/aspeed.rst | 39 ++ 1 file changed, 35 insertions(+), 4 deletions(-) diff --git a/docs/system/arm/aspeed.rs

RE: [PATCH v6 19/19] intel_iommu: Check compatibility with host IOMMU capabilities

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 19/19] intel_iommu: Check compatibility with host >IOMMU capabilities > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> If check fails, host device (either VFIO or VDPA device) is not >> compatible with current vIO

[PATCH v5 12/17] aspeed/intc: Add AST2700 support

2024-06-03 Thread Jamin Lin via
AST2700 interrupt controller(INTC) provides hardware interrupt interfaces to interrupt of processors PSP, SSP and TSP. In INTC, each interrupt of INT 128 to INT136 combines 32 interrupts. Introduce a new aspeed_intc class with instance_init and realize handlers. So far, this model only supports G

Re: [PATCH v2] chardev: add path option for pty backend

2024-06-03 Thread Marc-André Lureau
On Tue, Jun 4, 2024 at 1:22 AM Octavian Purdila wrote: > > Add path option to the pty char backend which will create a symbolic > link to the given path that points to the allocated PTY. > > This avoids having to make QMP or HMP monitor queries to find out what > the new PTY device path is. > > Ba

[PATCH v5 13/17] aspeed/soc: Add AST2700 support

2024-06-03 Thread Jamin Lin via
Initial definitions for a simple machine using an AST2700 SOC (Cortex-a35 CPU). AST2700 SOC and its interrupt controller are too complex to handle in the common Aspeed SoC framework. We introduce a new ast2700 class with instance_init and realize handlers. AST2700 is a 64 bits quad core cpus and

[PATCH v5 06/17] aspeed/smc: correct device description

2024-06-03 Thread Jamin Lin via
Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/ssi/aspeed_smc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/ssi/aspeed_smc.c b/hw/ssi/aspeed_smc.c index 7075bc9d61..fe1cd96b80 100644 --- a/hw/ssi/aspeed_smc.c +++ b/hw/ssi/a

[PATCH v5 14/17] aspeed: Add an AST2700 eval board

2024-06-03 Thread Jamin Lin via
AST2700 CPU is ARM Cortex-A35 which is 64 bits. Add TARGET_AARCH64 to build this machine. According to the design of ast2700, it has a bootmcu(riscv-32) which is used for executing SPL. Then, CPUs(cortex-a35) execute u-boot, kernel and rofs. Currently, qemu not support emulate two CPU architectur

[PATCH v5 15/17] aspeed/soc: fix incorrect dram size for AST2700

2024-06-03 Thread Jamin Lin via
AST2700 dram size calculation is not back compatible AST2600. According to the DDR capacity hardware behavior, if users write the data to the address which is beyond the ram size, it would write the data to the "address % ram_size". For example: a. sdram base address "0x4 " b. sdram size 1

[PATCH v5 10/17] aspeed/smc: Add AST2700 support

2024-06-03 Thread Jamin Lin via
AST2700 fmc/spi controller's address decoding unit is 64KB and only bits [31:16] are used for decoding. Introduce seg_to_reg and reg_to_seg handlers for ast2700 fmc/spi controller. In addition, adds ast2700 fmc, spi0, spi1, and spi2 class init handler. AST2700 is a 64 bits quad core CPUs(Cortex-a3

[PATCH v5 09/17] aspeed/smc: support different memory region ops for SMC flash region

2024-06-03 Thread Jamin Lin via
It set "aspeed_smc_flash_ops" struct which containing read and write callbacks to be used when I/O is performed on the SMC flash region. And it set the valid max_access_size 4 by default for all ASPEED SMC models. However, the valid max_access_size 4 only support 32 bits CPUs. To support all ASPEE

[PATCH v5 01/17] aspeed/wdt: Add AST2700 support

2024-06-03 Thread Jamin Lin via
AST2700 wdt controller is similiar to AST2600's wdt, but the AST2700 has 8 watchdogs, and they each have 0x80 of registers. Introduce ast2700 object class and increase the number of regs(offset) of ast2700 model. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater ---

[PATCH v5 11/17] aspeed/scu: Add AST2700 support

2024-06-03 Thread Jamin Lin via
AST2700 have two SCU controllers which are SCU and SCUIO. Both SCU and SCUIO registers are not compatible previous SOCs , introduces new registers and adds ast2700 scu, sucio class init handler. The pclk divider selection of SCUIO is defined in SCUIO280[20:18] and the pclk divider selection of SCU

[PATCH v5 02/17] aspeed/sli: Add AST2700 support

2024-06-03 Thread Jamin Lin via
AST2700 SLI engine is designed to accelerate the throughput between cross-die connections. It have CPU_SLI at CPU die and IO_SLI at IO die. Introduce dummy AST2700 SLI and SLIIO models. Signed-off-by: Troy Lee Signed-off-by: Jamin Lin Reviewed-by: Cédric Le Goater --- hw/misc/aspeed_sli.c

[PATCH v5 00/17] Add AST2700 support

2024-06-03 Thread Jamin Lin via
Changes from v1: The patch series supports WDT, SDMC, SMC, SCU, SLI and INTC for AST2700 SoC. Changes from v2: - replace is_aarch64 with is_bus64bit for sdmc patch review. - fix incorrect dram size for AST2700 Changes from v3: - Add AST2700 Evaluation board in ASPEED document - Add avocado test c

RE: [PATCH v6 18/19] intel_iommu: Implement [set|unset]_iommu_device() callbacks

2024-06-03 Thread Duan, Zhenzhong
>-Original Message- >From: Eric Auger >Subject: Re: [PATCH v6 18/19] intel_iommu: Implement >[set|unset]_iommu_device() callbacks > >Hi Zhenzhong, > >On 6/3/24 08:10, Zhenzhong Duan wrote: >> From: Yi Liu >> >> Implement [set|unset]_iommu_device() callbacks in Intel vIOMMU. >> In set ca

Re: [PATCH] hw/core: Rename CpuTopology to CPUTopology

2024-06-03 Thread Markus Armbruster
Zhao Liu writes: > On Mon, Jun 03, 2024 at 01:54:15PM +0200, Markus Armbruster wrote: >> Date: Mon, 03 Jun 2024 13:54:15 +0200 >> From: Markus Armbruster >> Subject: Re: [PATCH] hw/core: Rename CpuTopology to CPUTopology >> >> Zhao Liu writes: >> >> > Use CPUTopology to honor the generic styl

Re: [PATCH 0/4] hw/s390x: Alias @dump-skeys -> @dump-s390-skey and deprecate

2024-06-03 Thread Markus Armbruster
"Dr. David Alan Gilbert" writes: > * Daniel P. Berrangé (berra...@redhat.com) wrote: >> On Fri, May 31, 2024 at 06:47:45AM +0200, Thomas Huth wrote: >> > On 30/05/2024 09.45, Philippe Mathieu-Daudé wrote: >> > > We are trying to unify all qemu-system-FOO to a single binary. >> > > In order to do

[PATCH v5 3/4] target/riscv: Apply modularized matching conditions for watchpoint

2024-06-03 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. Remove the related code in riscv_cpu_debug_check_watchpoint() and invoke trigger_common_match() to check the privilege levels of the type 2 and type 6 trigger

[PATCH v5 4/4] target/riscv: Apply modularized matching conditions for icount trigger

2024-06-03 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. We can invoke trigger_common_match() to check the privilege levels of the type 3 triggers. Signed-off-by: Alvin Chang Acked-by: Alistair Francis --- targe

[PATCH v5 1/4] target/riscv: Add functions for common matching conditions of trigger

2024-06-03 Thread Alvin Chang via
According to RISC-V Debug specification version 0.13 [1] (also applied to version 1.0 [2] but it has not been ratified yet), there are several common matching conditions before firing a trigger, including the enabled privilege levels of the trigger. This commit adds trigger_common_match() to prepa

[PATCH v5 2/4] target/riscv: Apply modularized matching conditions for breakpoint

2024-06-03 Thread Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled privilege levels of the trigger match CPU's current privilege level. Remove the related code in riscv_cpu_debug_check_breakpoint() and invoke trigger_common_match() to check the privilege levels of the type 2 and type 6 trigger

[PATCH v5 0/4] RISC-V: Modularize common match conditions for trigger

2024-06-03 Thread Alvin Chang via
According to RISC-V Debug specification ratified version 0.13 [1] (also applied to version 1.0 [2] but it has not been ratified yet), the enabled privilege levels of the trigger is common match conditions for all the types of the trigger. This series modularize the code for checking the privilege

RE: [PATCH v4 0/4] RISC-V: Modularize common match conditions for trigger

2024-06-03 Thread 張哲嘉
> -Original Message- > From: Alistair Francis > Sent: Tuesday, June 4, 2024 9:58 AM > To: Alvin Che-Chia Chang(張哲嘉) > Cc: qemu-ri...@nongnu.org; qemu-devel@nongnu.org; > alistair.fran...@wdc.com; bin.m...@windriver.com; liwei1...@gmail.com; > dbarb...@ventanamicro.com; zhiwei_...@linux.al

  1   2   3   4   5   >