RE: [PATCH] target/i386/hax: Add XCR0 support

2023-01-10 Thread Wang, Wenchao
Hi, Paolo, Sorry for bothering you. Do you think my answer is reasonable? Or do you have any other questions on that? If you agree, could you help to merge this patch in your coming pull request? Thanks a lot. Best Regards, Wenchao From: Wang, Wenchao Sent: Wednesday, December 28, 2022 16:55

[PATCH v5 0/1] python/machine: Fix AF_UNIX path too long

2023-01-10 Thread Peter Delevoryas
v1: https://lore.kernel.org/qemu-devel/20220705214659.73369-1-pe...@pjd.dev/ v2: https://lore.kernel.org/qemu-devel/20220716173434.17183-1-pe...@pjd.dev/ v3: - Changed QEMUMachine._name to f"{id(self):x}". Suggestion was to do f"{id(self):02x}", but the id's look like they are probably ju

Re: [PATCH] remove unnecessary extern "C" blocks

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 09:49:46AM +0100, Paolo Bonzini wrote: > A handful of header files in QEMU are wrapped with extern "C" blocks. > These are not necessary: there are C++ source files anymore in QEMU, s/are/are no/ > and even where there were some, they did not include most of these > files

Re: [RFC PATCH 4/4] qom: Warn when deprecated class property can be removed

