Re: [PATCH v4 2/3] x86/platform: introduce XENPF_get_ucode_revision

2023-04-05 Thread Jan Beulich
On 06.04.2023 01:02, Andrew Cooper wrote: > On 05/04/2023 9:56 am, Jan Beulich wrote: >> On 04.04.2023 18:06, Sergey Dyasli wrote: >>> --- a/tools/libs/ctrl/xc_misc.c >>> +++ b/tools/libs/ctrl/xc_misc.c >>> @@ -243,6 +243,24 @@ int xc_get_cpu_version(xc_interface *xch, struct >>> xenpf_pcpu_versio

Re: [PATCH 2/9] x86emul: support WRMSRNS

2023-04-05 Thread Jan Beulich
On 05.04.2023 23:29, Andrew Cooper wrote: > On 04/04/2023 3:50 pm, Jan Beulich wrote: >> This insn differs from WRMSR solely in the lack of serialization. Hence >> the code used there can simply be used here as well, plus a feature >> check of course. > > I have a feeling this is a bit stale now t

Re: [PATCH v9 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-04-05 Thread Jan Beulich
On 05.04.2023 18:39, Julien Grall wrote: > To reduce the amount of patch to resend, I was actually thinking to > merge patch #1-3 and #5 (so leave this patch alone) and modify the > default in a follow-up. Any thoughts? Well, yes, that's what I did a couple of days ago already. Jan

Re: [PATCH v3 2/4] tools/xendevicemodel: Introduce ..._get_ioreq_server_info_ext

2023-04-05 Thread Juergen Gross
On 06.04.23 05:57, Marek Marczykowski-Górecki wrote: Add xendevicemodel_get_ioreq_server_info_ext() which additionally returns output flags that XEN_DMOP_get_ioreq_server_info can now return. Do not change signature of existing xendevicemodel_get_ioreq_server_info() so existing users will not nee

Re: [PATCH v4 10/12] xen/tools: add sve parameter in XL configuration

2023-04-05 Thread Luca Fancellu
Hi Anthony, >> >> Yes I can change it, a need to do it anyway because I think also here, the >> suggestion >> From Jan can apply and we could pass a negative value that means “max VL >> supported >> by the platform" > > Well, it's a config file, not a C ABI, so max allowed here doesn't have to

[PATCH v3 0/4] MSI-X support with qemu in stubdomain, and other related changes

2023-04-05 Thread Marek Marczykowski-Górecki
This series includes changes to make MSI-X working with Linux stubdomain and especially Intel Wifi 6 AX210 card. This takes care of remaining reasons for QEMU to access /dev/mem, but also the Intel Wifi card violating spec by putting some registers on the same page as the MSI-X table. See individu

[PATCH v3 2/4] tools/xendevicemodel: Introduce ..._get_ioreq_server_info_ext

2023-04-05 Thread Marek Marczykowski-Górecki
Add xendevicemodel_get_ioreq_server_info_ext() which additionally returns output flags that XEN_DMOP_get_ioreq_server_info can now return. Do not change signature of existing xendevicemodel_get_ioreq_server_info() so existing users will not need to be changed. This advertises behavior change of "x

[PATCH v3 3/4] x86/hvm: Allow writes to registers on the same page as MSI-X table

2023-04-05 Thread Marek Marczykowski-Górecki
Some devices (notably Intel Wifi 6 AX210 card) keep auxiliary registers on the same page as MSI-X table. Device model (especially one in stubdomain) cannot really handle those, as direct writes to that page is refused (page is on the mmio_ro_ranges list). Instead, extend msixtbl_mmio_ops to handle

[PATCH v3 4/4] x86/msi: clear initial MSI-X state on boot

2023-04-05 Thread Marek Marczykowski-Górecki
Some firmware/devices are found to not reset MSI-X properly, leaving MASKALL set. Jason reports on his machine MASKALL persists through a warm reboot, but is cleared on cold boot. Xen relies on initial state being MASKALL clear. Especially, pci_reset_msix_state() assumes if MASKALL is set, it was X

[PATCH v3 1/4] x86/msi: passthrough all MSI-X vector ctrl writes to device model

2023-04-05 Thread Marek Marczykowski-Górecki
QEMU needs to know whether clearing maskbit of a vector is really clearing, or was already cleared before. Currently Xen sends only clearing that bit to the device model, but not setting it, so QEMU cannot detect it. Because of that, QEMU is working this around by checking via /dev/mem, but that is

[ovmf test] 180164: all pass - PUSHED

2023-04-05 Thread osstest service owner
flight 180164 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/180164/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 8d185dfb66700e65035d51f149570aeab728c665 baseline version: ovmf 2bb693894920e63415327

Re: [PATCH v4 3/3] tools/xen-ucode: print information about currently loaded ucode

2023-04-05 Thread Andrew Cooper
On 05/04/2023 10:11 am, Jan Beulich wrote: > On 04.04.2023 18:06, Sergey Dyasli wrote: >> Add an option to xen-ucode tool to print the currently loaded ucode >> revision and also print it during usage info. Print CPU signature and >> platform flags as well. The raw data comes from XENPF_get_cpu_v

[xen-unstable test] 180148: tolerable trouble: fail/pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180148 xen-unstable real [real] flight 180162 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/180148/ http://logs.test-lab.xenproject.org/osstest/logs/180162/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd6

Re: [PATCH v4 2/3] x86/platform: introduce XENPF_get_ucode_revision

2023-04-05 Thread Andrew Cooper
On 05/04/2023 9:56 am, Jan Beulich wrote: > On 04.04.2023 18:06, Sergey Dyasli wrote: >> --- a/tools/libs/ctrl/xc_misc.c >> +++ b/tools/libs/ctrl/xc_misc.c >> @@ -243,6 +243,24 @@ int xc_get_cpu_version(xc_interface *xch, struct >> xenpf_pcpu_version *cpu_ver) >> return 0; >> } >> >> +int

[ovmf test] 180161: all pass - PUSHED

2023-04-05 Thread osstest service owner
flight 180161 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/180161/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 2bb693894920e634153275bea60278a9f192a8ef baseline version: ovmf a56ee36c494cb1dfe7952

[PATCH] x86/vmx: Revert "x86/VMX: sanitize rIP before re-entering guest"

2023-04-05 Thread Andrew Cooper
At the time of XSA-170, the x86 instruction emulator was genuinely broken. It would load arbitrary values into %rip and putting a check here probably was the best stopgap security fix. It should have been reverted following c/s 81d3a0b26c1 "x86emul: limit-check branch targets" which corrected the

[xen-unstable-smoke test] 180160: tolerable trouble: pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180160 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/180160/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

Re: [PATCH 2/9] x86emul: support WRMSRNS

2023-04-05 Thread Andrew Cooper
On 04/04/2023 3:50 pm, Jan Beulich wrote: > This insn differs from WRMSR solely in the lack of serialization. Hence > the code used there can simply be used here as well, plus a feature > check of course. I have a feeling this is a bit stale now that 0f01.c has moved into a separate file ? > As

Re: [PATCH v4 1/3] tools/xenctrl: add xc_get_cpu_version()

2023-04-05 Thread Andrew Cooper
On 04/04/2023 5:06 pm, Sergey Dyasli wrote: > As a wrapper for XENPF_get_cpu_version platform op. > > Signed-off-by: Sergey Dyasli Reviewed-by: Andrew Cooper

[PATCH] x86/svm: Provide EXITINFO decodes for MOV CR/DR intercepts

2023-04-05 Thread Andrew Cooper
This removes raw number manipulation, and makes the logic easier to follow. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- xen/arch/x86/hvm/svm/svm.c | 4 ++-- xen/arch/x86/include/asm/hvm/svm/vmcb.h | 5 + 2 files

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-05 Thread Bjorn Helgaas
On Wed, Apr 05, 2023 at 11:28:27AM +0300, Andy Shevchenko wrote: > On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > > Provide two new helper macros to iterate over PCI device resources and > > > convert users. >

Re: [PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-04-05 Thread Bjorn Helgaas
On Wed, Apr 05, 2023 at 02:50:47PM +0300, Andy Shevchenko wrote: > On Thu, Mar 30, 2023 at 07:24:32PM +0300, Andy Shevchenko wrote: > > Refactor pci_bus_for_each_resource() in the same way as it's done in > > pci_dev_for_each_resource() case. This will allow to hide iterator > > inside the loop, wh

Re: [PATCH 3/3] x86/treewide: Drop the TRAP_* legacy names

2023-04-05 Thread Andrew Cooper
On 21/02/2023 1:10 pm, Jan Beulich wrote: > On 20.02.2023 12:59, Andrew Cooper wrote: >> We have two naming schemes for exceptions - X86_EXC_?? which use the >> archtiectural abbreviations, and TRAP_* which is a mix of terminology and >> nonstandard abbrevations. Switch to X86_EXC_* uniformly. >>

[xen-unstable-smoke test] 180157: tolerable trouble: pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180157 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/180157/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

[ovmf test] 180156: all pass - PUSHED

2023-04-05 Thread osstest service owner
flight 180156 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/180156/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf a56ee36c494cb1dfe795259b2cba706ef55b5212 baseline version: ovmf cdd79996c217805a5bd67

[libvirt test] 180147: tolerable trouble: fail/pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180147 libvirt real [real] flight 180158 libvirt real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/180147/ http://logs.test-lab.xenproject.org/osstest/logs/180158/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-amd64-li

Re: [PATCH v9 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-04-05 Thread Julien Grall
Hi, On 04/04/2023 09:09, Oleksii wrote: On Tue, 2023-04-04 at 08:41 +0200, Jan Beulich wrote: On 03.04.2023 20:40, Oleksii wrote: Hello Julien, On Fri, 2023-03-31 at 22:05 +0100, Julien Grall wrote: Hi Oleksii, I was going to ack the patch but then I spotted something that would want some cl

Re: [PATCH v9 4/5] xen/arm: switch ARM to use generic implementation of bug.h

2023-04-05 Thread Julien Grall
Hi, On 03/04/2023 00:15, Stefano Stabellini wrote: On Fri, 31 Mar 2023, Julien Grall wrote: Hi Oleksii, I was going to ack the patch but then I spotted something that would want some clarification. On 29/03/2023 11:50, Oleksii Kurochko wrote: diff --git a/xen/arch/arm/include/asm/bug.h b/xen

Re: [PATCH] x86emul/test: drop bogus .PHONY

2023-04-05 Thread Jan Beulich
On 05.04.2023 17:48, Anthony PERARD wrote: > On Tue, Apr 04, 2023 at 08:37:55AM +0200, Jan Beulich wrote: >> x86_emulate is a real (directory) target. > > Indeed, x86_emulate is a directory, so having the target in .PHONY > isn't bogus, but kind of expected in most cases. > > Here, the recipe is

Re: [PATCH] x86emul/test: drop bogus .PHONY

2023-04-05 Thread Anthony PERARD
On Tue, Apr 04, 2023 at 08:37:55AM +0200, Jan Beulich wrote: > x86_emulate is a real (directory) target. Indeed, x86_emulate is a directory, so having the target in .PHONY isn't bogus, but kind of expected in most cases. Here, the recipe is written with .PHONY been used, as suggest the used optio

Re: [PATCH 09/14] accel: Allocate NVMM vCPU using g_try_FOO()

2023-04-05 Thread Philippe Mathieu-Daudé
On 5/4/23 15:55, Alex Bennée wrote: Philippe Mathieu-Daudé writes: g_malloc0() can not fail. Use g_try_malloc0() instead. https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/

Re: [PATCH v4 10/12] xen/tools: add sve parameter in XL configuration

2023-04-05 Thread Anthony PERARD
On Tue, Apr 04, 2023 at 01:48:34PM +, Luca Fancellu wrote: > > On 31 Mar 2023, at 15:23, Anthony PERARD wrote: > > > > On Mon, Mar 27, 2023 at 11:59:42AM +0100, Luca Fancellu wrote: > >> diff --git a/docs/man/xl.cfg.5.pod.in b/docs/man/xl.cfg.5.pod.in > >> index 10f37990be57..adf48fe8ac1d 100

[xen-unstable-smoke test] 180155: tolerable trouble: pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180155 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/180155/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-libvirt 15 migrate-support-checkfail never pass test-arm64-arm64-xl-xsm 1

[linux-linus test] 180145: tolerable trouble: fail/pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180145 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/180145/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-amd64-amd64-xl-qemut-win7-amd64 19 guest-stopfail like 180135 test-amd64-amd64-xl-qemuu-win7-amd64

Re: [PATCH 09/14] accel: Allocate NVMM vCPU using g_try_FOO()

2023-04-05 Thread Alex Bennée
Philippe Mathieu-Daudé writes: > g_malloc0() can not fail. Use g_try_malloc0() instead. > > https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description > > Signed-off-by: Philippe Mathieu-Daudé > --- > target/i386/nvmm/nvmm-all.c | 2 +- > 1 file

[PATCH v3 1/2] xen: move CONFIG_DEBUG_INFO out of EXPERT section

2023-04-05 Thread Juergen Gross
In order to support hypervisor analysis of crash dumps, xen-syms needs to contain debug_info. It should be allowed to configure the hypervisor to be built with CONFIG_DEBUG_INFO in non-debug builds without having to enable EXPERT. Using a rather oldish gcc (7.5) it was verified that code generatio

[PATCH v3 2/2] xen: update CONFIG_DEBUG_INFO help text

2023-04-05 Thread Juergen Gross
Update the help text of the CONFIG_DEBUG_INFO option to be a little bit more specific. Signed-off-by: Juergen Gross --- V2: - expand help text, especially mentioning INSTALL_EFI_STRIP (Jan Beulich) V3: - expand help text even more (Jan Beulich) --- xen/Kconfig.debug | 12 ++-- 1 file c

[PATCH v3 0/2] xen: some CONFIG_DEBUG_INFO changes

2023-04-05 Thread Juergen Gross
Enabling crash dump analysis of the hypervisor requires the hypervisor having been built with CONFIG_DEBUG_INFO enabled. Today this requires either CONFIG_DEBUG or CONFIG_EXPERT set, which are both not security supported. This small series changes that in order to allow security supported Xen buil

Re: [PATCH v2 1/2] xen: move CONFIG_DEBUG_INFO out of EXPERT section

2023-04-05 Thread Juergen Gross
On 05.04.23 15:14, Jan Beulich wrote: On 03.04.2023 18:28, Juergen Gross wrote: In order to support hypervisor analysis of crash dumps, xen-syms needs to contain debug_info. It should be allowed to configure the hypervisor to be built with CONFIG_DEBUG_INFO in non-debug builds without having to

Re: [PATCH v2 1/2] xen: move CONFIG_DEBUG_INFO out of EXPERT section

2023-04-05 Thread Jan Beulich
On 03.04.2023 18:28, Juergen Gross wrote: > In order to support hypervisor analysis of crash dumps, xen-syms needs > to contain debug_info. It should be allowed to configure the hypervisor > to be built with CONFIG_DEBUG_INFO in non-debug builds without having > to enable EXPERT. > > Using a rathe

Re: [PATCH v2 2/2] xen: update CONFIG_DEBUG_INFO help text

2023-04-05 Thread Jan Beulich
On 05.04.2023 13:24, Juergen Gross wrote: > On 04.04.23 11:09, Jan Beulich wrote: >> On 03.04.2023 18:28, Juergen Gross wrote: >>> --- a/xen/Kconfig.debug >>> +++ b/xen/Kconfig.debug >>> @@ -15,8 +15,14 @@ config DEBUG_INFO >>> bool "Compile Xen with debug info" >>> default DEBUG >>> he

[PATCH v3] x86emul: build with -Os

2023-04-05 Thread Jan Beulich
Emulator code is large and involving it in guest operations cannot be expected to be fast anyway. Help binary size as well as, for release builds at least, compile time by building all involved code with size optimization, independent of the build being a debug or a release one. The size savings o

Re: [PATCH] tools/libs/guest: Fix build following libx86 changes

2023-04-05 Thread Roger Pau Monné
On Wed, Apr 05, 2023 at 01:37:55PM +0100, Andrew Cooper wrote: > I appear to have lost this hunk somewhere... > > Fixes: 1b67fccf3b02 ("libx86: Update library API for cpu_policy") > Signed-off-by: Andrew Cooper Acked-by: Roger Pau Monné Thanks.

[xen-unstable-smoke test] 180152: regressions - trouble: blocked/fail/pass/starved

2023-04-05 Thread osstest service owner
flight 180152 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/180152/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-amd64 6 xen-buildfail REGR. vs. 180143 Tests which

[PATCH] tools/libs/guest: Fix build following libx86 changes

2023-04-05 Thread Andrew Cooper
I appear to have lost this hunk somewhere... Fixes: 1b67fccf3b02 ("libx86: Update library API for cpu_policy") Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu CC: Anthony PERARD --- tools/libs/guest/xg_cpuid_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 del

[ovmf test] 180150: all pass - PUSHED

2023-04-05 Thread osstest service owner
flight 180150 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/180150/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf cdd79996c217805a5bd67bb0c0e4ca05474ef92e baseline version: ovmf 7df447930c42addaf2cc0

[qemu-mainline test] 180146: tolerable trouble: fail/pass/starved - PUSHED

2023-04-05 Thread osstest service owner
flight 180146 qemu-mainline real [real] flight 180151 qemu-mainline real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/180146/ http://logs.test-lab.xenproject.org/osstest/logs/180151/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-am

Re: [PATCH v8 5/7] PCI: Allow pci_bus_for_each_resource() to take less arguments

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:32PM +0300, Andy Shevchenko wrote: > Refactor pci_bus_for_each_resource() in the same way as it's done in > pci_dev_for_each_resource() case. This will allow to hide iterator > inside the loop, where it's not used otherwise. > > No functional changes intended. Bjorn,

Re: [PATCH v2 2/2] xen: update CONFIG_DEBUG_INFO help text

2023-04-05 Thread Juergen Gross
On 04.04.23 11:09, Jan Beulich wrote: On 03.04.2023 18:28, Juergen Gross wrote: --- a/xen/Kconfig.debug +++ b/xen/Kconfig.debug @@ -15,8 +15,14 @@ config DEBUG_INFO bool "Compile Xen with debug info" default DEBUG help - If you say Y here the resulting Xen will in

[PATCH 1/3] xen/arm: vpl011: Fix misleading comments

2023-04-05 Thread Michal Orzel
In both vpl011_read_data() and vpl011_read_data_xen(), there is a comment stating that the guest is expected to read the DR register only if the TXFE bit of FR register is not set. This is obviously logically wrong and it should be RXFE (i.e. RX FIFO empty bit set -> nothing to read). Signed-off-b

[PATCH 2/3] xen/arm: vpl011: Handle correctly TXFE when backend in Xen

2023-04-05 Thread Michal Orzel
When backend is in Xen, the handling of data written to DR register is a bit special because we want to tell guest that we are always ready for new data to be written (i.e. no real FIFO, TXFF/BUSY never set and TXI always set). This conflicts with the current handling of TXFE bit, which we always c

[PATCH 3/3] xen/arm: vpl011: Do not try to handle TX FIFO status when backend in Xen

2023-04-05 Thread Michal Orzel
>From vpl011_rx_char_xen(), we call vpl011_data_avail() that handles both RX and TX state. Because we are passing 0 as out_fifo_level and SBSA_UART_FIFO_SIZE as out_size, we end up calling a function vpl011_update_tx_fifo_status() which performs TXI bit handling depending on the FIFO trigger level.

[PATCH 0/3] xen/arm: vpl011 fixes continuation

2023-04-05 Thread Michal Orzel
Another portion of vpl011 fixes/hardening. Michal Orzel (3): xen/arm: vpl011: Fix misleading comments xen/arm: vpl011: Handle correctly TXFE when backend in Xen xen/arm: vpl011: Do not try to handle TX FIFO status when backend in Xen xen/arch/arm/vpl011.c | 27 +

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Michael S. Tsirkin
On Wed, Apr 05, 2023 at 11:24:43AM +0100, Alex Bennée wrote: > > "Michael S. Tsirkin" writes: > > > On Wed, Apr 05, 2023 at 11:00:34AM +0100, Alex Bennée wrote: > >> > >> Viresh Kumar writes: > >> > >> > On 09-03-23, 14:20, Viresh Kumar wrote: > >> >> Hello, > >> >> > >> >> This patchset tri

Re: [PATCH v2 3/3] multiboot2: do not set StdOut mode unconditionally

2023-04-05 Thread Jan Beulich
On 31.03.2023 11:59, Roger Pau Monne wrote: > @@ -887,6 +881,15 @@ void __init efi_multiboot2(EFI_HANDLE ImageHandle, > EFI_SYSTEM_TABLE *SystemTable > > efi_arch_edid(gop_handle); > } > +else > +{ > +/* If no GOP, init ConOut (StdOut) to the max supported size. */

[PATCH 08/14] accel: Move HAX hThread to accelerator context

2023-04-05 Thread Philippe Mathieu-Daudé
hThread variable is only used by the HAX accelerator, so move it to the accelerator specific context. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 1 - target/i386/hax/hax-i386.h | 3 +++ target/i386/hax/hax-accel-ops.c | 2 +- target/i386/hax/hax-all.c

[PATCH 13/14] accel: Inline WHPX get_whpx_vcpu()

2023-04-05 Thread Philippe Mathieu-Daudé
No need for this helper to access the CPUState::accel field. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/whpx/whpx-all.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/target/i386/whpx/whpx-all.c b/target/i386/whpx/whpx-all.c index 2

[PATCH 09/14] accel: Allocate NVMM vCPU using g_try_FOO()

2023-04-05 Thread Philippe Mathieu-Daudé
g_malloc0() can not fail. Use g_try_malloc0() instead. https://developer-old.gnome.org/glib/stable/glib-Memory-Allocation.html#glib-Memory-Allocation.description Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/nvmm-all.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --g

[PATCH 12/14] accel: Rename WHPX struct whpx_vcpu -> struct AccelvCPUState

2023-04-05 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename WHPX 'whpx_vcpu' as 'AccelvCPUState'. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/whpx/whpx-all.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/target/i3

[PATCH 14/14] accel: Rename HVF struct hvf_vcpu_state -> struct AccelvCPUState

2023-04-05 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename the 'hvf_vcpu_state' structure as 'AccelvCPUState'. Use the generic 'accel' field of CPUState instead of 'hvf'. Replace g_malloc0() by g_new0() for readability. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/c

[PATCH 10/14] accel: Rename NVMM struct qemu_vcpu -> struct AccelvCPUState

2023-04-05 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Rename NVMM 'qemu_vcpu' as 'AccelvCPUState'. Replace g_try_malloc0() by g_try_new0() for readability. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/nvmm-all.c | 34 +- 1 file chan

[PATCH 11/14] accel: Inline NVMM get_qemu_vcpu()

2023-04-05 Thread Philippe Mathieu-Daudé
No need for this helper to access the CPUState::accel field. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/nvmm/nvmm-all.c | 28 +++- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index 97

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Alex Bennée
"Michael S. Tsirkin" writes: > On Wed, Apr 05, 2023 at 11:00:34AM +0100, Alex Bennée wrote: >> >> Viresh Kumar writes: >> >> > On 09-03-23, 14:20, Viresh Kumar wrote: >> >> Hello, >> >> >> >> This patchset tries to update the vhost-user protocol to make it support >> >> special >> >> memor

[PATCH 07/14] accel: Rename struct hax_vcpu_state -> struct AccelvCPUState

2023-04-05 Thread Philippe Mathieu-Daudé
We want all accelerators to share the same opaque pointer in CPUState. Start with the HAX context, renaming its forward declarated structure 'hax_vcpu_state' as 'AccelvCPUState'. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 7 +++ target/i386/hax/hax-i386.h | 3 ++

[PATCH 06/14] accel: Use a typedef for struct hax_vcpu_state

2023-04-05 Thread Philippe Mathieu-Daudé
Use a type definition instead of explicit structure. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-i386.h| 10 +- target/i386/hax/hax-all.c | 16 target/i386/hax/hax-posix.c | 4 ++-- target/i386/hax/hax-windows.c | 4 ++-- 4 files changed, 17

[PATCH 05/14] accel: Rename 'hax_vcpu' as 'accel' in CPUState

2023-04-05 Thread Philippe Mathieu-Daudé
All accelerators will share a single opaque context in CPUState. Start by renaming 'hax_vcpu' as 'accelCPUState'. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/core/cpu.h | 2 +- target/i386/hax/hax-accel-ops.c | 2 +- target/i386/hax/hax-all.c | 18 +- t

[PATCH 04/14] accel: Destroy HAX vCPU threads once done

2023-04-05 Thread Philippe Mathieu-Daudé
When the vCPU thread finished its processing, destroy it and signal its destruction to generic vCPU management layer. Add a sanity check for the vCPU accelerator context. Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-accel-ops.c | 3 +++ target/i386/hax/hax-all.c | 1 + 2

[PATCH 03/14] accel: Fix a leak on Windows HAX

2023-04-05 Thread Philippe Mathieu-Daudé
hThread is only used on the error path in hax_kick_vcpu_thread(). Fixes: b0cb0a66d6 ("Plumb the HAXM-based hardware acceleration support") Signed-off-by: Philippe Mathieu-Daudé --- target/i386/hax/hax-all.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/target/i386/hax/hax-all.c b/target

[PATCH 02/14] accel: Remove unused hThread variable on TCG/WHPX

2023-04-05 Thread Philippe Mathieu-Daudé
On Windows hosts, cpu->hThread is assigned but never accessed: remove it. Signed-off-by: Philippe Mathieu-Daudé --- accel/tcg/tcg-accel-ops-mttcg.c | 4 accel/tcg/tcg-accel-ops-rr.c | 3 --- target/i386/whpx/whpx-accel-ops.c | 3 --- 3 files changed, 10 deletions(-) diff --git a/acc

[PATCH 00/14] accel: Share CPUState accel context (HAX/NVMM/WHPX/HVF)

2023-04-05 Thread Philippe Mathieu-Daudé
This series is part of the single binary effort. All accelerator will share their per-vCPU context in an opaque 'accel' pointer within the CPUState. First handle HAX/NVMM/WHPX/HVF. KVM and TCG will follow as two different (bigger) follow-up series. Philippe Mathieu-Daudé (14): accel: Document

[PATCH 01/14] accel: Document generic accelerator headers

2023-04-05 Thread Philippe Mathieu-Daudé
These headers are meant to be include by any file to check the availability of accelerators, thus are not accelerator specific. Signed-off-by: Philippe Mathieu-Daudé --- include/sysemu/hax.h | 2 ++ include/sysemu/kvm.h | 2 ++ include/sysemu/nvmm.h | 2 ++ include/sysemu/tcg.h | 2 ++ includ

Re: [PATCH v2 2/3] multiboot2: parse console= and vga= options when setting GOP mode

2023-04-05 Thread Jan Beulich
On 31.03.2023 11:59, Roger Pau Monne wrote: > Only set the GOP mode if vga is selected in the console option, This particular aspect of the behavior is inconsistent with legacy boot behavior: There "vga=" isn't qualified by what "console=" has. > otherwise just fetch the information from the curr

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Michael S. Tsirkin
On Wed, Apr 05, 2023 at 11:00:34AM +0100, Alex Bennée wrote: > > Viresh Kumar writes: > > > On 09-03-23, 14:20, Viresh Kumar wrote: > >> Hello, > >> > >> This patchset tries to update the vhost-user protocol to make it support > >> special > >> memory mapping required in case of Xen hypervisor

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Alex Bennée
Viresh Kumar writes: > On 09-03-23, 14:20, Viresh Kumar wrote: >> Hello, >> >> This patchset tries to update the vhost-user protocol to make it support >> special >> memory mapping required in case of Xen hypervisor. >> >> The first patch is mostly cleanup and second one introduces a new xen

Re: [PATCH] x86/PV32: restore PAE-extended-CR3 logic

2023-04-05 Thread Roger Pau Monné
On Wed, Apr 05, 2023 at 11:29:51AM +0200, Jan Beulich wrote: > On 05.04.2023 10:59, Roger Pau Monné wrote: > > We should likely move the setting of vm_assist to the domain create > > hypercall, instead of doing it at vCPU initialization. > > Perhaps, the more that setting the assist is limited to

Re: [PATCH] x86/PV32: restore PAE-extended-CR3 logic

2023-04-05 Thread Jan Beulich
On 05.04.2023 10:59, Roger Pau Monné wrote: > We should likely move the setting of vm_assist to the domain create > hypercall, instead of doing it at vCPU initialization. Perhaps, the more that setting the assist is limited to vCPU 0 init. Which in a way makes sense when considering domain creatio

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Viresh Kumar
On 05-04-23, 11:15, Jan Beulich wrote: > On 05.04.2023 10:51, Viresh Kumar wrote: > > --- a/docs/man/xl.cfg.5.pod.in > > +++ b/docs/man/xl.cfg.5.pod.in > > @@ -1608,8 +1608,10 @@ example, "type=virtio,device22" for the I2C device, > > whose device-tree binding is > > > > > > L

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Jan Beulich
On 05.04.2023 10:51, Viresh Kumar wrote: > --- a/docs/man/xl.cfg.5.pod.in > +++ b/docs/man/xl.cfg.5.pod.in > @@ -1608,8 +1608,10 @@ example, "type=virtio,device22" for the I2C device, > whose device-tree binding is > > > L

Re: [PATCH v4 3/3] tools/xen-ucode: print information about currently loaded ucode

2023-04-05 Thread Jan Beulich
On 04.04.2023 18:06, Sergey Dyasli wrote: > Add an option to xen-ucode tool to print the currently loaded ucode > revision and also print it during usage info. Print CPU signature and > platform flags as well. The raw data comes from XENPF_get_cpu_version > and XENPF_get_ucode_revision platform o

Re: [PATCH V2 2/2] libxl: fix matching of generic virtio device

2023-04-05 Thread Oleksandr Tyshchenko
On 05.04.23 03:12, Viresh Kumar wrote: Hello Viresh The strings won't be an exact match, as we are only looking to match the prefix here, i.e. "virtio,device". This is already done properly in libxl_virtio.c file, lets do the same here too. Fixes: 43ba5202e2ee ("libxl: add support for gene

Re: [PATCH] x86/PV32: restore PAE-extended-CR3 logic

2023-04-05 Thread Roger Pau Monné
On Wed, Apr 05, 2023 at 10:11:30AM +0200, Jan Beulich wrote: > On 04.04.2023 18:38, Roger Pau Monné wrote: > > On Tue, Apr 04, 2023 at 05:57:11PM +0200, Roger Pau Monné wrote: > >> On Tue, Apr 04, 2023 at 04:24:16PM +0200, Jan Beulich wrote: > >>> On 04.04.2023 13:41, Roger Pau Monné wrote: >

Re: [PATCH v4 2/3] x86/platform: introduce XENPF_get_ucode_revision

2023-04-05 Thread Jan Beulich
On 04.04.2023 18:06, Sergey Dyasli wrote: > Currently it's impossible to get CPU's microcode revision from Xen after > late loading without looking into Xen logs which is not always convenient. > > Add a new platform op in order to get the required data from Xen and > provide a wrapper for libxenc

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Viresh Kumar
On 05-04-23, 11:36, Oleksandr Tyshchenko wrote: > Also a NIT, is this example "like "virtio,device26" for file system device" > precise? No :( I will send the patch again later, this is how it looks now. I have also updated the documentation to contain the hexadecimal format for N. Author: Vires

Re: [PATCH] x86/PV32: restore PAE-extended-CR3 logic

2023-04-05 Thread Jan Beulich
On 04.04.2023 22:40, Andrew Cooper wrote: > On 04/04/2023 3:21 pm, Jan Beulich wrote: >> On 04.04.2023 15:08, Andrew Cooper wrote: >>> On 15/02/2023 2:54 pm, Jan Beulich wrote: While the PAE-extended-CR3 VM assist is a 32-bit only concept, it still applies to guests also when run on a 64-

Re: [PATCH V2 1/2] docs: Allow generic virtio device types to contain device-id

2023-04-05 Thread Oleksandr Tyshchenko
On 05.04.23 03:12, Viresh Kumar wrote: Hello Viresh For generic virtio devices, where we don't need to add compatible or other special DT properties, the type field is set to "virtio,device". But this misses the case where the user sets the type with a valid virtio device id as well, like

Re: [PATCH v8 7/7] pcmcia: Convert to use less arguments in pci_bus_for_each_resource()

2023-04-05 Thread Andy Shevchenko
On Thu, Mar 30, 2023 at 07:24:34PM +0300, Andy Shevchenko wrote: ... > @@ -960,12 +960,9 @@ static int nonstatic_autoadd_resources(struct > pcmcia_socket *s) >*/ > if (s->cb_dev->bus->number == 0) > return -EINVAL; > - > - for (i = 0; i < PCI_BRIDGE_RESOURCE_NUM;

Re: [PATCH v8 0/7] Add pci_dev_for_each_resource() helper and update users

2023-04-05 Thread Andy Shevchenko
On Tue, Apr 04, 2023 at 11:11:01AM -0500, Bjorn Helgaas wrote: > On Thu, Mar 30, 2023 at 07:24:27PM +0300, Andy Shevchenko wrote: > > Provide two new helper macros to iterate over PCI device resources and > > convert users. > > > > Looking at it, refactor existing pci_bus_for_each_resource() and c

Re: [PATCH v3] libx86: Update library API for cpu_policy

2023-04-05 Thread Jan Beulich
On 04.04.2023 23:06, Andrew Cooper wrote: > Adjust the API and comments appropriately. > > x86_cpu_policy_fill_native() will eventually contain MSR reads, but leave a > TODO in the short term. > > No practical change. > > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich

Re: [PATCH] x86/PV32: restore PAE-extended-CR3 logic

2023-04-05 Thread Jan Beulich
On 04.04.2023 18:38, Roger Pau Monné wrote: > On Tue, Apr 04, 2023 at 05:57:11PM +0200, Roger Pau Monné wrote: >> On Tue, Apr 04, 2023 at 04:24:16PM +0200, Jan Beulich wrote: >>> On 04.04.2023 13:41, Roger Pau Monné wrote: On Tue, Apr 04, 2023 at 12:31:31PM +0200, Jan Beulich wrote: > On 0

Re: [PATCH V3 0/2] qemu: vhost-user: Support Xen memory mapping quirks

2023-04-05 Thread Viresh Kumar
On 09-03-23, 14:20, Viresh Kumar wrote: > Hello, > > This patchset tries to update the vhost-user protocol to make it support > special > memory mapping required in case of Xen hypervisor. > > The first patch is mostly cleanup and second one introduces a new xen specific > feature. Can we apply

Re: [PATCH 1/9] x86emul: support LKGS

2023-04-05 Thread Jan Beulich
On 04.04.2023 23:54, Andrew Cooper wrote: > On 04/04/2023 3:49 pm, Jan Beulich wrote: >> Provide support for this insn, which is a prereq to FRED. CPUID-wise >> introduce both its and FRED's bit at this occasion, thus allowing to >> also express the dependency right away. >> >> While adding a testc

[PATCH v4 13/13] tools/xenstore: switch quota management to be table based

2023-04-05 Thread Juergen Gross
Instead of having individual quota variables switch to a table based approach like the generic accounting. Include all the related data in the same table and add accessor functions. This enables to use the command line --quota parameter for setting all possible quota values, keeping the previous p

[PATCH v4 09/13] tools/xenstore: add TDB access trace support

2023-04-05 Thread Juergen Gross
Add a new trace switch "tdb" and the related trace calls. The "tdb" switch is off per default. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c| 8 +++- tools/xenstore/xenstored_core.h| 7 +++ tools/xenstore/xenstored_transactio

[PATCH v4 10/13] tools/xenstore: switch transaction accounting to generic accounting

2023-04-05 Thread Juergen Gross
As transaction accounting is active for unprivileged domains only, it can easily be added to the generic per-domain accounting. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c| 3 +-- tools/xenstore/xenstored_core.h| 1 - tools/xenstore/xenstored_domain.c

[PATCH v4 11/13] tools/xenstore: remember global and per domain max accounting values

2023-04-05 Thread Juergen Gross
Add saving the maximum values of the different accounting data seen per domain and (for unprivileged domains) globally, and print those values via the xenstore-control quota command. Add a sub-command for resetting the global maximum values seen. This should help for a decision how to set the rela

[PATCH v4 12/13] tools/xenstore: use generic accounting for remaining quotas

2023-04-05 Thread Juergen Gross
The maxrequests, node size, number of node permissions, and path length quota are a little bit special, as they are either active in transactions only (maxrequests), or they are just per item instead of count values. Nevertheless being able to know the maximum number of those quota related values p

[PATCH v4 07/13] tools/xenstore: use accounting data array for per-domain values

2023-04-05 Thread Juergen Gross
Add the accounting of per-domain usage of Xenstore memory, watches, and outstanding requests to the array based mechanism. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 8 +-- tools/xenstore/xenstored_domain.c | 111 +++--- tools/xenstore/xenstore

[PATCH v4 08/13] tools/xenstore: add accounting trace support

2023-04-05 Thread Juergen Gross
Add a new trace switch "acc" and the related trace calls. The "acc" switch is off per default. Signed-off-by: Juergen Gross Reviewed-by: Julien Grall --- tools/xenstore/xenstored_core.c | 2 +- tools/xenstore/xenstored_core.h | 1 + tools/xenstore/xenstored_domain.c | 10 ++ 3 fi

[PATCH v4 06/13] tools/xenstore: add current connection to domain_memory_add() parameters

2023-04-05 Thread Juergen Gross
In order to enable switching memory accounting to the generic array based accounting, add the current connection to the parameters of domain_memory_add(). This requires to add the connection to some other functions, too. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 28 ++

[PATCH v4 05/13] tools/xenstore: use accounting buffering for node accounting

2023-04-05 Thread Juergen Gross
Add the node accounting to the accounting information buffering in order to avoid having to undo it in case of failure. Signed-off-by: Juergen Gross --- tools/xenstore/xenstored_core.c | 21 ++--- tools/xenstore/xenstored_domain.h | 4 ++-- 2 files changed, 4 insertions(+), 21

  1   2   >