Re: [PULL 38/56] hw/acpi: changes towards enabling -Wshadow=local

2023-09-29 Thread Ani Sinha
> On 29-Sep-2023, at 2:20 PM, Markus Armbruster wrote: > > From: Ani Sinha > > Code changes in acpi that addresses all compiler complaints coming from > enabling > -Wshadow flags. Enabling -Wshadow catches cases of local variables shadowing > other local variables or parameters. These makes

[PATCH v2 1/2] tcg: Remove argument to tcg_prologue_init

2023-09-29 Thread Richard Henderson
We can load tcg_ctx just as easily within the callee. Signed-off-by: Richard Henderson --- include/tcg/tcg.h | 2 +- accel/tcg/tcg-all.c | 2 +- bsd-user/main.c | 2 +- linux-user/main.c | 2 +- tcg/tcg.c | 3 ++- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/i

[PATCH v2 2/2] tcg: Split out tcg init functions to tcg/startup.h

2023-09-29 Thread Richard Henderson
The tcg/tcg.h header is a big bucket, containing stuff related to the translators and the JIT backend. The places that initialize tcg or create new threads do not need all of that, so split out these three functions to a new header. Suggested-by: Peter Maydell Signed-off-by: Richard Henderson -

[PATCH v2 0/2] Split out tcg init functions to tcg/startup.h

2023-09-29 Thread Richard Henderson
Supercedes: <20230923130843.3708899-1-peter.mayd...@linaro.org> ("[PATCH] tcg.h: Split out runtime-only functions into tcg/runtime.h") I thought "startup.h" was perhaps a better name than "runtime.h", at least for the functions moved, since it's about starting up either tcg or tcg within a new thr

[PATCH v6 02/19] linux-user: Tidy loader_exec

2023-09-29 Thread Richard Henderson
Reorg the if cases to reduce indentation. Test for 4 bytes in the file before checking the signatures. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/linuxload.c | 42 +- 1 file changed, 21 in

[PATCH v6 12/19] linux-user/arm: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/arm/vdso-asmoffset.h | 3 + linux-user/arm/signal.c | 55 ++ linux-user/elfload.c| 3 +- linux-user/arm/Makefile.vdso| 17 linux-user/arm/meson.build | 12 +++ linux-user/arm/vdso-be.so | Bin 0

[PATCH v6 16/19] linux-user/ppc: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/ppc/vdso-asmoffset.h | 20 +++ linux-user/elfload.c| 8 ++ linux-user/ppc/signal.c | 31 +++-- linux-user/gen-vdso-elfn.c.inc | 7 + linux-user/ppc/Makefile.vdso| 20 +++ linux-user/ppc/meson.build | 12 ++ linu

[PATCH v6 08/19] linux-user: Add gen-vdso tool

2023-09-29 Thread Richard Henderson
This tool will be used for post-processing the linked vdso image, turning it into something that is easy to include into elfload.c. Signed-off-by: Richard Henderson --- linux-user/gen-vdso.c | 223 linux-user/gen-vdso-elfn.c.inc | 307 +++

[PATCH v6 10/19] linux-user/x86_64: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/elfload.c| 4 +- linux-user/x86_64/Makefile.vdso | 11 + linux-user/x86_64/meson.build | 4 ++ linux-user/x86_64/vdso.S| 78 linux-user/x86_64/vdso.ld | 73 +

[PATCH v6 14/19] linux-user/riscv: Add vdso

2023-09-29 Thread Richard Henderson
Acked-by: Alistair Francis Signed-off-by: Richard Henderson --- linux-user/riscv/vdso-asmoffset.h | 9 ++ linux-user/elfload.c | 2 + linux-user/riscv/signal.c | 8 ++ linux-user/meson.build| 1 + linux-user/riscv/Makefile.vdso| 15 +++ linux-user/ri

[PATCH v6 19/19] build: Add update-linux-vdso makefile rule

2023-09-29 Thread Richard Henderson
This is not ideal, since it requires all cross-compilers to be present rather than a simple subset. But since it is only run manually, should be good enough for now. Signed-off-by: Richard Henderson --- Makefile | 10 ++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile

[PATCH v6 11/19] linux-user/aarch64: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/elfload.c | 6 +++ linux-user/aarch64/Makefile.vdso | 15 +++ linux-user/aarch64/meson.build | 11 + linux-user/aarch64/vdso-be.so| Bin 0 -> 3216 bytes linux-user/aarch64/vdso-le.so| Bin 0 -> 3216 bytes linux-user

[PATCH v6 15/19] linux-user/loongarch64: Add vdso

2023-09-29 Thread Richard Henderson
Requires a relatively recent binutils version in order to avoid spurious R_LARCH_NONE relocations. The presence of these relocs are diagnosed by our gen-vdso tool. Tested-by: Song Gao Reviewed-by: Song Gao Signed-off-by: Richard Henderson --- linux-user/loongarch64/vdso-asmoffset.h | 8 ++

