[PATCH v4 12/35] acpi: vmgenid_build_acpi: use acpi_table_begin()/acpi_table_end() instead of build_header()

2021-09-24 Thread Igor Mammedov
it replaces error-prone pointer arithmetic for build_header() API, with 2 calls to start and finish table creation, which hides offsets magic from API user. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- v4: * drop not related "vgia_offset = table_data->len" newline change

[PATCH v4 09/35] acpi: build_hmat: use acpi_table_begin()/acpi_table_end() instead of build_header()

2021-09-24 Thread Igor Mammedov
it replaces error-prone pointer arithmetic for build_header() API, with 2 calls to start and finish table creation, which hides offsets magic from API user. Also since acpi_table_begin() reserves space only for standard header while previous acpi_data_push() reserved the header + 4 bytes field,

Re: [PATCH 08/14] bsd-user/target_os_elf: If ELF_HWCAP2 is defined, publish it

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Some architecutres publish AT_HWCAP2 as well as AT_HWCAP. Those architectures will define this in their target_arch_elf.h files. If it is defined, then publish it. Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_elf.h | 4 1 file

Re: [Qemu-devel] [PULL 18/18] qapi: move RTC_CHANGE to the target schema

2021-09-24 Thread Markus Armbruster
Peter Maydell writes: > On Mon, 18 Feb 2019 at 14:19, Markus Armbruster wrote: >> >> From: Marc-André Lureau >> >> A few targets don't emit RTC_CHANGE, we could restrict the event to >> the tagets that do emit it. >> >> Note: There is a lot more of events & commands that we could restrict >>

[PATCH v4 03/35] acpi: build_xsdt: use acpi_table_begin()/acpi_table_end() instead of build_header()

2021-09-24 Thread Igor Mammedov
it replaces error-prone pointer arithmetic for build_header() API, with 2 calls to start and finish table creation, which hides offsets magic from API user. While at it switch to build_append_int_noprefix() to build entries to other tables (which also removes some manual offset calculations).

Re: [PATCH 09/14] bsd-user: Remove used from TaskState

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: The used field of TaskState is write only. Eliminate it. Signed-off-by: Warner Losh --- bsd-user/main.c | 1 - bsd-user/qemu.h | 1 - 2 files changed, 2 deletions(-) Reviewed-by: Richard Henderson r~

[PATCH v4 04/35] acpi: build_slit: use acpi_table_begin()/acpi_table_end() instead of build_header()

2021-09-24 Thread Igor Mammedov
it replaces error-prone pointer arithmetic for build_header() API, with 2 calls to start and finish table creation, which hides offsets magic from API user. Signed-off-by: Igor Mammedov Reviewed-by: Eric Auger --- v3: * s/acpi_init_table|acpi_table_composed/acpi_table_begin|acpi_table_end/

[PATCH v4 02/35] acpi: build_rsdt: use acpi_table_begin()/acpi_table_end() instead of build_header()

2021-09-24 Thread Igor Mammedov
it replaces error-prone pointer arithmetic for build_header() API, with 2 calls to start and finish table creation, which hides offests magic from API user. While at it switch to build_append_int_noprefix() to build entries to other tables (which also removes some manual offset calculations).

Re: [PATCH 07/14] bsd-user/target_os_elf.h: Remove fallback ELF_HWCAP and reorder

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: All architectures have a ELF_HWCAP, so remove the fallback ifdef. Place ELF_HWCAP in the same order as on native FreeBSD. Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_elf.h | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-)

Re: [PATCH 13/14] bsd-user: Rename sigqueue to qemu_sigqueue

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: To avoid a name clash with FreeBSD's sigqueue data structure in signalvar.h, rename sigqueue to qemu_sigqueue. This sturcture is currently defined, but unused. Signed-off-by: Warner Losh --- bsd-user/qemu.h | 14 +++--- 1 file changed, 7

Re: [PATCH 04/14] bsd-user: export get_errno and is_error from syscall.c

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Make get_errno and is_error global so files other than syscall.c can use them. Signed-off-by: Warner Losh --- bsd-user/qemu.h| 4 bsd-user/syscall.c | 10 +- 2 files changed, 9 insertions(+), 5 deletions(-) Reviewed-by: Richard

Re: [PATCH 12/14] bsd-user/sysarch: Provide a per-arch framework for sysarch syscall

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: +/* sysarch() is architecture dependent. */ +abi_long do_freebsd_sysarch(void *cpu_env, abi_long arg1, abi_long arg2) +{ + +return do_freebsd_arch_sysarch(cpu_env, arg1, arg2); +} Extra newline. Otherwise, Reviewed-by: Richard Henderson r~