2023-01-10 Thread Bernhard Beschow
Am 9. Januar 2023 22:54:19 UTC schrieb "Philippe Mathieu-Daudé" : >Per docs/system/deprecated.rst, a deprecated feature can be >removed after 2 releases. Since we commit when a class property >is deprecated, we can warn when the deprecation period is over. > >See also commit ef1f5b0a96 ("docs:

[PATCH v4 00/11] iotests: use vm.cmd()

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
Hi all! Let's get rid of pattern result = self.vm.qmp(...) self.assert_qmp(result, 'return', {}) And switch to just self.vm.cmd(...) v4: resend to fix CC v3: rebase on master, fix some over-80 lines Vladimir Sementsov-Ogievskiy (11): python: rename QEMUMonitorProtocol.cmd() to c

Re: [PATCH v4 1/1] python/machine: Fix AF_UNIX path too long on macOS

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 12:07:56AM -0800, Peter Delevoryas wrote: > On macOS, private $TMPDIR's are the default. These $TMPDIR's are > generated from a user's unix UID and UUID [1], which can create a > relatively long path: > > /var/folders/d7/rz20f6hd709c1ty8f6_6y_z4gn/T/ > > QEMU's avo

Re: [PATCH v2 2/5] util/qht: add missing atomic_set(hashes[i])

2023-01-10 Thread Alex Bennée
Emilio Cota writes: > We forgot to add this one in "a890643958 util/qht: atomically set b->hashes". > > Detected with tsan. > > Reviewed-by: Richard Henderson > Reviewed-by: Philippe Mathieu-Daudé > Signed-off-by: Emilio Cota Reviewed-by: Alex Bennée -- Alex Bennée Virtualisation Tech Le

Re: [PATCH v3 3/8] configure: replace Perl usage with sed

2023-01-10 Thread Thomas Huth
On 10/01/2023 09.02, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau Let's try to reduce our Perl usage during config/build-time. Note: this patch might be dropped if "configure: remove backwards-compatibility code" is merged earlier. Signed-off-by: Marc-André Lureau --- configu

Re: [PATCH v4 16/17] ui: Split hmp_mouse_set() and move the HMP part to ui/

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 08:03:20PM +0100, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > include/monitor/hmp.h | 1 + > include/ui/console.h | 2 +- > monitor/misc.c| 1 - > ui/input.c| 15 +++ > ui/ui-hmp-cmds.c | 8 > 5 fil

[PATCH v4 10/11] tests/vm/basevm.py: use cmd() instead of qmp()

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
We don't expect failure here and need 'result' object. cmd() is better in this case. Signed-off-by: Vladimir Sementsov-Ogievskiy --- tests/vm/basevm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/vm/basevm.py b/tests/vm/basevm.py index 2276364c42..ff7e4fea15 100

Re: [PATCH 1/5] migration: Updated QAPI format for 'migrate' qemu monitor command

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 01:09:35PM +0530, Het Gala wrote: > > On 09/01/23 7:37 pm, Daniel P. Berrangé wrote: > > On Mon, Dec 26, 2022 at 05:33:25AM +, Het Gala wrote: > > > From: Author Het Gala > > > > > > Existing 'migrate' QAPI design enforces transport mechanism, ip address > > > of dest

Re: [PATCH v3 1/8] build-sys: fix crlf-ending C code

2023-01-10 Thread Thomas Huth
On 10/01/2023 09.02, marcandre.lur...@redhat.com wrote: From: Marc-André Lureau On msys2, the shader-to-C script produces bad C: ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character [-Werror] Fix it by changing the line ending from crlf to lf, and convert the script to

Re: [PATCH] python: QEMUMachine: enable qmp accept timeout by default

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
On 7/12/22 00:21, John Snow wrote: On Mon, Jul 11, 2022 at 5:16 PM John Snow wrote: On Fri, Jun 24, 2022 at 3:53 PM Vladimir Sementsov-Ogievskiy wrote: I've spent much time trying to debug hanging pipeline in gitlab. I started from and idea that I have problem in code in my series (which ha

[PATCH v5 1/1] python/machine: Fix AF_UNIX path too long on macOS

2023-01-10 Thread Peter Delevoryas
On macOS, private $TMPDIR's are the default. These $TMPDIR's are generated from a user's unix UID and UUID [1], which can create a relatively long path: /var/folders/d7/rz20f6hd709c1ty8f6_6y_z4gn/T/ QEMU's avocado tests create a temporary directory prefixed by "avo_qemu_sock_", and create

Re: [PATCH v4 17/17] ui: Simplify control flow in qemu_mouse_set()

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 08:03:21PM +0100, Markus Armbruster wrote: > Signed-off-by: Markus Armbruster > --- > ui/input.c | 24 +++- > 1 file changed, 11 insertions(+), 13 deletions(-) Reviewed-by: Daniel P. Berrangé With regards, Daniel -- |: https://berrange.com -o-

[PATCH v6 4/4] softmmu/rtc: Emit warning when using driftfix=slew on systems without mc146818

2023-01-10 Thread Thomas Huth
The 'slew' lost tick policy is only available on systems with a mc146818 RTC. On other systems, "-rtc driftfix=slew" is currently silently ignored. Let's emit at least a warning in this case to make the users aware that there is something wrong in their command line settings. Reviewed-by: Philippe

[PATCH v2 5/5] hw/i2c/versatile_i2c: Rename versatile_i2c -> arm_sbcon_i2c

2023-01-10 Thread Philippe Mathieu-Daudé
This device model started with the Versatile board, named TYPE_VERSATILE_I2C, then ended up renamed TYPE_ARM_SBCON_I2C as per the official "ARM SBCon two-wire serial bus interface" description from: https://developer.arm.com/documentation/dui0440/b/programmer-s-reference/two-wire-serial-bus-interfa

[PATCH] mips: always include nanomips disassembler

2023-01-10 Thread Paolo Bonzini
Since the nanomips disassembler is not C++ code anymore, it need not depend on link_language == cpp. Always include it and remove the CONFIG_NANOMIPS_DIS symbol. Cc: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- disas/meson.build | 3 +-- include/exec/poison.h | 1 - meson.build

[PATCH v4 02/11] python/qemu: rename command() to cmd()

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
Use a shorter name. We are going to move in iotests from qmp() to command() where possible. But command() is longer than qmp() and don't look better. Let's rename. You can simply grep for '\.command(' and for 'def command(' to check that everything is updated (command() in tests/docker/docker.py i

[PATCH v6 2/4] hw/core/qdev-properties-system: Allow the 'slew' policy only on x86

2023-01-10 Thread Thomas Huth
The 'slew' tick policy is currently enforced to be only available on x86 via some "#ifdef TARGET_I386" statements in mc146818rtc.c. We want to get rid of those #ifdefs, so we need a different way of checking whether the policy is allowed or not. Using the setter function in hw/core/qdev-properties-

[PATCH v2 4/5] hw/i2c/versatile_i2c: Use ARM_SBCON_I2C() macro

2023-01-10 Thread Philippe Mathieu-Daudé
ARM_SBCON_I2C() macro and ArmSbconI2CState typedef are already declared via the QOM DECLARE_INSTANCE_CHECKER() macro in "hw/i2c/arm_sbcon_i2c.h". Drop the VERSATILE_I2C declarations from versatile_i2c.c. Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- hw/i2c/versatile_i

[PATCH v4 03/11] python/machine.py: upgrade vm.cmd() method

2023-01-10 Thread Vladimir Sementsov-Ogievskiy
The method is not popular in iotests, we prefer use vm.qmp() and then check success by hand.. But that's not optimal. To simplify movement to vm.cmd() let's support same interface improvements like in vm.qmp(). Signed-off-by: Vladimir Sementsov-Ogievskiy --- python/qemu/machine/machine.py | 12 +

Re: [RFC PATCH 4/4] qom: Warn when deprecated class property can be removed

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 11:54:19PM +0100, Philippe Mathieu-Daudé wrote: > Per docs/system/deprecated.rst, a deprecated feature can be > removed after 2 releases. Since we commit when a class property > is deprecated, we can warn when the deprecation period is over. > > See also commit ef1f5b0a96 (

[PATCH v6 0/4] Make the mc146818 RTC device target independent

2023-01-10 Thread Thomas Huth
The basic idea of this patch set is to change hw/rtc/mc146818rtc.c into target independent code so that the file only has to be compiled once instead of multiple times (and that it can be used in a qemu-system-all binary once we get there). The first patch extracts some functions from the APIC cod

Re: [RFC PATCH 1/4] qom: Introduce object_class_property_deprecate()

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 11:54:16PM +0100, Philippe Mathieu-Daudé wrote: > Introduce object_class_property_deprecate() to register > a QOM property as deprecated. When this property's getter / > setter is called, a deprecation warning is displayed on the > monitor. > > Inspired-by: Daniel P. Berran

Re: [PATCH v6 0/4] Make the mc146818 RTC device target independent

2023-01-10 Thread Philippe Mathieu-Daudé
On 10/1/23 10:53, Thomas Huth wrote: The basic idea of this patch set is to change hw/rtc/mc146818rtc.c into target independent code so that the file only has to be compiled once instead of multiple times (and that it can be used in a qemu-system-all binary once we get there). Thomas Huth (4):

Re: [PATCH v5 0/1] python/machine: Fix AF_UNIX path too long

2023-01-10 Thread Peter Delevoryas
On Tue, Jan 10, 2023 at 09:38:38AM +0100, Philippe Mathieu-Daudé wrote: > On 10/1/23 09:29, Peter Delevoryas wrote: > > > $ make check-avocado > > > Avocado crashed: TypeError: cannot pickle '_thread.RLock' object > > Yeah... you have to pick Cleber's patches from > https://gitlab.com/cleber.gnu

[PATCH v6 1/4] hw/intc: Extract the IRQ counting functions into a separate file

2023-01-10 Thread Thomas Huth
These IRQ counting functions will soon be required in binaries that do not include the APIC code, too, so let's extract them into a separate file that can be linked independently of the APIC code. While we're at it, change the apic_* prefix into kvm_* since the functions are used from the i8259 PI

Re: [RFC PATCH 2/4] hw/block: Rename TYPE_PFLASH_CFI02 'width' property as 'device-width'

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 11:54:17PM +0100, Philippe Mathieu-Daudé wrote: > Use the same property name than the TYPE_PFLASH_CFI01 model. > > Deprecate the current 'width' property and add the 'device-width' > property pointing to the same field in PFlashCFI02. > > Signed-off-by: Philippe Mathieu-Da

[PATCH v6 3/4] hw/rtc/mc146818rtc: Make the mc146818 RTC device target independent

2023-01-10 Thread Thomas Huth
The only reason for this code being target dependent was the IRQ-counting related code in rtc_policy_slew_deliver_irq(). Since these functions have been moved into a new, separate file (kvm_irqcount.c) which is now always compiled and linked if necessary, we can get rid of the #ifdef TARGET_I386 sw

Re: [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-10 Thread David Hildenbrand
On 09.01.23 20:54, Peter Xu wrote: On Mon, Jan 09, 2023 at 03:34:48PM +0100, David Hildenbrand wrote: On 05.01.23 18:15, Peter Xu wrote: On Thu, Jan 05, 2023 at 09:35:54AM +0100, David Hildenbrand wrote: On 04.01.23 18:23, Peter Xu wrote: On Thu, Dec 22, 2022 at 12:02:10PM +0100, David Hilden

Re: [PATCH v3 0/8] Fix win32/msys2 shader compilation & update lcitool deps

2023-01-10 Thread Thomas Huth
On 10/01/2023 11.41, Alex Bennée wrote: marcandre.lur...@redhat.com writes: From: Marc-André Lureau Hi, Fix the shader compilation error on win32/msys2 and convert the related script from perl to python. Drop unneeded dependencies from lcitool project. Queued to testing/next, thanks. Pl

Re: [PATCH v3 1/8] build-sys: fix crlf-ending C code

2023-01-10 Thread Marc-André Lureau
Hi On Tue, Jan 10, 2023 at 12:33 PM Thomas Huth wrote: > On 10/01/2023 09.02, marcandre.lur...@redhat.com wrote: > > From: Marc-André Lureau > > > > On msys2, the shader-to-C script produces bad C: > > ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " > character [-Werror] > > >

Re: [PATCH v4 00/12] Compiler warning fixes for libvhost-user, libvduse

2023-01-10 Thread Paolo Bonzini
Il gio 5 gen 2023, 02:58 Michael S. Tsirkin ha scritto: > Paolo I understand you are merging this? > It would be fine either way; when I find issues in a series I tend to queue it just in case the other maintainer prefers to leave further handling to me. In this case it caught my eye due to the

Re: [PATCH v4] qapi/qmp: Add timestamps to qmp command responses

2023-01-10 Thread Denis Plotnikov
[ping] On 01.11.2022 18:37, Denis Plotnikov wrote: Add "start" & "end" time values to QMP command responses. These time values are added to let the qemu management layer get the exact command execution time without any other time variance which might be brought by other parts of management laye

Re: [RFC PATCH 1/4] qom: Introduce object_class_property_deprecate()

2023-01-10 Thread Daniel P . Berrangé
On Mon, Jan 09, 2023 at 11:54:16PM +0100, Philippe Mathieu-Daudé wrote: > Introduce object_class_property_deprecate() to register > a QOM property as deprecated. When this property's getter / > setter is called, a deprecation warning is displayed on the > monitor. > > Inspired-by: Daniel P. Berran

Re: [PATCH] remove unnecessary extern "C" blocks

2023-01-10 Thread Peter Maydell
On Tue, 10 Jan 2023 at 09:33, Paolo Bonzini wrote: > > A handful of header files in QEMU are wrapped with extern "C" blocks. > These are not necessary: there are C++ source files anymore in QEMU, > and even where there were some, they did not include most of these > files anyway. Any reason not t

Re: [PATCH] mips: always include nanomips disassembler

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 09:49:42AM +0100, Paolo Bonzini wrote: > Since the nanomips disassembler is not C++ code anymore, it need not > depend on link_language == cpp. Always include it and remove the > CONFIG_NANOMIPS_DIS symbol. > > Cc: Philippe Mathieu-Daud?? The accent in Philippe's name go

Re: [PATCH v3 0/8] Fix win32/msys2 shader compilation & update lcitool deps

2023-01-10 Thread Marc-André Lureau
Hi On Tue, Jan 10, 2023 at 2:41 PM Alex Bennée wrote: > > marcandre.lur...@redhat.com writes: > > > From: Marc-André Lureau > > > > Hi, > > > > Fix the shader compilation error on win32/msys2 and convert the related > script > > from perl to python. Drop unneeded dependencies from lcitool proje

Re: [PATCH v4 01/11] python: rename QEMUMonitorProtocol.cmd() to cmd_raw()

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 11:37:48AM +0300, Vladimir Sementsov-Ogievskiy wrote: > Having cmd() and command() methods in one class doesn't look good. > Rename cmd() to cmd_raw(), to show its meaning better. > > We also want to rename command() to cmd() in future, so this commit is a > necessary first

Re: [PATCH v4 02/11] python/qemu: rename command() to cmd()

2023-01-10 Thread Daniel P . Berrangé
On Tue, Jan 10, 2023 at 11:37:49AM +0300, Vladimir Sementsov-Ogievskiy wrote: > Use a shorter name. We are going to move in iotests from qmp() to > command() where possible. But command() is longer than qmp() and don't > look better. Let's rename. > > You can simply grep for '\.command(' and for '

Re: [PATCH v3 0/8] Fix win32/msys2 shader compilation & update lcitool deps

2023-01-10 Thread Alex Bennée
marcandre.lur...@redhat.com writes: > From: Marc-André Lureau > > Hi, > > Fix the shader compilation error on win32/msys2 and convert the related script > from perl to python. Drop unneeded dependencies from lcitool project. Queued to testing/next, thanks. -- Alex Bennée Virtualisation Tech

Re: [PATCH] mips: always include nanomips disassembler

2023-01-10 Thread Philippe Mathieu-Daudé
On 10/1/23 09:49, Paolo Bonzini wrote: Since the nanomips disassembler is not C++ code anymore, it need not depend on link_language == cpp. Always include it and remove the CONFIG_NANOMIPS_DIS symbol. Cc: Philippe Mathieu-Daudé Signed-off-by: Paolo Bonzini --- disas/meson.build | 3 +--

Re: [PATCH v14 01/11] s390x/cpu topology: adding s390 specificities to CPU topology

2023-01-10 Thread Thomas Huth
On 05/01/2023 15.53, Pierre Morel wrote: S390 adds two new SMP levels, drawers and books to the CPU topology. The S390 CPU have specific toplogy features like dedication and polarity to give to the guest indications on the host vCPUs scheduling and help the guest take the best decisions on the sc

Re: [PATCH v5 10/11] hw/riscv/boot.c: consolidate all kernel init in riscv_load_kernel()

2023-01-10 Thread Daniel Henrique Barboza
On 1/8/23 00:33, Bin Meng wrote: On Mon, Jan 2, 2023 at 7:55 PM Daniel Henrique Barboza wrote: The microchip_icicle_kit, sifive_u, spike and virt boards are now doing the same steps when '-kernel' is used: - execute load_kernel() - load init_rd() - write kernel_cmdline Let's fold everythin

Re: [PATCH v3 1/6] migration: Allow immutable device state to be migrated early (i.e., before RAM)

2023-01-10 Thread David Hildenbrand
On 10.01.23 11:18, David Hildenbrand wrote: On 09.01.23 20:54, Peter Xu wrote: On Mon, Jan 09, 2023 at 03:34:48PM +0100, David Hildenbrand wrote: On 05.01.23 18:15, Peter Xu wrote: On Thu, Jan 05, 2023 at 09:35:54AM +0100, David Hildenbrand wrote: On 04.01.23 18:23, Peter Xu wrote: On Thu, D

Re: [PATCH 13/14] hw/intc/xilinx_intc: Use 'XpsIntc' typedef instead of 'struct xlx_pic'

2023-01-10 Thread Edgar E. Iglesias
On Mon, Jan 09, 2023 at 03:03:05PM +0100, Philippe Mathieu-Daudé wrote: > This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() > macro call, to avoid after a QOM refactor: > > hw/intc/xilinx_intc.c:45:1: error: declaration of anonymous struct must be > a definition > DECLARE_INSTAN

Re: [PATCH 14/14] hw/timer/xilinx_timer: Use XpsTimerState instead of 'struct timerblock'

2023-01-10 Thread Edgar E. Iglesias
On Mon, Jan 09, 2023 at 03:03:06PM +0100, Philippe Mathieu-Daudé wrote: > This remove a use of 'struct' in the DECLARE_INSTANCE_CHECKER() > macro call, to avoid after a QOM refactor: > > hw/timer/xilinx_timer.c:65:1: error: declaration of anonymous struct must > be a definition > DECLARE_INST

Re: [PATCH] hw/display/xlnx_dp: fix overflow in xlnx_dp_aux_push_tx_fifo()

2023-01-10 Thread Edgar E. Iglesias
On Mon, Jan 09, 2023 at 01:59:33PM +0800, Qiang Liu wrote: > This patch checks if the s->tx_fifo is full. + CC: Fred Reviewed-by: Edgar E. Iglesias > > Fixes: 58ac482a66de ("introduce xlnx-dp") > Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1424 > Reported-by: Qiang Liu > Signed-o

[PATCH v6 32/51] hw/xen: Implement EVTCHNOP_bind_ipi

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 69 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 + 3 files changed, 86 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xe

[PATCH v6 50/51] hw/xen: Add xen_xenstore device for xenstore emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse Just the basic shell, with the event channel hookup. It only dumps the buffer for now; a real ring implmentation will come in a subsequent patch. Signed-off-by: David Woodhouse --- hw/i386/kvm/meson.build| 1 + hw/i386/kvm/xen_evtchn.c | 1 + hw/i386/kvm/xen_xen

[PATCH v6 42/51] hw/xen: Add xen_gnttab device for grant table emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/meson.build | 1 + hw/i386/kvm/xen_gnttab.c | 110 ++ hw/i386/kvm/xen_gnttab.h | 18 +++ hw/i386/pc.c | 2 + target/i386/kvm/xen-emu.c | 3 ++ 5 files changed, 13

[PATCH v6 45/51] hw/xen: Implement GNTTABOP_query_size

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 19 +++ hw/i386/kvm/xen_gnttab.h | 2 ++ target/i386/kvm/xen-emu.c | 16 +++- 3 files changed, 36 insertions(+), 1 deletion(-) diff --git a/hw/i386/kvm/xen_gnttab.c b/hw/i386/kvm/

[PATCH v6 21/51] i386/xen: handle VCPUOP_register_vcpu_time_info

2023-01-10 Thread David Woodhouse
From: Joao Martins In order to support Linux vdso in Xen. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/cpu.h | 1 + target/i386/kvm/xen-emu.c | 100 +- target/i386/machine.c | 1 + 3 files changed, 90 insertions

[PATCH v6 06/51] i386/hvm: Set Xen vCPU ID in KVM

2023-01-10 Thread David Woodhouse
From: David Woodhouse There are (at least) three different vCPU ID number spaces. One is the internal KVM vCPU index, based purely on which vCPU was chronologically created in the kernel first. If userspace threads are all spawned and create their KVM vCPUs in essentially random order, then the K

[PATCH v6 46/51] i386/xen: handle PV timer hypercalls

2023-01-10 Thread David Woodhouse
From: Joao Martins Introduce support for one shot and periodic mode of Xen PV timers, whereby timer interrupts come through a special virq event channel with deadlines being set through: 1) set_timer_op hypercall (only oneshot) 2) vcpu_op hypercall for {set,stop}_{singleshot,periodic}_timer hype

[PATCH v6 33/51] hw/xen: Implement EVTCHNOP_send

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 180 ++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 12 +++ 3 files changed, 194 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_ev

[PATCH v6 13/51] hw/xen: Add xen_overlay device for emulating shared xenheap pages

2023-01-10 Thread David Woodhouse
From: David Woodhouse For the shared info page and for grant tables, Xen shares its own pages from the "Xen heap" to the guest. The guest requests that a given page from a certain address space (XENMAPSPACE_shared_info, etc.) be mapped to a given GPA using the XENMEM_add_to_physmap hypercall. To

[PATCH v6 25/51] i386/xen: implement HVMOP_set_param

2023-01-10 Thread David Woodhouse
From: Ankur Arora This is the hook for adding the HVM_PARAM_CALLBACK_IRQ parameter in a subsequent commit. Signed-off-by: Ankur Arora Signed-off-by: Joao Martins [dwmw2: Split out from another commit] Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 33 +

[PATCH v6 35/51] hw/xen: Implement EVTCHNOP_bind_interdomain

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 78 +++ hw/i386/kvm/xen_evtchn.h | 2 + target/i386/kvm/xen-emu.c | 16 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen_

[PATCH v6 10/51] i386/xen: implement HYPERVISOR_xen_version

2023-01-10 Thread David Woodhouse
From: Joao Martins This is just meant to serve as an example on how we can implement hypercalls. xen_version specifically since Qemu does all kind of feature controllability. So handling that here seems appropriate. Signed-off-by: Joao Martins [dwmw2: Implement kvm_gva_rw() safely] Signed-off-b

[PATCH v6 34/51] hw/xen: Implement EVTCHNOP_alloc_unbound

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 32 hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 15 +++ 3 files changed, 49 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm/xen

[PATCH v6 16/51] i386/xen: implement HYPERVISOR_memory_op

2023-01-10 Thread David Woodhouse
From: Joao Martins Specifically XENMEM_add_to_physmap with space XENMAPSPACE_shared_info to allow the guest to set its shared_info page. Signed-off-by: Joao Martins [dwmw2: Use the xen_overlay device, add compat support] Signed-off-by: David Woodhouse --- target/i386/kvm/trace-events | 1 +

[PATCH v6 04/51] i386/kvm: Add xen-version KVM accelerator property and init KVM Xen support

2023-01-10 Thread David Woodhouse
From: David Woodhouse This just initializes the basic Xen support in KVM for now. Only permitted on TYPE_PC_MACHINE because that's where the sysbus devices for Xen heap overlay, event channel, grant tables and other stuff will exist. There's no point having the basic hypercall support if nothing

[PATCH v6 20/51] i386/xen: handle VCPUOP_register_vcpu_info

2023-01-10 Thread David Woodhouse
From: Joao Martins Handle the hypercall to set a per vcpu info, and also wire up the default vcpu_info in the shared_info page for the first 32 vCPUs. To avoid deadlock within KVM a vCPU thread must set its *own* vcpu_info rather than it being set from the context in which the hypercall is invok

[PATCH v6 12/51] i386/xen: Implement SCHEDOP_poll and SCHEDOP_yield

2023-01-10 Thread David Woodhouse
From: David Woodhouse They both do the same thing and just call sched_yield. This is enough to stop the Linux guest panicking when running on a host kernel which doesn't intercept SCHEDOP_poll and lets it reach userspace. Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 12 ++

[PATCH v6 11/51] i386/xen: implement HYPERVISOR_sched_op, SCHEDOP_shutdown

2023-01-10 Thread David Woodhouse
From: Joao Martins It allows to shutdown itself via hypercall with any of the 3 reasons: 1) self-reboot 2) shutdown 3) crash Implementing SCHEDOP_shutdown sub op let us handle crashes gracefully rather than leading to triple faults if it remains unimplemented. In addition, the SHUTDOWN_so