[PATCH v6 06/19] linux-user: Replace bprm->fd with bprm->src.fd

2023-09-29 Thread Richard Henderson
There are only a couple of uses of bprm->fd remaining. Migrate to the other field. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/loader.h| 1 - linux-user/flatload.c | 8 linux-user/linuxload.c | 5 ++--- 3 files changed, 6 insertions(+), 8 de

[PATCH v6 04/19] linux-user: Use ImageSource in load_elf_image

2023-09-29 Thread Richard Henderson
Change parse_elf_properties as well, as the bprm_buf argument ties the two functions closely. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 128 +-- 1 file changed, 49 insertions(+), 79 deletions(-) diff --git a/linux-user/elfload.c b/linux-

[PATCH v6 18/19] linux-user/s390x: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/s390x/vdso-asmoffset.h | 2 + linux-user/elfload.c | 2 + linux-user/s390x/signal.c | 4 +- linux-user/s390x/Makefile.vdso| 11 + linux-user/s390x/meson.build | 6 +++ linux-user/s390x/vdso.S | 6

[PATCH v6 13/19] linux-user/hppa: Add vdso

2023-09-29 Thread Richard Henderson
Signed-off-by: Richard Henderson --- linux-user/hppa/vdso-asmoffset.h | 12 +++ linux-user/elfload.c | 2 + linux-user/hppa/signal.c | 24 +++-- linux-user/hppa/Makefile.vdso| 11 +++ linux-user/hppa/meson.build | 5 + linux-user/hppa/vdso.S | 165 +++

[PATCH v6 17/19] linux-user/s390x: Rename __SIGNAL_FRAMESIZE to STACK_FRAME_OVERHEAD

2023-09-29 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/s390x/signal.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/linux-user/s390x/signal.c b/linux-user/s390x/signal.c index f72165576f..0f8b8e04bf 100644 --- a/linux-user/s390x/signal.c

[PATCH v6 09/19] linux-user/i386: Add vdso

2023-09-29 Thread Richard Henderson
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1267 Signed-off-by: Richard Henderson --- linux-user/i386/vdso-asmoffset.h | 6 ++ linux-user/elfload.c | 19 +++- linux-user/i386/signal.c | 11 +++ linux-user/i386/Makefile.vdso| 11 +++ linux-user/i386/meson.b

[PATCH v6 03/19] linux-user: Do not clobber bprm_buf swapping ehdr

2023-09-29 Thread Richard Henderson
Rearrange the allocation of storage for ehdr between load_elf_image and load_elf_binary. The same set of copies are done, but we don't modify bprm_buf, which will be important later. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/e

[PATCH v6 05/19] linux-user: Use ImageSource in load_symbols

2023-09-29 Thread Richard Henderson
Aside from the section headers, we're unlikely to hit the ImageSource cache on guest executables. But the interface for imgsrc_read_* is better. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/elfload.c | 87 1 fi

[PATCH v6 07/19] linux-user: Load vdso image if available