Re: [PATCH 11/14] bsd-user/sysarch: Move to using do_freebsd_arch_sysarch interface

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Convert the #ifdef'd i386 code to calling the i386 sysarch code we have living in i386,x86_64/target_arch_sysarch.h do_freebsd_arch_sysarch rather than having a separate copy. This is in preparation to remove it entirely. Signed-Off-By: Warner Losh ---

Re: [PATCH 10/14] bsd-user: Add stop_all_tasks

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: +void stop_all_tasks(void) +{ +/* + * We trust when using NPTL (pthreads) start_exclusive() handles thread + * stopping correctly. + */ +start_exclusive(); +} Eh. It begs the question of why this is present, as opposed to calling

Re: [PATCH v2 5/9] bsd-user/mmap.c: mmap prefer MAP_ANON for BSD

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: MAP_ANON and MAP_ANONYMOUS are identical. Prefer MAP_ANON for BSD since the file is now a confusing mix of the two. Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/mmap.c | 11 +-- 1 file changed, 5 insertions(+), 6

Re: [PATCH 03/14] bsd-user: TARGET_RESET define is unused, remove it

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Signed-off-by: Warner Losh --- bsd-user/i386/target_arch_cpu.h | 2 -- bsd-user/x86_64/target_arch_cpu.h | 2 -- 2 files changed, 4 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 06/14] bsd-user: move TARGET_MC_GET_CLEAR_RET to target_os_signal.h

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Move TARGET_MC_GET_CLEAR_RET to freebsd/target_os_signal.h since it's FreeBSD-wide. Signed-off-by: Warner Losh --- bsd-user/freebsd/target_os_signal.h | 3 +++ bsd-user/i386/target_arch_signal.h | 2 -- bsd-user/x86_64/target_arch_signal.h | 2 --

Re: [PATCH v3 23/30] tcg/loongarch64: Add softmmu load/store helpers, implement qemu_ld/qemu_st ops