[PATCH v6 36/51] hw/xen: Implement EVTCHNOP_bind_vcpu

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 40 +++ hw/i386/kvm/xen_evtchn.h | 2 ++ target/i386/kvm/xen-emu.c | 12 3 files changed, 54 insertions(+) diff --git a/hw/i386/kvm/xen_evtchn.c b/hw/i386/kvm

[PATCH v6 44/51] i386/xen: Implement HYPERVISOR_grant_table_op and GNTTABOP_[gs]et_verson

2023-01-10 Thread David Woodhouse
From: David Woodhouse Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_gnttab.c | 31 hw/i386/kvm/xen_gnttab.h | 5 target/i386/kvm/xen-emu.c | 60 +++ 3 files changed, 96 insertions(+) diff --git a/hw/i386/kvm/xen_gnttab.c b/h

[PATCH v6 49/51] hw/xen: Add backend implementation of interdomain event channel support

2023-01-10 Thread David Woodhouse
From: David Woodhouse The provides the QEMU side of interdomain event channels, allowing events to be sent to/from the guest. The API mirrors libxenevtchn, and in time both this and the real Xen one will be available through ops structures so that the PV backend drivers can use the correct one a

[RFC PATCH v1 09/15] hw/xen: Rename xen_common.h to xen_native.h