2023-09-29 Thread Richard Henderson
The vdso image will be pre-processed into a C data array, with a simple list of relocations to perform, and identifying the location of signal trampolines. Signed-off-by: Richard Henderson --- linux-user/elfload.c | 90 +++- 1 file changed, 81 insertions(+

[PATCH v6 01/19] linux-user: Introduce imgsrc_read, imgsrc_read_alloc

2023-09-29 Thread Richard Henderson
Introduced and initialized, but not yet really used. These will tidy the current tests vs BPRM_BUF_SIZE. Reviewed-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- linux-user/loader.h| 61 +++- linux-user/linuxload.c | 90 +

[PATCH v6 00/19] linux-user: Implement VDSOs

2023-09-29 Thread Richard Henderson
Becase b4 eats a binaries: https://gitlab.com/rth7680/qemu/-/tree/lu-vdso Changes for v6: * Revert build-vdso.sh and meson rules. * Add update-linux-vdso makefile rule. Since this is run manually, we no longer have a problem with docker images failing to update and causing the norma

Re: [PATCH 0/7] tcg/loongarch64: Improvements for 128-bit load/store

2023-09-29 Thread Richard Henderson
Ping. r~ On 9/16/23 15:01, Richard Henderson wrote: For tcg generated code, use new registers with load so that we never overlap the input address, so that we can simplify address build for 64-bit user-only. For tcg out-of-line code, implement the host/ headers to for atomic 128-bit load and s

[PATCH V2 10/10] target/arm/kvm: Write CPU state back to KVM on reset

2023-09-29 Thread Salil Mehta via
From: Jean-Philippe Brucker When a KVM vCPU is reset following a PSCI CPU_ON call, its power state is not synchronized with KVM at the moment. Because the vCPU is not marked dirty, we miss the call to kvm_arch_put_registers() that writes to KVM's MP_STATE. Force mp_state synchronization. Signed-

[PATCH V2 09/10] gdbstub: Add helper function to unregister GDB register space

2023-09-29 Thread Salil Mehta via
Add common function to help unregister the GDB Register Space. This shall be done in context to the CPU unrealization. Signed-off-by: Salil Mehta --- gdbstub/gdbstub.c | 14 ++ include/exec/gdbstub.h | 5 + 2 files changed, 19 insertions(+) diff --git a/gdbstub/gdbstub.c b

[PATCH V2 08/10] physmem: Add helper function to destroy CPU AddressSpace

2023-09-29 Thread Salil Mehta via
Virtual CPU Hot-unplug leads to unrealization of a CPU object. This also involves destruction of the CPU AddressSpace. Add common function to help destroy the CPU AddressSpace. Signed-off-by: Salil Mehta --- include/exec/cpu-common.h | 8 include/hw/core/cpu.h | 1 + softmmu/physm

[PATCH V2 07/10] hw/acpi: Update ACPI GED framework to support vCPU Hotplug

2023-09-29 Thread Salil Mehta via
ACPI GED shall be used to convey to the guest kernel about any CPU hot-(un)plug events. Therefore, existing ACPI GED framework inside QEMU needs to be enhanced to support CPU hotplug state and events. Co-developed-by: Keqian Zhu Signed-off-by: Keqian Zhu Signed-off-by: Salil Mehta --- hw/acpi/

[PATCH V2 06/10] hw/acpi: Update GED _EVT method AML with cpu scan

2023-09-29 Thread Salil Mehta via
OSPM evaluates _EVT method to map the event. The cpu hotplug event eventually results in start of the cpu scan. Scan figures out the cpu and the kind of event(plug/unplug) and notifies it back to the guest. The change in this patch updates the GED AML _EVT method with the call to \\_SB.CPUS.CSCN w

[PATCH V2 05/10] hw/acpi: Update CPUs AML with cpu-(ctrl)dev change

2023-09-29 Thread Salil Mehta via
CPUs Control device(\\_SB.PCI0) register interface for the x86 arch is based on PCI and is IO port based and hence existing cpus AML code assumes _CRS objects would evaluate to a system resource which describes IO Port address. But on ARM arch CPUs control device(\\_SB.PRES) register interface is m

[PATCH V2 04/10] hw/acpi: Init GED framework with cpu hotplug events

2023-09-29 Thread Salil Mehta via
ACPI GED(as described in the ACPI 6.2 spec) can be used to generate ACPI events when OSPM/guest receives an interrupt listed in the _CRS object of GED. OSPM then maps or demultiplexes the event by evaluating _EVT method. This change adds the support of cpu hotplug event initialization in the exist

[PATCH V2 03/10] hw/acpi: Add ACPI CPU hotplug init stub

2023-09-29 Thread Salil Mehta via
ACPI CPU hotplug related initialization should only happen if ACPI_CPU_HOTPLUG support has been enabled for particular architecture. Add cpu_hotplug_hw_init() stub to avoid compilation break. Signed-off-by: Salil Mehta --- hw/acpi/acpi-cpu-hotplug-stub.c | 6 ++ 1 file changed, 6 insertions(

[PATCH V2 02/10] hw/acpi: Move CPU ctrl-dev MMIO region len macro to common header file

2023-09-29 Thread Salil Mehta via
CPU ctrl-dev MMIO region length could be used in ACPI GED and various other architecture specific places. Move ACPI_CPU_HOTPLUG_REG_LEN macro to more appropriate common header file. Signed-off-by: Salil Mehta Reviewed-by: Alex Bennée --- hw/acpi/cpu.c | 2 +- include/hw/acpi/cpu

[PATCH V2 01/10] accel/kvm: Extract common KVM vCPU {creation, parking} code

2023-09-29 Thread Salil Mehta via
KVM vCPU creation is done once during the initialization of the VM when Qemu threads are spawned. This is common to all the architectures. Hot-unplug of vCPU results in destruction of the vCPU objects in QOM but the KVM vCPU objects in the Host KVM are not destroyed and their representative KVM vC

[PATCH V2 00/10] Add architecture agnostic code to support vCPU Hotplug

2023-09-29 Thread Salil Mehta via
Virtual CPU hotplug support is being added across various architectures [1][3]. This series adds various code bits common across all architectures: 1. vCPU creation and Parking code refactor [Patch 1] 2. Update ACPI GED framework to support vCPU Hotplug [Patch 4,6,7] 3. ACPI CPUs AML code change [

Re: [PATCH] MAINTAINERS: Add unowned RISC-V related files to the right sections

2023-09-29 Thread LIU Zhiwei
On 2023/9/29 20:37, Thomas Huth wrote: There are a bunch of RISC-V files that are currently not covered by the "get_maintainers.pl" script. Add them to the right sections in MAINTAINERS to fix this problem. Signed-off-by: Thomas Huth Reviewed-by: LIU Zhiwei Zhiwei --- MAINTAINERS | 10

Re: [PATCH 22/22] exec/cpu: Call cpu_exec_realizefn() once in cpu_common_realize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: +++ b/target/hppa/cpu.c @@ -121,22 +121,11 @@ void hppa_cpu_do_unaligned_access(CPUState *cs, vaddr addr, static void hppa_cpu_realizefn(DeviceState *dev, Error **errp) { -CPUState *cs = CPU(dev); HPPACPUClass *acc = HPPA_CPU_GET_

Re: [PATCH 21/22] exec/cpu: Have cpu_exec_realize() return a boolean

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Following the example documented since commit e3fe3988d7 ("error: Document Error API usage rules"), have cpu_exec_realizefn() return a boolean indicating whether an error is set or not. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cp

Re: [PATCH 16/22] target/arm: Extract verify_accel_features() from cpu_realize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: When looking at the arm_cpu_realizefn() method, most of the code run before the cpu_exec_realizefn() call checks whether the requested CPU features are compatible with the requested accelerator. Extract this code to a dedicated handler matching our

Re: [PATCH 15/22] exec/cpu: Introduce CPUClass::verify_accel_features()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Some CPUs need to check the requested features are compatible with the requested accelerator. This has to be done*before* the accelerator realizes a vCPU. Introduce the verify_accel_features() handler and call it just before accel_cpu_realizefn().

Re: [PATCH 14/22] target/sparc: Init CPU environment *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: These fields from the environment don't affect how accelerators create their vCPU thread. We can safely reorder them*after* the cpu_exec_realizefn() call. Doing so allows further generic API simplification (in the next commit). Signed-off-by: Phil

Re: [PATCH 13/22] target/xtensa: Create IRQs *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized*after* the vCPU is realized. Doing so allows further generic API simplification (in few commits).

Re: [PATCH 12/22] target/mips: Create clock *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized*after* the vCPU is realized. Doing so allows further generic API simplification (in few commits).

Re: [PATCH 11/22] target/nios2: Create IRQs *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized*after* the vCPU is realized. Doing so allows further generic API simplification (in few commits).

Re: [PATCH 10/22] target/hppa: Create timer *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized *after* the vCPU is realized. Doing so allows further generic API simplification (in few commits).

Re: [PATCH 09/22] target/arm: Create timers *after* accelerator vCPU is realized

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Architecture specific hardware doesn't have a particular dependency on the accelerator vCPU (created with cpu_exec_realizefn), and can be initialized*after* the vCPU is realized. Doing so allows further generic API simplification (in few commits).

Re: [PATCH 08/22] exec/cpu: RFC Destroy vCPU address spaces in cpu_common_unrealize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: +++ b/hw/core/cpu-common.c @@ -224,6 +224,11 @@ static void cpu_common_unrealizefn(DeviceState *dev) /* Destroy vCPU thread */ cpu_remove_sync(cpu); + +/* Destroy CPU address space */ +for (unsigned idx = 0; idx < cpu->num_as

Re: [PATCH 07/22] exec/cpu: Introduce the CPU address space destruction function

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -761,6 +761,7 @@ void cpu_address_space_init(CPUState *cpu, int asidx, if (!cpu->cpu_ases) { cpu->cpu_ases = g_new0(CPUAddressSpace, cpu->num_ases); +cpu->cpu_ases_ref_co

Re: [PATCH 06/22] exec/cpu: Call cpu_remove_sync() once in cpu_common_unrealize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: While create_vcpu_thread() creates a vCPU thread, its counterpart is cpu_remove_sync(), which join and destroy the thread. create_vcpu_thread() is called in qemu_init_vcpu(), itself called in cpu_common_realizefn(). Since we don't have qemu_deinit_

Re: [PATCH 05/22] exec/cpu: Call qemu_init_vcpu() once in cpu_common_realize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: qemu_init_vcpu() is called in each ${target}_cpu_realize() before the call to parent_realize(), which is cpu_common_realizefn(). Call it once there. Signed-off-by: Philippe Mathieu-Daudé --- hw/core/cpu-common.c| 3 +++ target/alpha/cpu.c

Re: [RFC PATCH 04/22] exec/cpu: Never call cpu_reset() before cpu_realize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: QDev instance is expected to be in an unknown state until full object realization. Thus we shouldn't call DeviceReset() on an unrealized instance. Move the cpu_reset() call from*before* the parent realize() handler (effectively cpu_common_realizefn)

Re: [PATCH 03/22] target/i386/kvm: Correct comment in kvm_cpu_realize()

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: Signed-off-by: Philippe Mathieu-Daudé --- target/i386/kvm/kvm-cpu.c | 1 + 1 file changed, 1 insertion(+) Reviewed-by: Richard Henderson r~

Re: [PATCH 02/22] hw/intc/apic: Pass CPU using QOM link property

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: QOM objects shouldn't access each other internals fields except using the QOM API. Declare the 'cpu' and 'base-addr' properties, set them using object_property_set_link() and qdev_prop_set_uint32() respectively. Signed-off-by: Philippe Mathieu-Dau

Re: [PATCH 01/22] target/i386: Only realize existing APIC device

2023-09-29 Thread Richard Henderson
On 9/18/23 09:02, Philippe Mathieu-Daudé wrote: APIC state is created under a certain condition, use the same condition to realize it. Having a NULL APIC state is a bug: use assert(). Signed-off-by: Philippe Mathieu-Daudé --- target/i386/cpu-sysemu.c | 9 +++-- target/i386/cpu.c|

[PATCH v14 4/9] virtio-gpu: blob prep

2023-09-29 Thread Gurchetan Singh
From: Antonio Caggiano This adds preparatory functions needed to: - decode blob cmds - tracking iovecs Signed-off-by: Antonio Caggiano Signed-off-by: Dmitry Osipenko Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki

[PATCH v14 8/9] gfxstream + rutabaga: enable rutabaga

2023-09-29 Thread Gurchetan Singh
This change enables rutabaga to receive virtio-gpu-3d hypercalls when it is active. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Antonio Caggiano Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Akihiko Odaki

[PATCH v14 3/9] virtio-gpu: hostmem

2023-09-29 Thread Gurchetan Singh
From: Gerd Hoffmann Use VIRTIO_GPU_SHM_ID_HOST_VISIBLE as id for virtio-gpu. Signed-off-by: Antonio Caggiano Tested-by: Alyssa Ross Tested-by: Akihiko Odaki Tested-by: Huang Rui Acked-by: Huang Rui Acked-by: Michael S. Tsirkin Reviewed-by: Akihiko Odaki --- hw/display/virtio-gpu-pci.c

[PATCH v14 1/9] virtio: Add shared memory capability

2023-09-29 Thread Gurchetan Singh
From: "Dr. David Alan Gilbert" Define a new capability type 'VIRTIO_PCI_CAP_SHARED_MEMORY_CFG' to allow defining shared memory regions with sizes and offsets of 2^32 and more. Multiple instances of the capability are allowed and distinguished by a device-specific 'id'. Signed-off-by: Dr. David A

[PATCH v14 0/9] rutabaga_gfx + gfxstream

2023-09-29 Thread Gurchetan Singh
From: Gurchetan Singh Prior version: https://lists.gnu.org/archive/html/qemu-devel/2023-08/msg05005.html Even though reviewed, there were a few issues that needed to be addressed. 1) Packaging/Releasing Marc-Andre Lureau pointed a few issues with packaging the AEMU library: https://lists.gnu

[PATCH v14 5/9] gfxstream + rutabaga prep: added need defintions, fields, and options

2023-09-29 Thread Gurchetan Singh
This modifies the common virtio-gpu.h file have the fields and defintions needed by gfxstream/rutabaga, by VirtioGpuRutabaga. Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Ant

[PATCH v14 6/9] gfxstream + rutabaga: add initial support for gfxstream

2023-09-29 Thread Gurchetan Singh
This adds initial support for gfxstream and cross-domain. Both features rely on virtio-gpu blob resources and context types, which are also implemented in this patch. gfxstream has a long and illustrious history in Android graphics paravirtualization. It has been powering graphics in the Android

[PATCH v14 9/9] docs/system: add basic virtio-gpu documentation

2023-09-29 Thread Gurchetan Singh
This adds basic documentation for virtio-gpu. Suggested-by: Akihiko Odaki Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Antonio Caggiano Reviewed-by: Akihiko Odaki --- doc

[PATCH v14 7/9] gfxstream + rutabaga: meson support

2023-09-29 Thread Gurchetan Singh
- Add meson detection of rutabaga_gfx - Build virtio-gpu-rutabaga.c + associated vga/pci files when present Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Emmanouil Pitsidianakis Tested-by: Akihiko Odaki Reviewed-by: Emmanouil Pitsidianakis Reviewed-by: Antonio Caggiano R

[PATCH v14 2/9] virtio-gpu: CONTEXT_INIT feature

2023-09-29 Thread Gurchetan Singh
From: Antonio Caggiano The feature can be enabled when a backend wants it. Signed-off-by: Antonio Caggiano Signed-off-by: Gurchetan Singh Tested-by: Alyssa Ross Tested-by: Akihiko Odaki Tested-by: Huang Rui Acked-by: Huang Rui Reviewed-by: Marc-André Lureau Reviewed-by: Philippe Mathieu-D

Re: [PATCH v10 09/11] virtio-sound: implement audio output (TX)

2023-09-29 Thread Manos Pitsidianakis
On Fri, 29 Sep 2023 17:08, Emmanouil Pitsidianakis wrote: Handle output IO messages in the transmit (TX) virtqueue. [..] +if (!stream->active) { +/* Stream has stopped, so do not perform AUD_write. */ +goto return_tx_buffer; +} [..] +r

[PATCH v3 18/20] q800: add ESCC alias at 0xc000

2023-09-29 Thread Mark Cave-Ayland
Tests on real Q800 hardware show that the ESCC is addressable at multiple locations within the ESCC memory region - at least 0xc000, 0xc020 (as expected by the MacOS toolbox ROM) and 0xc040. All released NetBSD kernels before 10 use the 0xc000 address which causes a fatal error when running the

[PATCH v3 15/20] mac_via: workaround NetBSD ADB bus enumeration issue

2023-09-29 Thread Mark Cave-Ayland
NetBSD assumes it can send its first ADB command after sending the ADB_BUSRESET command in ADB_STATE_NEW without changing the state back to ADB_STATE_IDLE first as detailed in the ADB protocol. Add a workaround to detect this condition at the start of ADB enumeration and send the next command writ

[PATCH v3 03/20] q800: add machine id register

2023-09-29 Thread Mark Cave-Ayland
MacOS reads this address to identify the hardware. This is a basic implementation returning the ID of Quadra 800. Details: http://mess.redump.net/mess/driver_info/mac_technical_notes "There are 3 ID schemes [...] The third and most scalable is a machine ID register at 0x5ffc. The top wo

[PATCH v3 06/20] q800: allow accesses to RAM area even if less memory is available

2023-09-29 Thread Mark Cave-Ayland
MacOS attempts a series of writes and reads over the entire RAM area in order to determine the amount of RAM within the machine. Allow accesses to the entire RAM area ignoring writes and always reading zero for areas where there is no physical RAM installed to allow MacOS to detect the memory size

[PATCH v3 20/20] mac_via: extend timer calibration hack to work with A/UX

2023-09-29 Thread Mark Cave-Ayland
The A/UX timer calibration loop runs continuously until 2 consecutive iterations differ by at least 0x492 timer ticks. Modern hosts execute the timer calibration loop so fast that this situation never occurs causing a hang on boot. Use a similar method to Shoebill which is to randomly add 0x500 to

[PATCH v3 04/20] q800: implement additional machine id bits on VIA1 port A

2023-09-29 Thread Mark Cave-Ayland
Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- hw/misc/mac_via.c | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/hw/misc/mac_via.c b/hw/misc/mac_via.c index f84cc68849..e87a1b82d8 100644 --- a/hw/misc/ma

[PATCH v3 11/20] swim: add trace events for IWM and ISM registers

2023-09-29 Thread Mark Cave-Ayland
Signed-off-by: Mark Cave-Ayland Reviewed-by: Laurent Vivier --- hw/block/swim.c | 14 ++ hw/block/trace-events | 7 +++ 2 files changed, 21 insertions(+) diff --git a/hw/block/swim.c b/hw/block/swim.c index 333da08ce0..7df36ea139 100644 --- a/hw/block/swim.c +++ b/hw/bloc

[PATCH v3 14/20] mac_via: work around underflow in TimeDBRA timing loop in SETUPTIMEK

2023-09-29 Thread Mark Cave-Ayland
The MacOS toolbox ROM calculates the number of branches that can be executed per millisecond as part of its timer calibration. Since modern hosts are considerably quicker than original hardware, the negative counter reaches zero before the calibration completes leading to division by zero later in

[PATCH v3 19/20] q800: add alias for MacOS toolbox ROM at 0x40000000

2023-09-29 Thread Mark Cave-Ayland
According to the Apple Quadra 800 Developer Note document, the Quadra 800 ROM consists of 2 ROM code sections based at offsets 0x0 and 0x80. A/UX attempts to access the toolbox ROM at the lower offset during startup, so provide a memory alias to allow the access to succeed. Signed-off-by: Mark

[PATCH v3 09/20] q800: add Apple Sound Chip (ASC) audio to machine

2023-09-29 Thread Mark Cave-Ayland
The Quadra 800 has the enhanced ASC (EASC) audio chip which supports both the legacy IRQ routing through VIA2 and also "A/UX" mode routing direct to the CPU. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland --- hw/m68k/q800-glue.c | 11 ++- hw/m68k/q800.c

[PATCH v3 10/20] q800: add easc bool machine class property to switch between ASC and EASC

2023-09-29 Thread Mark Cave-Ayland
This determines whether the Apple Sound Chip (ASC) is set to enhanced mode (default) or to original mode. The real Q800 hardware used an EASC chip however a lot of older software only works with the older ASC chip. Adding this as a machine parameter allows QEMU to be used as an developer aid for t

[PATCH v3 07/20] audio: add Apple Sound Chip (ASC) emulation

2023-09-29 Thread Mark Cave-Ayland
The Apple Sound Chip was primarily used by the Macintosh II to generate sound in hardware which was previously handled by the toolbox ROM with software interrupts. Implement both the standard ASC and also the enhanced ASC (EASC) functionality which is used in the Quadra 800. Note that whilst real

[PATCH v3 12/20] swim: split into separate IWM and ISM register blocks

2023-09-29 Thread Mark Cave-Ayland
The swim chip provides an implementation of both Apple's IWM and ISM floppy disk controllers. Split the existing implementation into separate register banks for each controller, whilst also switching the IWM registers from 16-bit to 8-bit as implemented in real hardware. Signed-off-by: Mark Cave-A

[PATCH v3 08/20] asc: generate silence if FIFO empty but engine still running

2023-09-29 Thread Mark Cave-Ayland
MacOS (un)helpfully leaves the FIFO engine running even when all the samples have been written to the hardware, and expects the FIFO status flags and IRQ to be updated continuously. There is an additional problem in that not all audio backends guarantee an all-zero output when there is no FIFO da

[PATCH v3 17/20] mac_via: always clear ADB interrupt when switching to A/UX mode

2023-09-29 Thread Mark Cave-Ayland
When the NetBSD kernel initialises it can leave the ADB interrupt asserted depending upon where in the ADB poll cycle the MacOS ADB interrupt handler is when the NetBSD kernel disables interrupts. The NetBSD ADB driver uses the ADB interrupt state to determine if the ADB is busy and refuses to sen

[PATCH v3 16/20] mac_via: implement ADB_STATE_IDLE state if shift register in input mode

2023-09-29 Thread Mark Cave-Ayland
NetBSD switches directly to IDLE state without switching the shift register to input mode. Duplicate the existing ADB_STATE_IDLE logic in input mode from when the shift register is in output mode which allows the ADB autopoll handler to handle the response. Signed-off-by: Mark Cave-Ayland Reviewe

[PATCH v3 13/20] swim: update IWM/ISM register block decoding

2023-09-29 Thread Mark Cave-Ayland
Update the IWM/ISM register block decoding to match the description given in the "SWIM Chip Users Reference". This allows us to validate the device response to the guest OS which currently only does just enough to indicate that the floppy drive is unavailable. Signed-off-by: Mark Cave-Ayland Revi

[PATCH v3 02/20] q800: add djMEMC memory controller

2023-09-29 Thread Mark Cave-Ayland
The djMEMC controller is used to store information related to the physical memory configuration. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé --- MAINTAINERS | 2 + hw/m68k/Kconfig | 1 + hw/m68k/q800.c

[PATCH v3 05/20] q800: add IOSB subsystem

2023-09-29 Thread Mark Cave-Ayland
It is needed because it defines the BIOSConfig area. Co-developed-by: Laurent Vivier Signed-off-by: Mark Cave-Ayland --- MAINTAINERS| 2 + hw/m68k/Kconfig| 1 + hw/m68k/q800.c | 9 +++ hw/misc/Kconfig| 3 + hw/misc/iosb.c | 133 +++

[PATCH v3 00/20] q800: add support for booting MacOS Classic - part 2

2023-09-29 Thread Mark Cave-Ayland
This series contains the remaining patches needed to allow QEMU's q800 machine to boot MacOS Classic when used in conjunction with a real Quadra 800 ROM image. In fact with this series applied it is possible to boot all of the following OSs: - MacOS 7.1 - 8.1, with or without virtual memory enab

[PATCH v3 01/20] q800-glue.c: convert to Resettable interface

2023-09-29 Thread Mark Cave-Ayland
Convert the GLUE device to 3-phase reset. The legacy method doesn't do anything that's invalid in the hold phase, so the conversion is simple and not a behaviour change. Signed-off-by: Mark Cave-Ayland Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Laurent Vivier --- hw/m68k/q800-glue.c | 7

Re: [PATCH 1/9] accel/kvm: Extract common KVM vCPU {creation,parking} code

2023-09-29 Thread Alex Bennée
Salil Mehta writes: > Hi Alex, > Thanks for taking pains to review it. > >> From: Alex Bennée >> Salil Mehta writes: >> >> > KVM vCPU creation is done once during the initialization of the VM when >> > Qemu >> > threads are spawned. This is common to all the architectures. >> > >> > Hot-un

Re: [PATCH v2 53/53] migration/rdma: Replace flawed device detail dump by tracing

2023-09-29 Thread Fabiano Rosas
Markus Armbruster writes: > qemu_rdma_dump_id() dumps RDMA device details to stdout. > > rdma_start_outgoing_migration() calls it via qemu_rdma_source_init() > and qemu_rdma_resolve_host() to show source device details. > rdma_start_incoming_migration() arranges its call via > rdma_accept_incomin

Re: [PATCH v3 12/14] audio: forbid mixing default audiodev backend and -audiodev

2023-09-29 Thread Paolo Bonzini
On Fri, Sep 29, 2023 at 1:55 PM BALATON Zoltan wrote: > > On Fri, 29 Sep 2023, Paolo Bonzini wrote: > > Now that all callers support setting an audiodev, forbid using the default > > audiodev if any audiodev is defined on the command line. To make the > > detection easier make AUD_register_card()

Re: [PATCH v2 09/12] util/reserved-region: Add new ReservedRegion helpers

2023-09-29 Thread Jean-Philippe Brucker
On Wed, Sep 13, 2023 at 10:01:44AM +0200, Eric Auger wrote: > Introduce resv_region_list_insert() helper which inserts > a new ReservedRegion into a sorted list of reserved region. > In case of overlap, the new region has higher priority and > hides the existing overlapped segments. If the overlap

Re: [PATCH v2 07/12] virtio-iommu: Implement set_iova_ranges() callback

2023-09-29 Thread Jean-Philippe Brucker
On Wed, Sep 13, 2023 at 10:01:42AM +0200, Eric Auger wrote: > The implementation populates the array of per IOMMUDevice > host reserved regions. > > It is forbidden to have conflicting sets of host IOVA ranges > to be applied onto the same IOMMU MR (implied by different > host devices). > > Signe

Re: [PATCH] MAINTAINERS: Add some unowned files to the SBSA-REF section

2023-09-29 Thread Leif Lindholm
On Fri, Sep 29, 2023 at 16:19:18 +0200, Thomas Huth wrote: > These files belong to the sbsa-ref machine and thus should > be listed here. First of all, thanks for this. > Signed-off-by: Thomas Huth > --- > MAINTAINERS | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/MAINTAINERS b/MA

RE: [PATCH 9/9] target/arm/kvm: Write CPU state back to KVM on reset

2023-09-29 Thread Salil Mehta via
> From: Alex Bennée > Sent: Friday, September 29, 2023 3:40 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; Jonathan Cameron ; > lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.co

RE: [PATCH 8/9] physmem,gdbstub: Add helper functions to help *unrealize* vCPU object

2023-09-29 Thread Salil Mehta via
> From: Alex Bennée > Sent: Friday, September 29, 2023 3:35 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; Jonathan Cameron ; > lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.co

Re: [PATCH v2 05/12] virtio-iommu: Introduce per IOMMUDevice reserved regions

2023-09-29 Thread Jean-Philippe Brucker
Hi Eric, On Wed, Sep 13, 2023 at 10:01:40AM +0200, Eric Auger wrote: > For the time being the per device reserved regions are > just a duplicate of IOMMU wide reserved regions. Subsequent > patches will combine those with host reserved regions, if any. > > Signed-off-by: Eric Auger > --- > incl

RE: [PATCH 3/9] hw/acpi: Add ACPI CPU hotplug init stub

2023-09-29 Thread Salil Mehta via
> From: Alex Bennée > Sent: Friday, September 29, 2023 3:27 PM > To: Salil Mehta > Cc: qemu-devel@nongnu.org; qemu-...@nongnu.org; m...@kernel.org; jean- > phili...@linaro.org; Jonathan Cameron ; > lpieral...@kernel.org; peter.mayd...@linaro.org; > richard.hender...@linaro.org; imamm...@redhat.co

Re: [PATCH v2 52/53] migration/rdma: Use error_report() & friends instead of stderr

2023-09-29 Thread Fabiano Rosas
Markus Armbruster writes: > error_report() obeys -msg, reports the current error location if any, > and reports to the current monitor if any. Reporting to stderr > directly with fprintf() or perror() is wrong, because it loses all > this. > > Fix the offenders. Bonus: resolves a FIXME about pr

Re: [PATCH v2 51/53] migration/rdma: Downgrade qemu_rdma_cleanup() errors to warnings

2023-09-29 Thread Fabiano Rosas
Markus Armbruster writes: > Functions that use an Error **errp parameter to return errors should > not also report them to the user, because reporting is the caller's > job. When the caller does, the error is reported twice. When it > doesn't (because it recovered from the error), there is no e

Re: [PATCH v2 29/53] migration/rdma: Check negative error values the same way everywhere

2023-09-29 Thread Fabiano Rosas
Markus Armbruster writes: > When a function returns 0 on success, negative value on error, > checking for non-zero suffices, but checking for negative is clearer. > So do that. > > Signed-off-by: Markus Armbruster Reviewed-by: Fabiano Rosas

  1   2   3   >