2021-09-24 Thread Richard Henderson
+/* fallthrough */ +default: +tcg_out_mov(s, size == MO_64, l->datalo_reg, TCG_REG_A0); +break; Here in tcg_out_qemu_ld_slow_path, "size == MO_64" is "type". +/* TLB Hit - translate address using addend. */ +if (TCG_TARGET_REG_BITS > TARGET_LONG_BITS) { +

Re: [PATCH 02/14] bsd-user/strace.list: Remove support for FreeBSD versions older than 12.0

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: Signed-off-by: Warner Losh --- bsd-user/freebsd/strace.list | 11 --- 1 file changed, 11 deletions(-) Reviewed-by: Richard Henderson r~

Re: [PATCH 05/14] bsd-user/errno_defs.h: Add internal error numbers

2021-09-24 Thread Richard Henderson
On 9/21/21 11:14 PM, Warner Losh wrote: From: Stacey Son To emulate signals and interrupted system calls, we need to have the same mechanisms we have in the kernel, including these errno values. Signed-off-by: Stacey Son Signed-off-by: Warner Losh --- bsd-user/errno_defs.h | 14

Re: [PATCH] Hexagon (target/hexagon) probe the stores in a packet at start of commit

2021-09-24 Thread Richard Henderson
On 9/22/21 11:35 AM, Taylor Simpson wrote: +static inline void probe_store(CPUHexagonState *env, int slot, int mmu_idx) +{ +if (!(env->slot_cancelled & (1 << slot))) { +size1u_t width = env->mem_log_stores[slot].width; +target_ulong va = env->mem_log_stores[slot].va; +

Re: [PATCH v2 9/9] bsd-user/mmap.c: assert that target_mprotect cannot fail

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: Similar to the equivalent linux-user change 86abac06c14. All error conditions that target_mprotect checks are also checked by target_mmap. EACCESS cannot happen because we are just removing PROT_WRITE. ENOMEM should not happen because we are modifying a

Re: [PATCH v2 4/9] bsd-user/mmap.c: mmap return ENOMEM on overflow

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: mmap should return ENOMEM on len overflow rather than EINVAL. Return EINVAL when len == 0 and ENOMEM when the rounded to a page length is 0. Found by make check-tcg. Signed-off-by: Warner Losh --- bsd-user/mmap.c | 9 - 1 file changed, 8

Re: [PATCH v2 8/9] bsd-user/mmap.c: Implement MAP_EXCL, required by jemalloc in head

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: +/* Reject the mapping if any page within the range is mapped */ +if (flags & MAP_EXCL) { +for (addr = start; addr < end; addr++) { +if (page_get_flags(addr) != 0) +goto fail; +} +

Re: [PATCH v3 09/30] tcg/loongarch64: Implement tcg_out_mov and tcg_out_movi

2021-09-24 Thread Richard Henderson
On 9/22/21 11:09 AM, WANG Xuerui wrote: Following up on previous, I suggest: +static void tcg_out_movi(TCGContext *s, TCGType type, TCGReg rd, + tcg_target_long val) +{ +if (type == TCG_TYPE_I32) { +val = (int32_t)val; +} + +/* Single-instruction

Re: [PATCH v2 7/9] bsd-user/mmap.c: Don't mmap fd == -1 independently from MAP_ANON flag

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: /* no page was there, so we allocate one */ void *p = mmap(host_start, qemu_host_page_size, prot, - flags | MAP_ANON, -1, 0); + flags | ((fd != -1) ? MAP_ANON : 0), -1, 0); I don't understand

Re: [PATCH v2 3/9] bsd-user/mmap.c: MAP_ symbols are defined, so no need for ifdefs

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: All these MAP_ symbols are always defined on supported FreeBSD versions (12.2 and newer), so remove the #ifdefs since they aren't needed. Signed-off-by: Warner Losh Reviewed-by: Philippe Mathieu-Daudé --- bsd-user/mmap.c | 14 -- 1 file

Re: [PATCH v2 1/9] bsd-user/mmap.c: Always zero MAP_ANONYMOUS memory in mmap_frag()

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: From: Mikaël Urankar Similar to the equivalent linux-user commit e6deac9cf99 When mapping MAP_ANONYMOUS memory fragments, still need notice about to set it zero, or it will cause issues. Signed-off-by: Mikaël Urankar Signed-off-by: Warner Losh ---

Re: [PATCH v2 6/9] bsd-user/mmap.c: line wrap change

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: Keep the shifted expression on one line. It's the same number of lines and easier to read like this. Signed-off-by: Warner Losh --- bsd-user/mmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bsd-user/mmap.c

Re: [PATCH v2 2/9] bsd-user/mmap.c: check pread's return value to fix warnings with _FORTIFY_SOURCE

2021-09-24 Thread Richard Henderson
On 9/21/21 9:56 PM, Warner Losh wrote: From: Mikaël Urankar Simmilar to the equivalent linux-user: commit fb7e378cf9c, which added checking to pread's return value. Signed-off-by: Mikaël Urankar Signed-off-by: Warner Losh --- bsd-user/mmap.c | 6 -- 1 file changed, 4 insertions(+), 2

[PATCH v5 23/26] sgx-epc: Add the fill_device_info() callback support

2021-09-24 Thread Paolo Bonzini
From: Yang Zhong Since there is no fill_device_info() callback support, and when we execute "info memory-devices" command in the monitor, the segfault will be found. This patch will add this callback support and "info memory-devices" will show sgx epc memory exposed to guest. The result as

Re: [PATCH v2 2/5] MAINTAINERS: Remove David & Greg as reviewers for a number of boards

2021-09-24 Thread Greg Kurz
There's a typo in Hervé's address. Fixing it from hpus...@reactos.org to hpous...@reactos.org . On Fri, 24 Sep 2021 19:55:33 +1000 David Gibson wrote: > Greg and I are moving towards other areas and no longer have capacity to > act as regular reviewers for several of the secondary ppc machine

[PATCH v5 25/26] target/i386: Add HMP and QMP interfaces for SGX

2021-09-24 Thread Paolo Bonzini
From: Yang Zhong The QMP and HMP interfaces can be used by monitor or QMP tools to retrieve the SGX information from VM side when SGX is enabled on Intel platform. Signed-off-by: Yang Zhong Message-Id: <20210910102258.46648-2-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini ---

[PATCH v5 22/26] i440fx: Add support for SGX EPC

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Enable SGX EPC virtualization, which is currently only support by KVM. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-22-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_piix.c | 1 + 1 file changed,

[PATCH v5 20/26] i386: acpi: Add SGX EPC entry to ACPI tables

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson The ACPI Device entry for SGX EPC is essentially a hack whose primary purpose is to provide software with a way to autoprobe SGX support, e.g. to allow software to implement SGX support as a driver. Details on the individual EPC sections are not enumerated through ACPI

[PATCH v5 19/26] i386/pc: Add e820 entry for SGX EPC section(s)

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Note that SGX EPC is currently guaranteed to reside in a single contiguous chunk of memory regardless of the number of EPC sections. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-19-yang.zh...@intel.com> Signed-off-by:

[PATCH v5 18/26] hw/i386/pc: Account for SGX EPC sections when calculating device memory

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Add helpers to detect if SGX EPC exists above 4g, and if so, where SGX EPC above 4g ends. Use the helpers to adjust the device memory range if SGX EPC exists above 4g. For multiple virtual EPC sections, we just put them together physically contiguous for the

Re: [PATCH v2 4/5] MAINTAINERS: Add information for OpenPIC

2021-09-24 Thread Greg Kurz
On Fri, 24 Sep 2021 19:55:35 +1000 David Gibson wrote: > The OpenPIC interrupt controller was once the de facto standard on ppc > machines. In qemu it's now only used on some Macintosh and the > Freescale e500 machine. It has no listed maintainer, and as far as I > know, no-one who's really

[PATCH v5 17/26] hw/i386/fw_cfg: Set SGX bits in feature control fw_cfg accordingly

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Request SGX an SGX Launch Control to be enabled in FEATURE_CONTROL when the features are exposed to the guest. Our design is the SGX Launch Control bit will be unconditionally set in FEATURE_CONTROL, which is unlike host bios. Signed-off-by: Sean Christopherson

[PATCH v5 26/26] target/i386: Add the query-sgx-capabilities QMP command

2021-09-24 Thread Paolo Bonzini
From: Yang Zhong Libvirt can use query-sgx-capabilities to get the host sgx capabilities to decide how to allocate SGX EPC size to VM. Signed-off-by: Yang Zhong Message-Id: <20210910102258.46648-3-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/sgx-stub.c | 6

[PATCH v5 13/26] i386: Update SGX CPUID info according to hardware/KVM/user input

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Expose SGX to the guest if and only if KVM is enabled and supports virtualization of SGX. While the majority of ENCLS can be emulated to some degree, because SGX uses a hardware-based root of trust, the attestation aspects of SGX cannot be emulated in software, i.e.

[PATCH v5 24/26] docs/system: Add SGX documentation to the system manual

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-34-yang.zh...@intel.com> [Convert to reStructuredText, and adopt the standard === --- ~~~ headings suggested for example by Linux. - Paolo] Signed-off-by: Paolo Bonzini

[PATCH v5 16/26] Adjust min CPUID level to 0x12 when SGX is enabled

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson SGX capabilities are enumerated through CPUID_0x12. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-16-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/cpu.c | 5 + 1 file changed, 5 insertions(+)

[PATCH v5 15/26] i386: Propagate SGX CPUID sub-leafs to KVM

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson The SGX sub-leafs are enumerated at CPUID 0x12. Indices 0 and 1 are always present when SGX is supported, and enumerate SGX features and capabilities. Indices >=2 are directly correlated with the platform's EPC sections. Because the number of EPC sections is dynamic

[PATCH v5 14/26] i386: kvm: Add support for exposing PROVISIONKEY to guest

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson If the guest want to fully use SGX, the guest needs to be able to access provisioning key. Add a new KVM_CAP_SGX_ATTRIBUTE to KVM to support provisioning key to KVM guests. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id:

[PATCH v5 10/26] i386: Add SGX CPUID leaf FEAT_SGX_12_1_EAX

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_1_EAX is an Intel-defined feature bits leaf enumerating the platform's SGX capabilities that may be utilized by an enclave, e.g. whether or not an enclave can gain access to the provision key. Currently there are six capabilities: - INIT: set when the

[PATCH v5 21/26] q35: Add support for SGX EPC

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Enable SGX EPC virtualization, which is currently only support by KVM. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-21-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- hw/i386/pc_q35.c | 1 + 1 file changed, 1

[PATCH v5 09/26] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EBX

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_0_EBX is an Intel-defined feature bits leaf enumerating the platform's SGX extended capabilities. Currently there is a single capabilitiy: - EXINFO: record information about #PFs and #GPs in the enclave's SSA Signed-off-by: Sean Christopherson

[PATCH v5 08/26] i386: Add SGX CPUID leaf FEAT_SGX_12_0_EAX

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson CPUID leaf 12_0_EAX is an Intel-defined feature bits leaf enumerating the CPU's SGX capabilities, e.g. supported SGX instruction sets. Currently there are four enumerated capabilities: - SGX1 instruction set, i.e. "base" SGX - SGX2 instruction set for dynamic

[PATCH v5 12/26] i386: Add feature control MSR dependency when SGX is enabled

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson SGX adds multiple flags to FEATURE_CONTROL to enable SGX and Flexible Launch Control. Signed-off-by: Sean Christopherson Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-12-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- target/i386/kvm/kvm.c | 5

[PATCH v5 05/26] i386: Add 'sgx-epc' device to expose EPC sections to guest

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson SGX EPC is enumerated through CPUID, i.e. EPC "devices" need to be realized prior to realizing the vCPUs themselves, which occurs long before generic devices are parsed and realized. Because of this, do not allow 'sgx-epc' devices to be instantiated after vCPUS have

[PATCH v5 07/26] i386: Add primary SGX CPUID and MSR defines

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Add CPUID defines for SGX and SGX Launch Control (LC), as well as defines for their associated FEATURE_CONTROL MSR bits. Define the Launch Enclave Public Key Hash MSRs (LE Hash MSRs), which exist when SGX LC is present (in CPUID), and are writable when SGX LC is

[PATCH v5 11/26] i386: Add get/set/migrate support for SGX_LEPUBKEYHASH MSRs

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson On real hardware, on systems that supports SGX Launch Control, those MSRs are initialized to digest of Intel's signing key; on systems that don't support SGX Launch Control, those MSRs are not available but hardware always uses digest of Intel's signing key in EINIT.

[PATCH v5 03/26] hostmem: Add hostmem-epc as a backend for SGX EPC

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson EPC (Enclave Page Cahe) is a specialized type of memory used by Intel SGX (Software Guard Extensions). The SDM desribes EPC as: The Enclave Page Cache (EPC) is the secure storage used to store enclave pages when they are a part of an executing enclave. For an

[PATCH v5 00/26] Qemu SGX virtualization

2021-09-24 Thread Paolo Bonzini
This version includes a lot of the changes that were pointed out in the review of the previous versions. I apologize for rushing things in to make it before the conference break. Paolo Changes from v4: - removed RESET handling, which will use a dedicated kernel API - cleaned up stubs

[PATCH v5 04/26] qom: Add memory-backend-epc ObjectOptions support

2021-09-24 Thread Paolo Bonzini
From: Yang Zhong Add the new 'memory-backend-epc' user creatable QOM object in the ObjectOptions to support SGX since v6.1, or the sgx backend object cannot bootup. Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-4-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini ---

[PATCH v5 01/26] memory: Add RAM_PROTECTED flag to skip IOMMU mappings

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Add a new RAMBlock flag to denote "protected" memory, i.e. memory that looks and acts like RAM but is inaccessible via normal mechanisms, including DMA. Use the flag to skip protected memory regions when mapping RAM for DMA in VFIO. Signed-off-by: Sean Christopherson

[PATCH v5 06/26] vl: Add sgx compound properties to expose SGX EPC sections to guest

2021-09-24 Thread Paolo Bonzini
From: Sean Christopherson Because SGX EPC is enumerated through CPUID, EPC "devices" need to be realized prior to realizing the vCPUs themselves, i.e. long before generic devices are parsed and realized. From a virtualization perspective, the CPUID aspect also means that EPC sections cannot be

[PATCH v5 02/26] Kconfig: Add CONFIG_SGX support

2021-09-24 Thread Paolo Bonzini
From: Yang Zhong Add new CONFIG_SGX for sgx support in the Qemu, and the Kconfig default enable sgx in the i386 platform. Signed-off-by: Yang Zhong Message-Id: <20210719112136.57018-32-yang.zh...@intel.com> Signed-off-by: Paolo Bonzini --- configs/devices/i386-softmmu/default.mak | 1 +

Re: [PATCH v2 5/5] MAINTAINERS: Demote sPAPR from "Supported" to "Maintained"

2021-09-24 Thread Philippe Mathieu-Daudé
On 9/24/21 11:55, David Gibson wrote: qemu/KVM on Power is no longer my primary job responsibility, nor Greg Kurz'. I still have some time for upstream maintenance, but it's no longer accurate to say that I'm paid to do so. Therefore, reduce sPAPR (the "pseries" machine type) from Supported to

Re: [PATCH v2 5/5] MAINTAINERS: Demote sPAPR from "Supported" to "Maintained"

2021-09-24 Thread Cédric Le Goater
On 9/24/21 11:55, David Gibson wrote: qemu/KVM on Power is no longer my primary job responsibility, nor Greg Kurz'. I still have some time for upstream maintenance, but it's no longer accurate to say that I'm paid to do so. Therefore, reduce sPAPR (the "pseries" machine type) from Supported to

Re: [PATCH v2 2/5] MAINTAINERS: Remove David & Greg as reviewers for a number of boards

2021-09-24 Thread Cédric Le Goater
On 9/24/21 11:55, David Gibson wrote: Greg and I are moving towards other areas and no longer have capacity to act as regular reviewers for several of the secondary ppc machine types. So, remove ourselves as reviewers for Macintosh, PReP, sam460ex and pegasos2 in MAINTAINERS. Signed-off-by:

Re: [PATCH v2 1/5] MAINTAINERS: Orphan obscure ppc platforms

2021-09-24 Thread Cédric Le Goater
On 9/24/21 11:55, David Gibson wrote: There are a nunber of old embedded ppc machine types which have been little changed and in "Odd Fixes" state for a long time. With both myself and Greg Kurz moving toward other areas, we no longer have the capacity to keep reviewing and maintaining even the

Re: [PATCH v2 4/5] MAINTAINERS: Add information for OpenPIC

2021-09-24 Thread Cédric Le Goater
On 9/24/21 11:55, David Gibson wrote: The OpenPIC interrupt controller was once the de facto standard on ppc machines. In qemu it's now only used on some Macintosh and the Freescale e500 machine. It has no listed maintainer, and as far as I know, no-one who's really familiar with it any more.

Re: [PATCH v2 3/5] MAINTAINERS: Remove David & Greg as reviewers/co-maintainers of powernv

2021-09-24 Thread Cédric Le Goater
On 9/24/21 11:55, David Gibson wrote: With our interests moving to other areas, Greg and myself no longer have capacity to be regular reviewers of code for the powernv machine type, let alone co-maintainers. Additionally, not being IBM employees, we don't have easy access to the hardware

Re: [PATCH] hw/misc: Add an iBT device model

2021-09-24 Thread Cédric Le Goater
Hello Titus, On 9/24/21 10:42, Philippe Mathieu-Daudé wrote: On 9/24/21 01:48, Titus Rwantare wrote: Hello all, I'd like some clarification on how the following code transfers irqs back and forth: b/hw/arm/aspeed_soc.c +    /* iBT */ +    if (!sysbus_realize(SYS_BUS_DEVICE(>ibt), errp)) { +  

Re: [PATCH v2 2/5] MAINTAINERS: Remove David & Greg as reviewers for a number of boards

2021-09-24 Thread BALATON Zoltan
On Fri, 24 Sep 2021, David Gibson wrote: Greg and I are moving towards other areas and no longer have capacity to act as regular reviewers for several of the secondary ppc machine types. So, remove ourselves as reviewers for Macintosh, PReP, sam460ex and pegasos2 in MAINTAINERS. Signed-off-by:

Re: [PATCH v5 04/20] nubus: use bitmap to manage available slots

2021-09-24 Thread BALATON Zoltan
On Fri, 24 Sep 2021, Philippe Mathieu-Daudé wrote: On 9/24/21 09:16, Mark Cave-Ayland wrote: On 23/09/2021 15:16, BALATON Zoltan wrote: On Thu, 23 Sep 2021, Mark Cave-Ayland wrote: Convert nubus_device_realize() to use a bitmap to manage available slots to allow for future Nubus devices to

[PATCH v2 0/5] Reduce load on ppc target maintainers

2021-09-24 Thread David Gibson
Greg Kurz and myself have been co-maintainers for the ppc and ppc64 targets for some time now. However, both our day job responsibilities and interests are leading us towards other areas, so we have less time to devote to this any more. Therefore, here's a bunch of updates to MAINTAINERS,

Re: [PATCH v5 18/20] nubus: add support for slot IRQs

2021-09-24 Thread Mark Cave-Ayland
On 24/09/2021 10:01, Philippe Mathieu-Daudé wrote: On 9/24/21 09:06, Mark Cave-Ayland wrote: On 23/09/2021 10:49, Philippe Mathieu-Daudé wrote: On 9/23/21 11:13, Mark Cave-Ayland wrote: Each Nubus slot has an IRQ line that can be used to request service from the CPU. Connect the IRQs to the

[PATCH v6 40/40] accel/tcg: Simplify tcg_cpu_has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
All TCG targets implement the TCGCPUOps::has_work() handler. We can remove the non-NULL handler check in tcg_cpu_has_work(). Add an assertion in tcg_exec_realizefn() for future TCG targets. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/cpu-exec.c | 4 accel/tcg/tcg-accel-ops.c

[PATCH v6 34/40] target/sh4: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sh4/cpu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/target/sh4/cpu.c b/target/sh4/cpu.c index 2047742d03c..fb2116dc52e 100644 --- a/target/sh4/cpu.c +++

[PATCH v2 4/5] MAINTAINERS: Add information for OpenPIC

2021-09-24 Thread David Gibson
The OpenPIC interrupt controller was once the de facto standard on ppc machines. In qemu it's now only used on some Macintosh and the Freescale e500 machine. It has no listed maintainer, and as far as I know, no-one who's really familiar with it any more. Since I'm moving away from the area, I

[PATCH v6 32/40] target/rx: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/rx/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/rx/cpu.c b/target/rx/cpu.c index 25a4aa2976d..ac6b40b2716 100644 --- a/target/rx/cpu.c +++

Re: [PATCH] block: introduce max_hw_iov for use in scsi-generic

2021-09-24 Thread Kevin Wolf
Am 23.09.2021 um 15:04 hat Paolo Bonzini geschrieben: > Linux limits the size of iovecs to 1024 (UIO_MAXIOV in the kernel > sources, IOV_MAX in POSIX). Because of this, on some host adapters > requests with many iovecs are rejected with -EINVAL by the > io_submit() or readv()/writev() system

[PATCH v6 29/40] target/ppc: Introduce PowerPCCPUClass::has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
We're moving the hook from CPUState to TCGCPUOps. TCGCPUOps is a const structure, so to avoid creating multiple versions of the same structure, simply changing the has_work() handler, introduce yet another indirection with a has_work() handler in PowerPCCPUClass, and ppc_cpu_has_work() method

[PATCH v6 37/40] target/tricore: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/tricore/cpu.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/target/tricore/cpu.c b/target/tricore/cpu.c index b95682b7f04..419fa624bd5 100644 ---

[PATCH v2 5/5] MAINTAINERS: Demote sPAPR from "Supported" to "Maintained"

2021-09-24 Thread David Gibson
qemu/KVM on Power is no longer my primary job responsibility, nor Greg Kurz'. I still have some time for upstream maintenance, but it's no longer accurate to say that I'm paid to do so. Therefore, reduce sPAPR (the "pseries" machine type) from Supported to Maintained. Signed-off-by: David

[PATCH v6 31/40] target/riscv: Restrict has_work() handler to sysemu and TCG

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Acked-by: Alistair Francis Signed-off-by: Philippe Mathieu-Daudé --- target/riscv/cpu.c | 8 +++- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index

[PATCH v2 2/5] MAINTAINERS: Remove David & Greg as reviewers for a number of boards

2021-09-24 Thread David Gibson
Greg and I are moving towards other areas and no longer have capacity to act as regular reviewers for several of the secondary ppc machine types. So, remove ourselves as reviewers for Macintosh, PReP, sam460ex and pegasos2 in MAINTAINERS. Signed-off-by: David Gibson Reviewed-by: Greg Kurz ---

[PATCH v6 35/40] target/sparc: Remove pointless use of CONFIG_TCG definition

2021-09-24 Thread Philippe Mathieu-Daudé
The SPARC target only support TCG acceleration. Remove the CONFIG_TCG definition introduced by mistake in commit 78271684719 ("cpu: tcg_ops: move to tcg-cpu-ops.h, keep a pointer in CPUClass"). Reported-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé

[PATCH v6 25/40] target/microblaze: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/microblaze/cpu.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/microblaze/cpu.c b/target/microblaze/cpu.c index 15db277925f..36e6e540483 100644

[PATCH v6 24/40] target/m68k: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/m68k/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 66d22d11895..ad5d26b5c9e 100644 --- a/target/m68k/cpu.c

[PATCH v6 33/40] target/s390x: Restrict has_work() handler to sysemu and TCG

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/s390x/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c index 7b7b05f1d3a..df8ade9021d 100644 ---

[PATCH v2 3/5] MAINTAINERS: Remove David & Greg as reviewers/co-maintainers of powernv

2021-09-24 Thread David Gibson
With our interests moving to other areas, Greg and myself no longer have capacity to be regular reviewers of code for the powernv machine type, let alone co-maintainers. Additionally, not being IBM employees, we don't have easy access to the hardware information we'd need for good review.

[PATCH v2 1/5] MAINTAINERS: Orphan obscure ppc platforms

2021-09-24 Thread David Gibson
There are a nunber of old embedded ppc machine types which have been little changed and in "Odd Fixes" state for a long time. With both myself and Greg Kurz moving toward other areas, we no longer have the capacity to keep reviewing and maintaining even the rare patches that come in for those

[PATCH v6 21/40] target/hexagon: Remove unused has_work() handler

2021-09-24 Thread Philippe Mathieu-Daudé
has_work() is sysemu specific, and Hexagon target only provides a linux-user implementation. Remove the unused hexagon_cpu_has_work(). Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/hexagon/cpu.c | 6 -- 1 file changed, 6 deletions(-) diff --git

[PATCH v6 28/40] target/openrisc: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/openrisc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/openrisc/cpu.c b/target/openrisc/cpu.c index 27cb04152f9..3c368a1bde7 100644 ---

[PATCH v6 27/40] target/nios2: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/nios2/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/nios2/cpu.c b/target/nios2/cpu.c index 947bb09bc1e..9938d7c2919 100644 ---

[PATCH v6 16/40] accel/tcg: Introduce TCGCPUOps::has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
Introduce a target-specific has_work() handler for TCG. Eventually call it from tcg_cpu_has_work(), our AccelOpsClass::has_work() handler. Inspired-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/tcg-cpu-ops.h | 4 accel/tcg/tcg-accel-ops.c | 4 2

[PATCH v6 39/40] accel/tcg: Remove CPUClass::has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
Now that all TCG targets converted their CPUClass::has_work() handler to a TCGCPUOps::has_work() one, we can remove has_work from CPUClass. Suggested-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 -- accel/tcg/tcg-accel-ops.c | 3 --- 2 files

[PATCH v6 30/40] target/ppc: Restrict has_work() handlers to sysemu and TCG

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict PowerPCCPUClass::has_work() and ppc_cpu_has_work() - SysemuCPUOps::has_work() implementation - to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/ppc/cpu-qom.h | 4 +++- target/ppc/cpu_init.c | 24 ++-- 2 files changed,

[PATCH v6 14/40] accel/tcg: Implement AccelOpsClass::has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
All accelerators but TCG implement their AccelOpsClass::has_work() handler, meaning all the remaining CPUClass::has_work() ones are only reachable from TCG accelerator; and these has_work() handlers belong to TCGCPUOps. We will gradually move each target CPUClass::has_work() to TCGCPUOps in the

[PATCH v6 38/40] target/xtensa: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/xtensa/cpu.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/target/xtensa/cpu.c b/target/xtensa/cpu.c index c1cbd03595e..5cb19a88819 100644 ---

[PATCH v6 26/40] target/mips: Restrict has_work() handler to sysemu and TCG

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/mips/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/mips/cpu.c b/target/mips/cpu.c index 00e0c55d0e4..3639c03f8ea 100644 ---

[PATCH v6 23/40] target/i386: Restrict has_work() handler to sysemu and TCG

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to TCG sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu.c | 6 -- target/i386/tcg/tcg-cpu.c | 8 +++- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/target/i386/cpu.c b/target/i386/cpu.c index

Re: [PATCH-for-6.2 0/2] disas/nios2: Simplify endianess conversion

2021-09-24 Thread Philippe Mathieu-Daudé
Hi Cris and Marek, could you help me get this series merged? On 9/23/21 17:14, Laurent Vivier wrote: Le 18/09/2021 à 11:19, Philippe Mathieu-Daudé a écrit : Cc'ing qemu-trivial@ (series fully reviewed). An Acked-by from one of NiosII maintainers would be welcome. Thanks, Laurent On

[PATCH v6 13/40] accel/qtest: Implement AccelOpsClass::has_work()

2021-09-24 Thread Philippe Mathieu-Daudé
Implement QTest has_work() handler in AccelOpsClass. Since no CPU are available under QTest accelerator, this function is not reachable. Signed-off-by: Philippe Mathieu-Daudé --- accel/qtest/qtest.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/accel/qtest/qtest.c

[PATCH v6 36/40] target/sparc: Restrict has_work() handler to sysemu

2021-09-24 Thread Philippe Mathieu-Daudé
Restrict has_work() to sysemu. Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- target/sparc/cpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/sparc/cpu.c b/target/sparc/cpu.c index 0d252cb5bdc..8d61bf15f6c 100644 ---

[PATCH v6 17/40] target/arm: Explicit v7M cores use arm_cpu_has_work as CPUClass:has_work

2021-09-24 Thread Philippe Mathieu-Daudé
ARM v7M cores inherit TYPE_ARM_CPU, so TYPE_ARM_CPU's class_init runs first and sets up most of the class fields, setting in particular the has_work handler to the generic arm_cpu_has_work(). Thus M-profile and A-profile share the same arm_cpu_has_work() function. Some of the checks the code there

<    1   2   3   4   >