Re: struct mctelem_cookie missing definition

2025-02-18 Thread Jan Beulich
On 18.02.2025 22:37, Stefano Stabellini wrote: > On Tue, 18 Feb 2025, Jan Beulich wrote: >> On 18.02.2025 03:45, Stefano Stabellini wrote: >>> On Mon, 17 Feb 2025, Jan Beulich wrote: On 15.02.2025 09:59, Nicola Vetrini wrote: > On 2025-02-15 00:04, Stefano Stabellini wrote: >> On Fri,

RE: [PATCH v2 04/11] xen/amd: export processor max frequency value

2025-02-18 Thread Penny, Zheng
[AMD Official Use Only - AMD Internal Distribution Only] Hi, > -Original Message- > From: Jan Beulich > Sent: Tuesday, February 18, 2025 10:59 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andryuk, Jason > ; Andrew Cooper ; > Roger Pau Monné ; xen-devel@lists.xenproject.org > Subject: Re: [P

[PATCH v3 1/5] automation: skip building domU if there is no test defined for it

2025-02-18 Thread Marek Marczykowski-Górecki
This will be useful for later tests not using generic domU (unit tests, xtf etc). Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- automation/scripts/qubes-x86-64.sh | 50 +++ 1 file changed, 31 insertions(+), 19 deletions(-) diff --git

RE: [PATCH v2 03/11] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline

2025-02-18 Thread Penny, Zheng
[AMD Official Use Only - AMD Internal Distribution Only] Hi, > -Original Message- > From: Jan Beulich > Sent: Tuesday, February 18, 2025 10:56 PM > To: Penny, Zheng > Cc: Huang, Ray ; Andryuk, Jason > ; Andrew Cooper ; > Anthony PERARD ; Orzel, Michal > ; Julien Grall ; Roger Pau Monné

[PATCH v3 4/5] automation: add tools/tests jobs on the AMD Zen3+ runner too

2025-02-18 Thread Marek Marczykowski-Górecki
Signed-off-by: Marek Marczykowski-Górecki Reviewed-by: Stefano Stabellini --- new in v2 --- automation/gitlab-ci/test.yaml | 23 +++ 1 file changed, 23 insertions(+) diff --git a/automation/gitlab-ci/test.yaml b/automation/gitlab-ci/test.yaml index 93632f1f9204..fc7663e3367a

[PATCH v3 5/5] docs: add basic CI documentation

2025-02-18 Thread Marek Marczykowski-Górecki
Include info how to get access/enable hardware runners and how to select individual jobs. Signed-off-by: Marek Marczykowski-Górecki --- new in v3 Definitely there can be more content here, but lets start somewhere. --- docs/index.rst | 1 + docs/misc/ci.rst | 35 ++

[PATCH v3 0/5] Few CI improvements

2025-02-18 Thread Marek Marczykowski-Górecki
- Add some more test jobs - Allow selecting individual jobs, without editing yaml files I don't think it needs to be included in 4.20, but may be considered later for backporting. Marek Marczykowski-Górecki (5): automation: skip building domU if there is no test defined for it automation: add

[PATCH v3 2/5] automation: add jobs running tests from tools/tests/*

2025-02-18 Thread Marek Marczykowski-Górecki
There are a bunch of tests in tools/tests/, let them run in CI. For each subdirectory expect "make run" will run the test, and observe its exit code. This way, adding new tests is easy, and they will be automatically picked up. For better visibility, log test output to junit xml format, and let gi

[PATCH v3 3/5] automation: allow selecting individual jobs via CI variables

2025-02-18 Thread Marek Marczykowski-Górecki
Debugging sometimes involves running specific jobs on different versions. It's useful to easily avoid running all of the not interesting ones (for given case) to save both time and CI resources. Doing so used to require changing the yaml files, usually in several places. Ease this step by adding SE

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-02-18 Thread Dave Hansen
On 2/18/25 14:40, Valentin Schneider wrote: >> In practice, it's mostly limited like that. >> >> Architecturally, there are no promises from the CPU. It is within its >> rights to cache anything from the page tables at any time. If it's in >> the CR3 tree, it's fair game. >> > So what if the VMEMMA

Re: [PATCH v4 29/30] x86/mm, mm/vmalloc: Defer flush_tlb_kernel_range() targeting NOHZ_FULL CPUs

2025-02-18 Thread Valentin Schneider
On 11/02/25 06:22, Dave Hansen wrote: > On 2/11/25 05:33, Valentin Schneider wrote: >>> 2. It's wrong to assume that TLB entries are only populated for >>> addresses you access - thanks to speculative execution, you have to >>> assume that the CPU might be populating random TLB entries all over >>>

Re: xen/x86: resolve the last 3 MISRA R16.6 violations

2025-02-18 Thread Stefano Stabellini
On Tue, 18 Feb 2025, Jan Beulich wrote: > On 18.02.2025 00:12, Stefano Stabellini wrote: > > On Mon, 17 Feb 2025, Jan Beulich wrote: > >> On 15.02.2025 03:16, Stefano Stabellini wrote: > >>> --- a/xen/arch/x86/hvm/hvm.c > >>> +++ b/xen/arch/x86/hvm/hvm.c > >>> @@ -3797,22 +3797,14 @@ uint64_t hvm_g

Re: struct mctelem_cookie missing definition

2025-02-18 Thread Stefano Stabellini
On Tue, 18 Feb 2025, Jan Beulich wrote: > On 18.02.2025 03:45, Stefano Stabellini wrote: > > On Mon, 17 Feb 2025, Jan Beulich wrote: > >> On 15.02.2025 09:59, Nicola Vetrini wrote: > >>> On 2025-02-15 00:04, Stefano Stabellini wrote: > On Fri, 14 Feb 2025, Jan Beulich wrote: > >> Would dev

[PATCH AUTOSEL 6.13 27/31] Xen/swiotlb: mark xen_swiotlb_fixup() __init

2025-02-18 Thread Sasha Levin
From: Jan Beulich [ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ] It's sole user (pci_xen_swiotlb_init()) is __init, too. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Message-ID: Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/swiotlb-xe

[PATCH AUTOSEL 6.6 16/17] Xen/swiotlb: mark xen_swiotlb_fixup() __init

2025-02-18 Thread Sasha Levin
From: Jan Beulich [ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ] It's sole user (pci_xen_swiotlb_init()) is __init, too. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Message-ID: Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/swiotlb-xe

[PATCH AUTOSEL 6.1 13/13] Xen/swiotlb: mark xen_swiotlb_fixup() __init

2025-02-18 Thread Sasha Levin
From: Jan Beulich [ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ] It's sole user (pci_xen_swiotlb_init()) is __init, too. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Message-ID: Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/swiotlb-xe

[PATCH v3] xen/dom0less: support for vcpu affinity

2025-02-18 Thread Stefano Stabellini
Add vcpu affinity to the dom0less bindings. Example: dom1 { ... cpus = <4>; vcpu0 { compatible = "xen,vcpu-affinity"; id = <0>; hard-affinity = "4-7"; }; vcpu1 {

Re: [PATCH v2] xen/dom0less: support for vcpu affinity

2025-02-18 Thread Stefano Stabellini
On Mon, 17 Feb 2025, Orzel, Michal wrote: > On 15/02/2025 01:17, Stefano Stabellini wrote: > > > > > > Add vcpu affinity to the dom0less bindings. Example: > > > > dom1 { > > ... > > cpus = <4>; > >

[PATCH AUTOSEL 6.12 27/31] Xen/swiotlb: mark xen_swiotlb_fixup() __init

2025-02-18 Thread Sasha Levin
From: Jan Beulich [ Upstream commit 75ad02318af2e4ae669e26a79f001bd5e1f97472 ] It's sole user (pci_xen_swiotlb_init()) is __init, too. Signed-off-by: Jan Beulich Reviewed-by: Stefano Stabellini Message-ID: Signed-off-by: Juergen Gross Signed-off-by: Sasha Levin --- drivers/xen/swiotlb-xe

Re: [PATCH v3 02/25] drm/dumb-buffers: Provide helper to set pitch and size

2025-02-18 Thread Geert Uytterhoeven
Hi Thomas, On Tue, 18 Feb 2025 at 15:26, Thomas Zimmermann wrote: > Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer > scanline pitch and allocation size. Implementations of struct > drm_driver.dumb_create can call the new helper for their size > computations. > > There is current

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Stefano Stabellini
On Tue, 18 Feb 2025, Andrew Cooper wrote: > On 18/02/2025 11:20 am, Philippe Mathieu-Daudé wrote: > > Hi, > > > > Adding Xen community. > > > > On 8/2/25 21:57, Richard Henderson wrote: > >> Require a 64-bit host binary to spawn a 64-bit guest. > >> > >> Reviewed-by: Thomas Huth > >> Reviewed-by:

Re: [PATCH v2 1/4] x86: provide an inverted Kconfig control for shim-exclusive mode

2025-02-18 Thread Stefano Stabellini
Hi all, The topic was discussed today during the committers and core maintainers call and the decision was to remove the PV_SHIM_EXCLUSIVE Kconfig option. Cheers, Stefano

[PATCH 4/8] hw/xen/xen-pvh: Reduce included headers

2025-02-18 Thread Philippe Mathieu-Daudé
Have "hw/xen/xen-pvh-common.h" include the bare minimal set of headers. Adapt sources to avoid errors when refactoring unrelated headers such: hw/i386/xen/xen-pvh.c: In function ‘xen_pvh_machine_class_init’: hw/i386/xen/xen-pvh.c:84:28: error: ‘TARGET_DEFAULT_CPU_TYPE’ undeclared (first u

[PATCH 7/8] hw/xen/xen-legacy-backend: Remove unused 'net/net.h' header

2025-02-18 Thread Philippe Mathieu-Daudé
Signed-off-by: Philippe Mathieu-Daudé --- include/hw/xen/xen-legacy-backend.h | 1 - 1 file changed, 1 deletion(-) diff --git a/include/hw/xen/xen-legacy-backend.h b/include/hw/xen/xen-legacy-backend.h index e198b120c5d..2d0cbfecade 100644 --- a/include/hw/xen/xen-legacy-backend.h +++ b/include

Re: [PATCH for 4.21 v6 1/2] xen/riscv: drop CONFIG_RISCV_ISA_RV64G

2025-02-18 Thread Jan Beulich
On 12.02.2025 17:50, Oleksii Kurochko wrote: > --- a/xen/arch/riscv/Kconfig > +++ b/xen/arch/riscv/Kconfig > @@ -28,16 +28,6 @@ choice > help > This selects the base ISA extensions that Xen will target. > > -config RISCV_ISA_RV64G > - bool "RV64G" > - help > - Use the

Re: [PATCH 4/8] hw/xen/xen-pvh: Reduce included headers

2025-02-18 Thread Edgar E. Iglesias
On Tue, Feb 18, 2025 at 10:26 AM Philippe Mathieu-Daudé wrote: > Have "hw/xen/xen-pvh-common.h" include the bare minimal set > of headers. Adapt sources to avoid errors when refactoring > unrelated headers such: > > hw/i386/xen/xen-pvh.c: In function ‘xen_pvh_machine_class_init’: > hw/i38

Re: [PATCH 2/8] hw/arm: Do not expose the virt machine on Xen-only binary

2025-02-18 Thread Edgar E. Iglesias
On Tue, Feb 18, 2025 at 10:26 AM Philippe Mathieu-Daudé wrote: > Since the Virt machine is useless under Xen, do not even > try to build it there. > A Xen-only binary now only offers the XenPVH machine: > > $ qemu-system-aarch64 -M help > Supported machines are: > none empty

Re: [PATCH v2 2/2] x86/dom0: attempt to fixup p2m page-faults for PVH dom0

2025-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2025 at 04:58:20PM +0100, Jan Beulich wrote: > On 18.02.2025 16:44, Roger Pau Monné wrote: > > On Tue, Feb 18, 2025 at 03:35:04PM +0100, Roger Pau Monne wrote: > >> --- a/docs/misc/xen-command-line.pandoc > >> +++ b/docs/misc/xen-command-line.pandoc > >> @@ -822,7 +822,8 @@ Specify

Re: [PATCH v2 1/2] x86/iommu: account for IOMEM caps when populating dom0 IOMMU page-tables

2025-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2025 at 04:32:33PM +0100, Jan Beulich wrote: > On 17.02.2025 15:16, Roger Pau Monne wrote: > > The current code in arch_iommu_hwdom_init() kind of open-codes the same > > MMIO permission ranges that are added to the hardware domain ->iomem_caps. > > Avoid this duplication and use ->

[PATCH 2/8] hw/arm: Do not expose the virt machine on Xen-only binary

2025-02-18 Thread Philippe Mathieu-Daudé
Since the Virt machine is useless under Xen, do not even try to build it there. A Xen-only binary now only offers the XenPVH machine: $ qemu-system-aarch64 -M help Supported machines are: none empty machine xenpvh Xen PVH ARM machine Signed-off-by: Philippe M

Re: [PATCH 1/8] accel/Kconfig: Link XenPVH with GPEX PCIe bridge

2025-02-18 Thread Edgar E. Iglesias
On Tue, Feb 18, 2025 at 10:26 AM Philippe Mathieu-Daudé wrote: > XenPVH requires the PCIe/GPEX device. Add it to Kconfig > to avoid when configuring using --without-default-devices: > > /usr/bin/ld: libqemu-aarch64-softmmu.a.p/hw_xen_xen-pvh-common.c.o: in > function `xenpvh_gpex_init': > hw/

Re: [PULL v1 10/12] hw/xen: pvh-common: Add support for creating PCIe/GPEX

2025-02-18 Thread Edgar E. Iglesias
On Tue, Feb 18, 2025 at 6:02 AM Philippe Mathieu-Daudé wrote: > Hi Edgar, > > On 4/9/24 18:15, Edgar E. Iglesias wrote: > > From: "Edgar E. Iglesias" > > > > Add support for optionally creating a PCIe/GPEX controller. > > > > Signed-off-by: Edgar E. Iglesias > > Reviewed-by: Stefano Stabellini

[PATCH 8/8] meson: Remove support for Xen on 32-bit ARM hosts

2025-02-18 Thread Philippe Mathieu-Daudé
Per Stefano: For ARM 32-bit, I do not think we ever had many deployments, as most are 64-bit. Even when there are deployments, they do not typically use QEMU, as QEMU is less important for Xen on ARM compared to x86. The QEMU project only test to cross-build Xen on Aarch64 hosts (see 84ed

[PATCH 6/8] hw/xen/xen-bus: Reduce included headers

2025-02-18 Thread Philippe Mathieu-Daudé
Have "hw/xen/xen-bus" include the bare minimal set of headers. Signed-off-by: Philippe Mathieu-Daudé --- include/hw/xen/xen-bus.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/hw/xen/xen-bus.h b/include/hw/xen/xen-bus.h index 2adb2af8391..bdbf1ed6fd0 100644 --- a/

[PATCH 5/8] hw/xen/xen-hvm: Reduce included headers

2025-02-18 Thread Philippe Mathieu-Daudé
Have "hw/xen/xen-hvm-common.h" include the bare minimal set of headers. Adapt sources to avoid errors when refactoring unrelated headers such: include/hw/xen/xen-hvm-common.h:71:5: error: unknown type name ‘xenevtchn_handle’ 71 | xenevtchn_handle *xce_handle; | ^~~~

[PATCH 3/8] hw/arm/xen-pvh: Do not allow specifying any CPU type

2025-02-18 Thread Philippe Mathieu-Daudé
No CPU can be selected by the PHV machine. Signed-off-by: Philippe Mathieu-Daudé --- hw/arm/xen-pvh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/arm/xen-pvh.c b/hw/arm/xen-pvh.c index d1509bd235d..2557d520307 100644 --- a/hw/arm/xen-pvh.c +++ b/hw/arm/xen-pvh.c @@ -53,6 +53,7 @@ st

[PATCH 0/8] xen: Build fixes and dust removal

2025-02-18 Thread Philippe Mathieu-Daudé
Hi, While preparing another pull request I wanted to run my changes with Xen and failed at testing on a 32-bit ARM host. Apparently the config isn't used (at least we don't test it at all since more than 4 years). Therefore I'm directly dropping it. The rest are #include and Kconfig cleanups. Reg

[PATCH 1/8] accel/Kconfig: Link XenPVH with GPEX PCIe bridge

2025-02-18 Thread Philippe Mathieu-Daudé
XenPVH requires the PCIe/GPEX device. Add it to Kconfig to avoid when configuring using --without-default-devices: /usr/bin/ld: libqemu-aarch64-softmmu.a.p/hw_xen_xen-pvh-common.c.o: in function `xenpvh_gpex_init': hw/xen/xen-pvh-common.c:174: undefined reference to `gpex_set_irq_num' /usr/

Re: [PATCH] xen/console: make console buffer size configurable

2025-02-18 Thread Jan Beulich
On 12.02.2025 23:31, dm...@proton.me wrote: > --- a/xen/drivers/char/Kconfig > +++ b/xen/drivers/char/Kconfig > @@ -96,6 +96,18 @@ config SERIAL_TX_BUFSIZE > > Default value is 32768 (32KiB). > > +config CONRING_SIZE > + int "Console buffer size" > + default 32768 > + range

Re: [PATCH v2 2/2] x86/dom0: attempt to fixup p2m page-faults for PVH dom0

2025-02-18 Thread Jan Beulich
On 18.02.2025 16:44, Roger Pau Monné wrote: > On Tue, Feb 18, 2025 at 03:35:04PM +0100, Roger Pau Monne wrote: >> --- a/docs/misc/xen-command-line.pandoc >> +++ b/docs/misc/xen-command-line.pandoc >> @@ -822,7 +822,8 @@ Specify the bit width of the DMA heap. >> >> ### dom0 >> = List of [ pv

Re: [PATCH v2 2/2] x86/dom0: attempt to fixup p2m page-faults for PVH dom0

2025-02-18 Thread Jan Beulich
On 18.02.2025 15:35, Roger Pau Monne wrote: > When building a PVH dom0 Xen attempts to map all (relevant) MMIO regions > into the p2m for dom0 access. However the information Xen has about the > host memory map is limited. Xen doesn't have access to any resources > described in ACPI dynamic table

Re: [PATCH v3 06/25] drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Russell King (Oracle)
On Tue, Feb 18, 2025 at 03:23:29PM +0100, Thomas Zimmermann wrote: > Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and > buffer size. No alignment required. > > Signed-off-by: Thomas Zimmermann > Cc: Russell King armada_pitch() does have some special alignment (it aligns the p

Re: [PATCH v2 2/2] x86/dom0: attempt to fixup p2m page-faults for PVH dom0

2025-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2025 at 03:35:04PM +0100, Roger Pau Monne wrote: > When building a PVH dom0 Xen attempts to map all (relevant) MMIO regions > into the p2m for dom0 access. However the information Xen has about the > host memory map is limited. Xen doesn't have access to any resources > described

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Philippe Mathieu-Daudé
On 18/2/25 16:25, Philippe Mathieu-Daudé wrote: +Vikram On 18/2/25 15:10, Andrew Cooper wrote: On 18/02/2025 11:20 am, Philippe Mathieu-Daudé wrote: Hi, Adding Xen community. On 8/2/25 21:57, Richard Henderson wrote: Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas

Re: [PATCH v2 2/2] x86/dom0: be less restrictive with the Interrupt Address Range

2025-02-18 Thread Jan Beulich
On 17.02.2025 15:16, Roger Pau Monne wrote: > Xen currently prevents dom0 from creating CPU or IOMMU page-table mappings > into the interrupt address range [0xfee0, 0xfeef]. This range has > two different purposes. For accesses from the CPU is contains the default > position of local APIC

Re: [PATCH v2 1/2] x86/iommu: account for IOMEM caps when populating dom0 IOMMU page-tables

2025-02-18 Thread Jan Beulich
On 17.02.2025 15:16, Roger Pau Monne wrote: > The current code in arch_iommu_hwdom_init() kind of open-codes the same > MMIO permission ranges that are added to the hardware domain ->iomem_caps. > Avoid this duplication and use ->iomem_caps in arch_iommu_hwdom_init() to > filter which memory region

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Philippe Mathieu-Daudé
+Vikram On 18/2/25 15:10, Andrew Cooper wrote: On 18/02/2025 11:20 am, Philippe Mathieu-Daudé wrote: Hi, Adding Xen community. On 8/2/25 21:57, Richard Henderson wrote: Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signe

Re: [PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-18 Thread Jan Beulich
On 18.02.2025 16:01, Orzel, Michal wrote: > On 18/02/2025 14:44, Jan Beulich wrote: >> On 18.02.2025 10:51, Luca Fancellu wrote: >>> LLC coloring can be used only on MMU system, >> >> Just for my own education: Why is this? > I read this as it refers to the feature we have in Xen, not the generic

Re: [PATCH v2 05/11] xen/x86: introduce a new amd cppc driver for cpufreq scaling

2025-02-18 Thread Jan Beulich
On 18.02.2025 08:40, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Wednesday, February 12, 2025 12:46 AM >> To: Penny, Zheng >> >> On 06.02.2025 09:32, Penny Zheng wrote: >>> +static int amd_cppc_khz_to_perf(const struct amd_cppc_drv_data *data, >>> +unsigned int

Re: [PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-18 Thread Orzel, Michal
On 18/02/2025 14:44, Jan Beulich wrote: > > > On 18.02.2025 10:51, Luca Fancellu wrote: >> LLC coloring can be used only on MMU system, > > Just for my own education: Why is this? I read this as it refers to the feature we have in Xen, not the generic concept. You could in theory achieve cach

Re: [PATCH v2 04/11] xen/amd: export processor max frequency value

2025-02-18 Thread Jan Beulich
On 18.02.2025 07:14, Penny, Zheng wrote: > [AMD Official Use Only - AMD Internal Distribution Only] > > Hi, > >> -Original Message- >> From: Jan Beulich >> Sent: Tuesday, February 11, 2025 9:57 PM >> To: Penny, Zheng >> Cc: Huang, Ray ; Andryuk, Jason >> ; Andrew Cooper ; >> Roger Pau M

[PATCH v2 1/2] x86/emul: dump unhandled memory accesses for PVH dom0

2025-02-18 Thread Roger Pau Monne
A PV dom0 can map any host memory as long as it's allowed by the IO capability range in d->iomem_caps. On the other hand, a PVH dom0 has no way to populate MMIO region onto it's p2m, so it's limited to what Xen initially populates on the p2m based on the host memory map and the enabled device BARs

Re: [PATCH v2 03/11] xen/x86: introduce "cpufreq=amd-cppc" xen cmdline

2025-02-18 Thread Jan Beulich
On 18.02.2025 05:24, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, February 17, 2025 6:34 PM >> >> On 17.02.2025 11:17, Penny, Zheng wrote: -Original Message- From: Jan Beulich Sent: Tuesday, February 11, 2025 8:09 PM On 0

Re: [PATCH v2 02/11] xen/x86: introduce new sub-hypercall to propagate CPPC data

2025-02-18 Thread Jan Beulich
On 18.02.2025 07:05, Penny, Zheng wrote: >> -Original Message- >> From: Jan Beulich >> Sent: Monday, February 17, 2025 3:39 PM >> >> On 17.02.2025 08:20, Penny, Zheng wrote: >>> [AMD Official Use Only - AMD Internal Distribution Only] >> >> Btw, boiler plates like this aren't really liked

Re: [PATCH v2] x86/svm: Separate STI and VMRUN instructions in svm_asm_do_resume()

2025-02-18 Thread Andrew Cooper
On 18/02/2025 2:42 pm, Jan Beulich wrote: > On 18.02.2025 15:37, Andrew Cooper wrote: >> There is a corner case in the VMRUN instruction where its INTR_SHADOW state >> leaks into guest state if a VMExit occurs before the VMRUN is complete. An >> example of this could be taking #NPF due to event in

[PATCH v2 2/2] x86/dom0: attempt to fixup p2m page-faults for PVH dom0

2025-02-18 Thread Roger Pau Monne
When building a PVH dom0 Xen attempts to map all (relevant) MMIO regions into the p2m for dom0 access. However the information Xen has about the host memory map is limited. Xen doesn't have access to any resources described in ACPI dynamic tables, and hence the p2m mappings provided might not be

[PATCH v2 0/2] x86/pvh: workaround missing MMIO regions in dom0 p2m

2025-02-18 Thread Roger Pau Monne
Hello, The aim of this series is to provide a workaround for better handling missing MMIO regions in a PVH dom0 p2m. Xen doesn't know the complete host memory layout, as it's not able to parse any information from dynamic ACPI tables. Hence the p2m built for a PVH dom0 might be missing some MMIO

[PATCH v3 16/25] drm/qxl: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Dave Airlie Cc: Gerd Hoffmann --- drivers/gpu/drm/qxl/qxl_dumb.c | 17 - 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/dr

Re: [PATCH v2] x86/svm: Separate STI and VMRUN instructions in svm_asm_do_resume()

2025-02-18 Thread Jan Beulich
On 18.02.2025 15:37, Andrew Cooper wrote: > There is a corner case in the VMRUN instruction where its INTR_SHADOW state > leaks into guest state if a VMExit occurs before the VMRUN is complete. An > example of this could be taking #NPF due to event injection. > > Xen can safely execute STI anywhe

[PATCH v3 20/25] drm/tegra: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Thierry Reding Cc: Mikko Perttunen --- drivers/gpu/drm/tegra/gem.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletion

[PATCH v3 14/25] drm/nouveau: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 256. Signed-off-by: Thomas Zimmermann Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_display.c | 7 --- 1 file changed, 4 insertions(

[PATCH v3 23/25] drm/xe: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Align the buffer size according to hardware requirements. Xe's internal calculation allowed for 64-bit wide buffer sizes, but the ioctl's internal checks always verified against 32-

[PATCH v2] x86/svm: Separate STI and VMRUN instructions in svm_asm_do_resume()

2025-02-18 Thread Andrew Cooper
There is a corner case in the VMRUN instruction where its INTR_SHADOW state leaks into guest state if a VMExit occurs before the VMRUN is complete. An example of this could be taking #NPF due to event injection. Xen can safely execute STI anywhere between CLGI and VMRUN, as CLGI blocks external i

Re: [PATCH v2 1/1] tools/ocaml: Fix oxenstored build warning

2025-02-18 Thread Andrew Cooper
On 14/02/2025 3:47 pm, Andrii Sultanov wrote: > > What's this hunk for?  There's a change in poll.ml , > but I don't see why > > it would need to change this list. > > Otherwise Poll doesn't pick up Utils as its dependency - I guess > before it was always independent and didn't need

[PATCH v3 17/25] drm/renesas/rcar-du: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Laurent Pinchart Cc: Kieran Bingham --- drivers/gpu/drm/renesas/rcar-du/rcar_du_kms.c | 7 +-- 1 file changed, 5 inserti

[PATCH v3 19/25] drm/rockchip: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann Acked-by: Heiko Stuebner Cc: Sandy Huang Cc: "Heiko Stübner" Cc: Andy Yan --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 12 ++--

[PATCH v3 12/25] drm/mediatek: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Cc: Chun-Kuang Hu Cc: Philipp Zabel Cc: Matthias Brugger Cc: AngeloGioacchino Del Regno --- drivers/gpu/drm/mediatek/mtk_gem.c | 13 --

[PATCH v3 15/25] drm/omapdrm: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Reviewed-by: Tomi Valkeinen Cc: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_gem.c | 15 +++ 1 file changed, 7 insertions(+), 8 d

[PATCH v3 11/25] drm/loongson: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Reviewed-by: Sui Jingfeng Cc: Sui Jingfeng --- drivers/gpu/drm/loongson/lsdc_gem.c | 29 - 1 file ch

[PATCH v3 18/25] drm/renesas/rz-du: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Biju Das --- drivers/gpu/drm/renesas/rz-du/rzg2l_du_kms.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff

[PATCH v3 25/25] drm/xlnx: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch according to hardware requirements. Signed-off-by: Thomas Zimmermann Cc: Laurent Pinchart Cc: Tomi Valkeinen --- drivers/gpu/drm/xlnx/zynqmp_kms.c | 7 +-- 1 file changed, 5 insertions(+), 2 de

[PATCH v3 08/25] drm/gma500: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 64. Signed-off-by: Thomas Zimmermann Cc: Patrik Jakobsson --- drivers/gpu/drm/gma500/gem.c | 21 ++--- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a

Re: [XEN RFC PATCH v6 00/11] IOMMU subsystem redesign and PV-IOMMU interface

2025-02-18 Thread Marek Marczykowski-Górecki
On Mon, Feb 17, 2025 at 10:18:17AM +, Teddy Astie wrote: > This work has been presented at Xen Summit 2024 during the > IOMMU paravirtualization and Xen IOMMU subsystem rework > design session. > > Operating systems may want to have access to a IOMMU in order to do DMA > protection or implem

[PATCH v3 13/25] drm/msm: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Alignment is specified in bytes, but the hardware requires the scanline pitch to be a multiple of 32 pixels. Therefore compute the byte size of 32 pixels in the given color mode and align the pitch accordingly. This re

[PATCH v3 22/25] drm/vmwgfx: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Reviewed-by: Zack Rusin Cc: Zack Rusin Cc: Broadcom internal kernel review list --- drivers/gpu/drm/vmwgfx/vmwgfx_surface.c | 21 - 1 fi

[PATCH v3 24/25] drm/xen: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann Cc: Oleksandr Andrushchenko --- drivers/gpu/drm/xen/xen_drm_front.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dr

[PATCH v3 21/25] drm/virtio: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 4. Signed-off-by: Thomas Zimmermann Cc: David Airlie Cc: Gerd Hoffmann Cc: Gurchetan Singh Cc: Chia-I Wu --- drivers/gpu/drm/virtio/virtgpu_gem.c | 11 +-- 1 file changed

[PATCH v3 10/25] drm/imx/ipuv3: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. The hardware requires the framebuffer width to be a multiple of 8. The scanline pitch has be large enough to support this. Therefore compute the byte size of 8 pixels in the given color mode and align the pitch accordi

[PATCH v3 09/25] drm/hibmc: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 128. The hibmc driver's new hibmc_dumb_create() is similar to the one in GEM VRAM helpers. The driver was the only caller of drm_gem_vram_fill_create_dumb(). Remove the now unused help

[PATCH v3 03/25] drm/gem-dma: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Push the current calculation into the only direct caller imx. Imx's hardware requires the framebuffer width to be aligned to 8. The driver's current approach is actually incorrect,

[PATCH v3 04/25] drm/gem-shmem: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Align the pitch to a multiple of 8. Signed-off-by: Thomas Zimmermann --- drivers/gpu/drm/drm_gem_shmem_helper.c | 16 +--- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/d

[PATCH v3 02/25] drm/dumb-buffers: Provide helper to set pitch and size

2025-02-18 Thread Thomas Zimmermann
Add drm_modes_size_dumb(), a helper to calculate the dumb-buffer scanline pitch and allocation size. Implementations of struct drm_driver.dumb_create can call the new helper for their size computations. There is currently quite a bit of code duplication among DRM's memory managers. Each calculates

[PATCH v3 01/25] drm/dumb-buffers: Sanitize output on errors

2025-02-18 Thread Thomas Zimmermann
The ioctls MODE_CREATE_DUMB and MODE_MAP_DUMB return results into a memory buffer supplied by user space. On errors, it is possible that intermediate values are being returned. The exact semantics depends on the DRM driver's implementation of these ioctls. Although this is most-likely not a securit

[PATCH v3 06/25] drm/armada: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Russell King --- drivers/gpu/drm/armada/armada_gem.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/gpu/drm/

[PATCH v3 05/25] drm/gem-vram: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. Inline code from drm_gem_vram_fill_create_dumb() without the existing size computation. Align the pitch to a multiple of 8. Only hibmc and vboxvideo use gem-vram. Hibmc invokes the call to drm_gem_vram_fill_create_dum

[PATCH v3 07/25] drm/exynos: Compute dumb-buffer sizes with drm_mode_size_dumb()

2025-02-18 Thread Thomas Zimmermann
Call drm_mode_size_dumb() to compute dumb-buffer scanline pitch and buffer size. No alignment required. Signed-off-by: Thomas Zimmermann Cc: Inki Dae Cc: Seung-Woo Kim Cc: Kyungmin Park Cc: Krzysztof Kozlowski Cc: Alim Akhtar --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 8 +--- 1 file

[PATCH v3 00/25] drm/dumb-buffers: Fix and improve buffer-size calculation

2025-02-18 Thread Thomas Zimmermann
Dumb-buffer pitch and size is specified by width, height, bits-per-pixel plus various hardware-specific alignments. The calculation of these values is inconsistent and duplicated among drivers. The results for formats with bpp < 8 are incorrect. This series fixes this for most drivers. Default sca

[PATCH] x86/hvm: Add APIC IDs to the per-vLAPIC save area

2025-02-18 Thread Alejandro Vallejo
Today, Xen hardcodes apic_id = vcpu_id * 2, but this is unwise and interferes with providing accurate topology information to the guest. Introduce a new x2apic_id field into hvm_hw_lapic.  This is immutable state from the guest's point of view, but it will allow the toolstack to eventually configu

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Andrew Cooper
On 18/02/2025 11:20 am, Philippe Mathieu-Daudé wrote: > Hi, > > Adding Xen community. > > On 8/2/25 21:57, Richard Henderson wrote: >> Require a 64-bit host binary to spawn a 64-bit guest. >> >> Reviewed-by: Thomas Huth >> Reviewed-by: Philippe Mathieu-Daudé >> Signed-off-by: Richard Henderson >

Re: [PATCH for-4.21 3/3] xen/ACPI: Drop local acpi_os_{v,}printf() and use plain {v,}printk()

2025-02-18 Thread Jan Beulich
On 17.02.2025 20:44, Andrew Cooper wrote: > Now that Xen has a real vprintk(), there's no need to opencode it locally with > vsnprintf(). Redirect the debug routines to the real {v,}printk() and drop > the local acpi_os_{v,}printf() implementations. > > Amongst other things, this removes one arbi

Re: [PATCH v3 2/2] xen/arm: Restrict Kconfig configuration for LLC coloring

2025-02-18 Thread Jan Beulich
On 18.02.2025 10:51, Luca Fancellu wrote: > LLC coloring can be used only on MMU system, Just for my own education: Why is this? Jan

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Philippe Mathieu-Daudé
On 18/2/25 14:19, Philippe Mathieu-Daudé wrote: On 18/2/25 12:20, Philippe Mathieu-Daudé wrote: Hi, Adding Xen community. On 8/2/25 21:57, Richard Henderson wrote: Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-

Re: [PULL 3/9] meson: Disallow 64-bit on 32-bit Xen emulation

2025-02-18 Thread Philippe Mathieu-Daudé
On 18/2/25 12:20, Philippe Mathieu-Daudé wrote: Hi, Adding Xen community. On 8/2/25 21:57, Richard Henderson wrote: Require a 64-bit host binary to spawn a 64-bit guest. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson ---   meson.build | 9

Re: [PATCH v6] Avoid crash calling PrintErrMesg from efi_multiboot2

2025-02-18 Thread Andrew Cooper
On 18/02/2025 12:05 pm, Frediano Ziglio wrote: > On Mon, Feb 17, 2025 at 4:56 PM Jan Beulich wrote: >> On 17.02.2025 17:52, Frediano Ziglio wrote: >>> On Mon, Feb 17, 2025 at 4:41 PM Andrew Cooper >>> wrote: On 17/02/2025 4:31 pm, Jan Beulich wrote: > On 17.02.2025 17:26, Frediano Zigli

Re: [PATCH v6] Avoid crash calling PrintErrMesg from efi_multiboot2

2025-02-18 Thread Frediano Ziglio
On Mon, Feb 17, 2025 at 4:56 PM Jan Beulich wrote: > > On 17.02.2025 17:52, Frediano Ziglio wrote: > > On Mon, Feb 17, 2025 at 4:41 PM Andrew Cooper > > wrote: > >> > >> On 17/02/2025 4:31 pm, Jan Beulich wrote: > >>> On 17.02.2025 17:26, Frediano Ziglio wrote: > --- a/xen/common/efi/efi-co

Re: [PULL v1 10/12] hw/xen: pvh-common: Add support for creating PCIe/GPEX

2025-02-18 Thread Philippe Mathieu-Daudé
Hi Edgar, On 4/9/24 18:15, Edgar E. Iglesias wrote: From: "Edgar E. Iglesias" Add support for optionally creating a PCIe/GPEX controller. Signed-off-by: Edgar E. Iglesias Reviewed-by: Stefano Stabellini --- hw/xen/xen-pvh-common.c | 76 + include/h

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-18 Thread Roger Pau Monné
On Tue, Feb 18, 2025 at 11:56:48AM +0200, Grygorii Strashko wrote: > Honestly, It looks a bit strange that Xen community is considering batch > automated code formatting, > For example Linux kernel cleanly rejected such approach. > Linux kernel docs "4.1.1. Coding style" section [1]. > > Another

Re: [PATCH 0/2] code style exercise: Drivers folder samples

2025-02-18 Thread Jan Beulich
On 18.02.2025 03:36, Stefano Stabellini wrote: > On Mon, 17 Feb 2025, Jan Beulich wrote: >> On 16.02.2025 11:21, Oleksandr Andrushchenko wrote: >>> 1. Const string arrays reformatting >>> In case the length of items change we might need to introduce a bigger >>> change wrt new formatting of unaffec

Re: xen/x86: resolve the last 3 MISRA R16.6 violations

2025-02-18 Thread Jan Beulich
On 18.02.2025 00:12, Stefano Stabellini wrote: > On Mon, 17 Feb 2025, Jan Beulich wrote: >> On 15.02.2025 03:16, Stefano Stabellini wrote: >>> --- a/xen/arch/x86/hvm/hvm.c >>> +++ b/xen/arch/x86/hvm/hvm.c >>> @@ -3797,22 +3797,14 @@ uint64_t hvm_get_reg(struct vcpu *v, unsigned int >>> reg) >>> {

Re: struct mctelem_cookie missing definition

2025-02-18 Thread Jan Beulich
On 18.02.2025 03:45, Stefano Stabellini wrote: > On Mon, 17 Feb 2025, Jan Beulich wrote: >> On 15.02.2025 09:59, Nicola Vetrini wrote: >>> On 2025-02-15 00:04, Stefano Stabellini wrote: On Fri, 14 Feb 2025, Jan Beulich wrote: >> Would deviating macros "COOKIE2MCTE" and "MCTE2COOKIE" work?

  1   2   >