2023-01-10 Thread David Woodhouse
From: David Woodhouse This header is now only for native Xen code, not PV backends that may be used in Xen emulation. Since the toolstack libraries may depend on the specific version of Xen headers that they pull in (and will set the __XEN_TOOLS__ macro to enable internal definitions that they de

[PATCH v6 40/51] hw/xen: Support HVM_PARAM_CALLBACK_TYPE_PCI_INTX callback

2023-01-10 Thread David Woodhouse
From: David Woodhouse The guest is permitted to specify an arbitrary domain/bus/device/function and INTX pin from which the callback IRQ shall appear to have come. In QEMU we can only easily do this for devices that actually exist, and even that requires us "knowing" that it's a PCMachine in ord

[RFC PATCH v1 08/15] hw/xen: Use XEN_PAGE_SIZE in PV backend drivers

2023-01-10 Thread David Woodhouse
From: David Woodhouse XC_PAGE_SIZE comes from the actual Xen libraries, while XEN_PAGE_SIZE is provided by QEMU itself in xen_backend_ops.h. For backends which may be built for emulation mode, use the latter. Signed-off-by: David Woodhouse --- hw/block/dataplane/xen-block.c | 8 hw/d

[PATCH v6 23/51] i386/xen: implement HYPERVISOR_event_channel_op

2023-01-10 Thread David Woodhouse
From: Joao Martins Additionally set XEN_INTERFACE_VERSION to most recent in order to exercise the "new" event_channel_op. Signed-off-by: Joao Martins [dwmw2: Ditch event_channel_op_compat which was never available to HVM guests] Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 2

[PATCH v6 26/51] hw/xen: Add xen_evtchn device for event channel emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse Include basic support for setting HVM_PARAM_CALLBACK_IRQ to the global vector method HVM_PARAM_CALLBACK_TYPE_VECTOR, which is handled in-kernel by raising the vector whenever the vCPU's vcpu_info->evtchn_upcall_pending flag is set. Signed-off-by: David Woodhouse --- hw/i3

[RFC PATCH v1 06/15] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-01-10 Thread David Woodhouse
From: Paul Durrant Signed-off-by: Paul Durrant Signed-off-by: David Woodhouse --- accel/xen/xen-all.c | 11 +- hw/char/xen_console.c | 2 +- hw/xen/xen-bus-helper.c | 61 +++ hw/xen/xen-bus.c| 258 ---

[PATCH v6 02/51] xen: add CONFIG_XENFV_MACHINE and CONFIG_XEN_EMU options for Xen emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse The XEN_EMU option will cover core Xen support in target/, which exists only for x86 with KVM today but could theoretically also be implemented on Arm/Aarch64 and with TCG or other accelerators. It will also cover the support for architecture-independent grant table and even

[RFC PATCH v1 15/15] i386/xen: Initialize XenBus and legacy backends from pc_init1()

2023-01-10 Thread David Woodhouse
From: David Woodhouse Now that we're close to being able to use the PV backends without actual Xen, move the bus instantiation out from xen_hvm_init_pc() to pc_init1(). However, still only do it for (xen_mode == XEN_ATTACH) (i.e. when running on true Xen) because we don't have XenStore ops for e

[PATCH v6 19/51] i386/xen: implement HYPERVISOR_vcpu_op

2023-01-10 Thread David Woodhouse
From: Joao Martins This is simply when guest tries to register a vcpu_info and since vcpu_info placement is optional in the minimum ABI therefore we can just fail with -ENOSYS Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- target/i386/kvm/xen-emu.c | 25 +++

[PATCH v6 15/51] i386/xen: manage and save/restore Xen guest long_mode setting

2023-01-10 Thread David Woodhouse
From: David Woodhouse Xen will "latch" the guest's 32-bit or 64-bit ("long mode") setting when the guest writes the MSR to fill in the hypercall page, or when the guest sets the event channel callback in HVM_PARAM_CALLBACK_IRQ. KVM handles the former and sets the kernel's long_mode flag accordin

[PATCH v6 51/51] hw/xen: Add basic ring handling to xenstore

2023-01-10 Thread David Woodhouse
From: David Woodhouse Extract requests, return ENOSYS to all of them. This is enough to allow older Linux guests to boot, as they need *something* back but it doesn't matter much what. In the first instance we're likely to wire this up over a UNIX socket to an actual xenstored implementation, bu

[PATCH v6 14/51] i386/xen: add pc_machine_kvm_type to initialize XEN_EMULATE mode

2023-01-10 Thread David Woodhouse
From: David Woodhouse The xen_overlay device (and later similar devices for event channels and grant tables) need to be instantiated. Do this from a kvm_type method on the PC machine derivatives, since KVM is only way to support Xen emulation for now. Signed-off-by: David Woodhouse --- hw/i386

[PATCH v6 03/51] xen: Add XEN_DISABLED mode and make it default

2023-01-10 Thread David Woodhouse
From: David Woodhouse Also set XEN_ATTACH mode in xen_init() to reflect the truth; not that anyone ever cared before. It was *only* ever checked in xen_init_pv() before. Suggested-by: Paolo Bonzini Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- accel/xen/xen-all.c | 2 ++ incl

Re: [PATCH v14 02/11] s390x/cpu topology: add topology entries on CPU hotplug

2023-01-10 Thread Thomas Huth
On 05/01/2023 15.53, Pierre Morel wrote: The topology information are attributes of the CPU and are specified during the CPU device creation. On hot plug, we gather the topology information on the core, creates a list of topology entries, each entry contains a single core mask of each core with

[PATCH v6 07/51] xen-platform: exclude vfio-pci from the PCI platform unplug

2023-01-10 Thread David Woodhouse
From: Joao Martins Such that PCI passthrough devices work for Xen emulated guests. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/xen/xen_platform.c | 18 +++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/hw/i3

[PATCH v6 30/51] hw/xen: Implement EVTCHNOP_unmask

2023-01-10 Thread David Woodhouse
From: David Woodhouse This finally comes with a mechanism for actually injecting events into the guest vCPU, with all the atomic-test-and-set that's involved in setting the bit in the shinfo, then the index in the vcpu_info, and injecting either the lapic vector as MSI, or letting KVM inject the

[RFC PATCH v1 10/15] hw/xen: Build PV backend drivers for XENFV_MACHINE

2023-01-10 Thread David Woodhouse
From: David Woodhouse Now that we have the redirectable Xen backend operations we can build the PV backends even without the Xen libraries. Signed-off-by: David Woodhouse --- hw/9pfs/meson.build| 2 +- hw/block/dataplane/meson.build | 2 +- hw/block/meson.build | 2 +- hw

[PATCH v6 27/51] i386/xen: Add support for Xen event channel delivery to vCPU

2023-01-10 Thread David Woodhouse
From: David Woodhouse The kvm_xen_inject_vcpu_callback_vector() function will either deliver the per-vCPU local APIC vector (as an MSI), or just kick the vCPU out of the kernel to trigger KVM's automatic delivery of the global vector. Support for asserting the GSI/PCI_INTX callbacks will come lat

Re: [PATCH v2 0/5] tsan fixes

2023-01-10 Thread Alex Bennée
Emilio Cota writes: > Changes since v1: > > - call g_free_rcu on tb_jmp_cache directly, and call > tcg_exec_unrealizefn after calling cpu_list_remove(cpu) > > - add patch to de-const qemu_spin_destroy > > - remove wrappers for qht_do_if_first_in_stripe > > Thanks, > Emilio Queu

[RFC PATCH v1 03/15] hw/xen: Add gnttab operations to allow redirection to internal emulation

2023-01-10 Thread David Woodhouse
From: David Woodhouse In emulation, mapping more than one grant ref to be virtually contiguous would be fairly difficult. The best way to do it might be to make the ram_block mappings actually backed by a file (shmem or a deleted file, perhaps) so that we can have multiple *shared* mappings of it

[PATCH v6 08/51] xen-platform: allow its creation with XEN_EMULATE mode

2023-01-10 Thread David Woodhouse
From: Joao Martins The only thing we need to handle on KVM side is to change the pfn from R/W to R/O. Signed-off-by: Joao Martins Signed-off-by: David Woodhouse --- hw/i386/xen/meson.build| 5 - hw/i386/xen/xen_platform.c | 39 +- 2 files changed,

[PATCH v4 3/8] configure: replace Perl usage with sed

2023-01-10 Thread marcandre . lureau
From: Marc-André Lureau Let's try to reduce our Perl usage during config/build-time. Note: this patch might be dropped if "configure: remove backwards-compatibility code" is merged earlier. Signed-off-by: Marc-André Lureau Tested-by: Thomas Huth --- configure | 8 +++- 1 file changed, 3

[PATCH v6 24/51] i386/xen: implement HVMOP_set_evtchn_upcall_vector

2023-01-10 Thread David Woodhouse
From: Ankur Arora The HVMOP_set_evtchn_upcall_vector hypercall sets the per-vCPU upcall vector, to be delivered to the local APIC just like an MSI (with an EOI). This takes precedence over the system-wide delivery method set by the HVMOP_set_param hypercall with HVM_PARAM_CALLBACK_IRQ. It's used

[PATCH v6 28/51] hw/xen: Implement EVTCHNOP_status

2023-01-10 Thread David Woodhouse
From: David Woodhouse This adds the basic structure for maintaining the port table and reporting the status of ports therein. Signed-off-by: David Woodhouse --- hw/i386/kvm/xen_evtchn.c | 104 ++ hw/i386/kvm/xen_evtchn.h | 3 ++ include/sysemu/kvm_xen.h

Re: [RFC PATCH v2 13/19] tests: do not run test-hmp on all machines for ARM KVM-only

2023-01-10 Thread Fabiano Rosas
Thomas Huth writes: > On 09/01/2023 23.42, Fabiano Rosas wrote: >> From: Claudio Fontana >> >> on ARM we currently list and build all machines, even when >> building KVM-only, without TCG. >> >> Until we fix this (and we only list and build machines that are >> compatible with KVM), only test

[PATCH v4 1/8] build-sys: fix crlf-ending C code

2023-01-10 Thread marcandre . lureau
From: Marc-André Lureau On msys2, the shader-to-C script produces bad C: ./ui/shader/texture-blit-vert.h:2:5: error: missing terminating " character [-Werror] Fix it by changing the line ending from crlf to lf, and convert the script to Python (qemu build seems perl-free after that). Signed-of

[RFC PATCH v1 00/15] Xen PV backend support for KVM/Xen guests

2023-01-10 Thread David Woodhouse
This is a very early preview of phase 2, in which we make the PV backend drivers build. Mostly by providing operations tables that can be backed either by the true Xen toolstack libraries, or by the internal emulated versions. But also a bunch of untangling of headers to keep things sane. Some

[RFC PATCH v1 07/15] hw/xen: Move xenstore_store_pv_console_info to xen_console.c

2023-01-10 Thread David Woodhouse
From: David Woodhouse There's no need for this to be in the Xen accel code, and as we want to use the Xen console support with KVM-emulated Xen we'll want to have a platform-agnostic version of it. Make it use GString to build up the path while we're at it. Signed-off-by: David Woodhouse --- a

[PATCH v4 4/8] meson: replace Perl usage with Python

2023-01-10 Thread marcandre . lureau
From: Marc-André Lureau Let's try to remove Perl usage during build time. Signed-off-by: Marc-André Lureau --- tests/qapi-schema/meson.build | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/qapi-schema/meson.build b/tests/qapi-schema/meson.build index 9dfe98bc9a

Re: [RFC PATCH 0/4] qom: Introduce object_class_property_deprecate()

2023-01-10 Thread Kevin Wolf
Am 09.01.2023 um 23:54 hat Philippe Mathieu-Daudé geschrieben: > Hi, > > There will always be a need to deprecate things. Here I'm > tackling the QOM (class) properties, since they can be set > from some CLI options (-object -device -global ...). > > As an experiment, we add object_class_property

  1   2   3   4   >