[PATCH] xen/arm: Add Rockchip rk3399 early printk support

2023-10-25 Thread Jun Nie
Signed-off-by: Jun Nie --- xen/arch/arm/Kconfig.debug | 5 + 1 file changed, 5 insertions(+) diff --git a/xen/arch/arm/Kconfig.debug b/xen/arch/arm/Kconfig.debug index 842d768280..fefe8ac4df 100644 --- a/xen/arch/arm/Kconfig.debug +++ b/xen/arch/arm/Kconfig.debug @@ -158,6 +158,9 @@ choice

Re: [QEMU][PATCHv2 7/8] xen: add map and unmap callbacks for grant region

2023-10-25 Thread Vikram Garhwal
On Wed, Oct 25, 2023 at 06:32:26PM -0700, Stefano Stabellini wrote: > On Wed, 25 Oct 2023, Vikram Garhwal wrote: > > From: Juergen Gross > > > > Add the callbacks for mapping/unmapping guest memory via grants to the > > special grant memory region. > > > > Signed-off-by: Juergen Gross > >

[ovmf test] 183532: all pass - PUSHED

2023-10-25 Thread osstest service owner
flight 183532 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/183532/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 9bb5ef1287c6765c477fb2cb3107339f700ab419 baseline version: ovmf

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

2023-10-25 Thread osstest service owner
flight 183529 xen-unstable real [real] flight 183533 xen-unstable real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/183529/ http://logs.test-lab.xenproject.org/osstest/logs/183533/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking):

Re: [QEMU][PATCHv2 7/8] xen: add map and unmap callbacks for grant region

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Vikram Garhwal wrote: > From: Juergen Gross > > Add the callbacks for mapping/unmapping guest memory via grants to the > special grant memory region. > > Signed-off-by: Juergen Gross > Signed-off-by: Vikram Garhwal > --- > hw/xen/xen-mapcache.c | 175

Re: [QEMU][PATCHv2 3/8] xen: add pseudo RAM region for grant mappings

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Vikram Garhwal wrote: > From: Juergen Gross > > Add a memory region which can be used to automatically map granted > memory. It is starting at 0x8000ULL in order to be able to > distinguish it from normal RAM. > > For this reason the xen.ram memory region is

Re: [QEMU][PATCHv2 1/8] xen: when unplugging emulated devices skip virtio devices

2023-10-25 Thread Stefano Stabellini
On Thu, 26 Oct 2023, David Woodhouse wrote: > On Wed, 2023-10-25 at 14:24 -0700, Vikram Garhwal wrote: > > From: Juergen Gross > > > > Virtio devices should never be unplugged at boot time, as they are > > similar to pci passthrough devices. > > > > Signed-off-by: Juergen Gross > >

Re: [PATCH] misra: add R14.4 R21.1 R21.2

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Jan Beulich wrote: > On 25.10.2023 03:15, Stefano Stabellini wrote: > > On Tue, 24 Oct 2023, Jan Beulich wrote: > >> On 24.10.2023 01:31, Stefano Stabellini wrote:> --- a/docs/misra/rules.rst > >>> +++ b/docs/misra/rules.rst > >>> @@ -422,6 +422,13 @@ maintainers if you want

Re: [QEMU][PATCHv2 1/8] xen: when unplugging emulated devices skip virtio devices

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 14:24 -0700, Vikram Garhwal wrote: > From: Juergen Gross > > Virtio devices should never be unplugged at boot time, as they are > similar to pci passthrough devices. > > Signed-off-by: Juergen Gross > Signed-off-by: Vikram Garhwal Hm, do your virtio NICs still actually

[PATCH v3 2/2] xen/ppc: Implement a basic exception handler

2023-10-25 Thread Shawn Anastasio
Implement a basic exception handler that dumps the CPU state to the console, as well as the code required to set the correct exception vector table's base address in setup.c. Signed-off-by: Shawn Anastasio --- v3: - Add comment to explain %r1 clobber - Add comment about ISR declaration order

[PATCH v3 0/2] Early exception handlers on Power

2023-10-25 Thread Shawn Anastasio
Hello all, This series implements a basic exception handler and the required support infrastructure on Power. Currently the handler just dumps all registers to the serial console and nothing else, but even this is useful for debugging during early bring-up. Thanks, Shawn Anastasio (2):

[PATCH v3 1/2] xen/ppc: Add .text.exceptions section for exception vectors

2023-10-25 Thread Shawn Anastasio
On Power, the exception vectors must lie at a fixed address, depending on the state of the Alternate Interrupt Location (AIL) field of the Logical Partition Control Register (LPCR). Create a .text.exceptions section in the linker script at an address suitable for AIL=3 plus an accompanying

Re: [XEN PATCH][for-4.19 v3 1/8] xen/include: add macro LOWEST_BIT

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Jan Beulich wrote: > On 25.10.2023 16:50, Nicola Vetrini wrote: > > Ok, I'll send a revised version using MASK_LOWEST_BIT, taking into > > account also the > > other comments about the explanation on the macro definition > > (which some IDEs even show when hovering on its

Re: [XEN PATCH][for-4.19 v4 3/8] x86: add deviation comments for asm-only functions

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Nicola Vetrini wrote: > On 24/10/2023 21:50, Stefano Stabellini wrote: > > On Tue, 24 Oct 2023, Nicola Vetrini wrote: > > > On 24/10/2023 10:14, Jan Beulich wrote: > > > > On 24.10.2023 10:01, Nicola Vetrini wrote: > > > > > On 24/10/2023 09:50, Jan Beulich wrote: > > > > > >

Re: Lockdep show 6.6-rc regression in Xen HVM CPU hotplug

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 17:10 +0100, David Woodhouse wrote: > On Wed, 2023-10-25 at 09:19 +0200, Juergen Gross wrote: > > On 24.10.23 15:45, David Woodhouse wrote: > > > On Tue, 2023-10-24 at 14:08 +0200, Juergen Gross wrote: > > > > > > > > > I can probably change xen_send_IPI_one() to not need >

Re: [XEN PATCH][for-4.19 v3] xen: Add deviations for MISRA C:2012 Rule 7.1

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Jan Beulich wrote: > On 24.10.2023 22:30, Stefano Stabellini wrote: > > On Tue, 24 Oct 2023, Nicola Vetrini wrote: > >> As specified in rules.rst, these constants can be used > >> in the code. > >> > >> Signed-off-by: Nicola Vetrini > >> --- > >> Changes in v2: > >> - replace

Re: [PATCH v2 2/2] xen/ppc: Implement a basic exception handler

2023-10-25 Thread Shawn Anastasio
On 10/20/23 1:22 AM, Jan Beulich wrote: > On 19.10.2023 22:02, Shawn Anastasio wrote: >> On 10/18/23 10:43 AM, Jan Beulich wrote: >>> On 13.10.2023 20:13, Shawn Anastasio wrote: --- a/xen/arch/ppc/setup.c +++ b/xen/arch/ppc/setup.c @@ -11,6 +11,15 @@ /* Xen stack for bringing

[linux-5.4 test] 183523: tolerable trouble: fail/pass/starved - PUSHED

2023-10-25 Thread osstest service owner
flight 183523 linux-5.4 real [real] flight 183531 linux-5.4 real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/183523/ http://logs.test-lab.xenproject.org/osstest/logs/183531/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking):

[QEMU][PATCHv2 7/8] xen: add map and unmap callbacks for grant region

2023-10-25 Thread Vikram Garhwal
From: Juergen Gross Add the callbacks for mapping/unmapping guest memory via grants to the special grant memory region. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal --- hw/xen/xen-mapcache.c | 175 +- system/physmem.c | 11 ++- 2

[QEMU][PATCHv2 1/8] xen: when unplugging emulated devices skip virtio devices

2023-10-25 Thread Vikram Garhwal
From: Juergen Gross Virtio devices should never be unplugged at boot time, as they are similar to pci passthrough devices. Signed-off-by: Juergen Gross Signed-off-by: Vikram Garhwal --- docs/system/i386/xen.rst | 3 --- hw/i386/xen/xen_platform.c | 10 -- 2 files changed, 8

[QEMU][PATCHv2 3/8] xen: add pseudo RAM region for grant mappings

2023-10-25 Thread Vikram Garhwal
From: Juergen Gross Add a memory region which can be used to automatically map granted memory. It is starting at 0x8000ULL in order to be able to distinguish it from normal RAM. For this reason the xen.ram memory region is expanded, which has no further impact as it is used just as

[QEMU][PATCHv2 5/8] xen: let xen_ram_addr_from_mapcache() return -1 in case of not found entry

2023-10-25 Thread Vikram Garhwal
From: Juergen Gross Today xen_ram_addr_from_mapcache() will either abort() or return 0 in case it can't find a matching entry for a pointer value. Both cases are bad, so change that to return an invalid address instead. Signed-off-by: Juergen Gross Reviewed-by: Stefano Stabellini ---

Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Julien Grall wrote: > On 25/10/2023 17:01, Jan Beulich wrote: > > On 25.10.2023 17:58, Julien Grall wrote: > > > On 25/10/2023 09:18, Jan Beulich wrote: > > > > On 24.10.2023 21:59, Stefano Stabellini wrote: > > > > > If I understood correctly I am fine with that. To make sure

Re: [PATCH for-4.19 v2] docs/arm: Document where Xen should be loaded in memory

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Julien Grall wrote: > Hi Stefano, > > On 24/10/2023 20:52, Stefano Stabellini wrote: > > On Tue, 24 Oct 2023, Bertrand Marquis wrote: > > > Hi Julien, > > > > > > > On 24 Oct 2023, at 12:28, Julien Grall wrote: > > > > > > > > From: Julien Grall > > > > > > > > In commit

Re: [RFC PATCH 22/22] x86/AMD: add IRPerf support

2023-10-25 Thread Andrew Cooper
On 25/10/2023 8:29 pm, Edwin Török wrote: > diff --git a/xen/arch/x86/msr.c b/xen/arch/x86/msr.c > index 483b5e4f70..b3cd851d9d 100644 > --- a/xen/arch/x86/msr.c > +++ b/xen/arch/x86/msr.c > @@ -584,6 +584,13 @@ int guest_wrmsr(struct vcpu *v, uint32_t msr, uint64_t > val) > } >

Re: Generalise the usage of exclude-list.json

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Jan Beulich wrote: > On 25.10.2023 10:35, Luca Fancellu wrote: > > I’m sending this mail looking for feedbacks about generalising the > > exclude-list.json, as suggested (IIRC) by Jan > > this list can be used by multiple users and not only for MISRA, by adding a > > field

Re: [for-4.19][PATCH] build: Allow setting KBUILD_DEFCONFIG in the environment

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Jan Beulich wrote: > On 25.10.2023 11:35, Michal Orzel wrote: > > > > > > On 25/10/2023 11:26, Jan Beulich wrote: > >> > >> > >> On 25.10.2023 11:21, Michal Orzel wrote: > >>> On 25/10/2023 11:10, Jan Beulich wrote: > On 25.10.2023 10:28, Michal Orzel wrote: > > At

Re: [PATCH 1/2] x86/ucode: Move vendor specifics back out of early_microcode_init()

2023-10-25 Thread Stefano Stabellini
On Wed, 25 Oct 2023, Andrew Cooper wrote: > I know it was me who dropped microcode_init_{intel,amd}() in c/s > dd5f07997f29 ("x86/ucode: Rationalise startup and family/model checks"), but > times have moved on. We've gained new conditional support, and a wish to > compile-time specialise Xen to

Re: [RFC PATCH 01/22] x86/msr: MSR_PLATFORM_INFO shouldn't claim that turbo is programmable

2023-10-25 Thread Andrew Cooper
On 25/10/2023 8:29 pm, Edwin Török wrote: > From: Edwin Török > > Xen forbids writes to the various turbo control MSRs, however > MSR_PLATFORM_INFO claims that these MSRs are writable. > Override MSR_PLATFORM_INFO bits to indicate lack of support. > > See Intel SDM Volume 4, 2.17.6 "MSRs

[RFC PATCH 20/22] x86/PMUv5: limit available fixed PMCs and enable support

2023-10-25 Thread Edwin Török
From: Edwin Török AnyThread deprecation means a bit in 0xa edx, which we pass through. (we could also avoid doing the anythread masking, but we need that for version <= 4 support). Fixed Counter enumeration means we need to limit fixed counters if we hide any. Domain separation needs no

[RFC PATCH 22/22] x86/AMD: add IRPerf support

2023-10-25 Thread Edwin Török
From: Edwin Török Instruction retired perf counter, enabled by writing to a bit in HWCR. Signed-off-by: Edwin Török --- xen/arch/x86/include/asm/msr-index.h| 1 + xen/arch/x86/msr.c | 7 +++ xen/include/public/arch-x86/cpufeatureset.h | 2 +- 3 files

[RFC PATCH 18/22] x86/PMUv4: disable intercept for PERF_GLOBAL_STATUS

2023-10-25 Thread Edwin Török
From: Edwin Török Now that we have a way to set PERF_GLOBAL_STATUS by writing to PERF_GLOBAL_STATUS_RESET (== PERF_GLOBAL_OVF_CTRL) and PERF_GLOBAL_STATUS_SET we do not need to intercept this MSR anymore. We can save/restore its state when saving/loading vPMU state, and otherwise let the guest

Re: [PATCH v3 4/5] xen/arm: enable vPCI for dom0

2023-10-25 Thread Stewart Hildebrand
On 10/20/23 13:33, Julien Grall wrote: > Hi Stewart, > > On 09/10/2023 20:57, Stewart Hildebrand wrote: >> Set the pci flags in xen_arch_domainconfig to enable vPCI for dom0. >> >> Signed-off-by: Stewart Hildebrand >> --- >> Julien had a suggestion to make this conditional on

[RFC PATCH 21/22] x86/AMD: fix CPUID for PerfCtr{4,5}

2023-10-25 Thread Edwin Török
From: Edwin Török These are available, but were hidden by CPUID previously. There are IR (all guests), NB and L2I (dom0 only) performance counters too that need to be implemented, add placeholder entries for them. Signed-off-by: Edwin Török --- xen/arch/x86/cpu-policy.c |

[RFC PATCH 16/22] x86/PMUv4: support LBR_Frz and CTR_Frz

2023-10-25 Thread Edwin Török
From: Edwin Török The behaviour is changed from Legacy to Streamlined for the LBR and PERFMON freeze bits. See "17.4.7 Freezing LBR and Performance Counters on PMI". Instead of clearing the freeze bits through DEBUGCTL they are now cleared through MSR 0x390 like everything else. Signed-off-by:

[RFC PATCH 14/22] x86/msr: RO MSR_TURBO_RATIO_LIMIT{,1,2}, MSR_TEMPERATURE_TARGET

2023-10-25 Thread Edwin Török
From: Edwin Török Expose MSR_TURBO_RATIO_LIMIT{,1,2} and MSR_TEMPERATURE_TARGET to guest as RO. Although these are not architectural MSRs they are in the same place currently on all supported CPUs. They also have the same meaning, except for 06_55H and 06_5C where they have a different meaning

[RFC PATCH 15/22] x86/VPMU: use macros for max supported VPMU version

2023-10-25 Thread Edwin Török
From: Edwin Török This ensures consistency between the 2 pieces of code that check for VPMU version. No functional change. Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu_intel.c | 20 ++-- xen/arch/x86/include/asm/vpmu.h | 1 + 2 files changed, 7 insertions(+), 14

[RFC PATCH 11/22] x86/PMUv2: freeze support in IA32_DEBUGCTL

2023-10-25 Thread Edwin Török
From: Edwin Török This is not yet exposed by HVM policies, but PMU version 2 requires that if PDCM is supported in CPUID then these 2 bits would work. Signed-off-by: Edwin Török --- xen/arch/x86/hvm/vmx/vmx.c | 4 xen/arch/x86/include/asm/msr-index.h | 4 +++- 2 files changed,

[RFC PATCH 02/22] x86/msr: implement MSR_SMI_COUNT for Dom0 on Intel

2023-10-25 Thread Edwin Török
From: Edwin Török Dom0 should always be able to read this MSR: it is useful when investigating performance issues in production. Although the count is Thread scoped, in practice all cores were observed to return the same count (perhaps due to implementation details of SMM), so do not require the

[RFC PATCH 19/22] x86/PMUv4: bump max PMU version to 4

2023-10-25 Thread Edwin Török
From: Edwin Török Depends on the other x86/PMUv4 patches: "x86/PMUv4: disable intercept for PERF_GLOBAL_STATUS" "x86/PMUv4: IA32_PERF_GLOBAL_{STATUS_SET, INUSE} support" "x86/PMUv4: support LBR_Frz and CTR_Frz" Signed-off-by: Edwin Török --- xen/arch/x86/include/asm/vpmu.h | 2 +- 1 file

[RFC PATCH 12/22] x86/msr-index: define more architectural MSRs

2023-10-25 Thread Edwin Török
From: Edwin Török Add most architectural MSRs, except those behind CPUID features that are not yet implemented, such as TME, SGX. Based on "2.1 Architectural MSRs" of Intel SDM volume 4 Signed-off-by: Edwin Török --- xen/arch/x86/include/asm/msr-index.h | 54 +--- 1

[RFC PATCH 05/22] x86/PMUv1: report correct information in 0xa CPUID

2023-10-25 Thread Edwin Török
From: Edwin Török The 0xa CPUID leaf has to report supported number of: - fixed performance counters - general purpose performance counters - architectural predefined events And the PMU version (which was already limited to 3). Type punning is used, which should be safe due to

[RFC PATCH 01/22] x86/msr: MSR_PLATFORM_INFO shouldn't claim that turbo is programmable

2023-10-25 Thread Edwin Török
From: Edwin Török Xen forbids writes to the various turbo control MSRs, however MSR_PLATFORM_INFO claims that these MSRs are writable. Override MSR_PLATFORM_INFO bits to indicate lack of support. See Intel SDM Volume 4, 2.17.6 "MSRs Introduced in the Intel Xeon Scaslable Processor Family",

[RFC PATCH 07/22] x86/PMUv1: allow topdown slots arch perf event

2023-10-25 Thread Edwin Török
From: Edwin Török This is part of 'Architectural Performance Monitoring Version 1' and implemented on Icelake. Backport: 4.13+ Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu_intel.c | 1 + xen/arch/x86/cpuid.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git

[RFC PATCH 09/22] x86/PMUv1: consistently use 8 perf counters in Dom0

2023-10-25 Thread Edwin Török
From: Edwin Török The code is currently inconsistent: supports 4 on read and 8 on write. Sandy Bridge+ supports 8 of these, and the MSR range is architecturally reserved, so always support 8. Make it a macro to ensure we use the same value everywhere. Although DomUs are now restricted to only

[RFC PATCH 13/22] x86/vpmu: expose PDCM and IA32_PERF_CAPABILITIES when vpmu is enabled

2023-10-25 Thread Edwin Török
From: Edwin Török Marked as exposed by default, but then hidden if vpmu is not available. TODO: the interaction between vpmu and policy might need some changes. Only expose LBR and the full-width MSR capabilities, and not PEBS. Backport: 4.15+ Signed-off-by: Edwin Török ---

[RFC PATCH 17/22] x86/PMUv4: IA32_PERF_GLOBAL_{STATUS_SET, INUSE} support

2023-10-25 Thread Edwin Török
From: Edwin Török Expose thse MSRs to the guest when PMU version is >= 4. Signed-off-by: Edwin Török --- xen/arch/x86/cpu/vpmu_intel.c | 20 +++- xen/arch/x86/hvm/vmx/vmx.c | 5 + xen/arch/x86/pv/emul-priv-op.c | 5 + 3 files changed, 29 insertions(+), 1

[RFC PATCH 10/22] x86/PMUv2: limit number of fixed perf counters to 3

2023-10-25 Thread Edwin Török
From: Edwin Török There are only 3 architectural fixed function counters defined, however Icelake introduces a 4th. So we'll need to report the number of fixed counter implemented in CPUID correctly for Icelake, define a macro to ensure we are consistent about which counter is last. Note:

[RFC PATCH 06/22] x86/PMUv1: limit arch PMCs to 4 for non-Dom0

2023-10-25 Thread Edwin Török
From: Edwin Török Only PERFEVTSEL{0-3} are architectural MSRs and Thread scoped. PERFEVTSEL{4-7} are Core scoped, and we cannot allow using them if more than 1 guest can attempt to modify them: if they program them with different events (quite likely when multiplexing) then one of the VMs would

[RFC PATCH 08/22] x86/PMUv1: define macro for max number of events

2023-10-25 Thread Edwin Török
From: Edwin Török This is needed so we can expose the maximum supported in CPUID, without cpuid.c and vpmu_intel.c going out of sync. The macros defined here take a parameter that controls how the enum values are used: either to generate case statements or to count how many elements we have.

[RFC PATCH 04/22] x86/msr-index: add references to vendor manuals

2023-10-25 Thread Edwin Török
From: Edwin Török To more easily lookup the semantics of these MSRs add references to vendor manuals. Signed-off-by: Edwin Török --- xen/arch/x86/include/asm/msr-index.h | 10 ++ 1 file changed, 10 insertions(+) diff --git a/xen/arch/x86/include/asm/msr-index.h

[RFC PATCH 00/22] vPMU bugfixes and support for PMUv5

2023-10-25 Thread Edwin Török
These are a set of patches to improve performance monitoring in Xen. It starts by fixing MSR_PLATFORM_INFO and making MSR_SMI_COUNT available. Also allows a pinned Dom0 to read any MSR, there is no reason why this shouldn't be allowed, and it prevents having to recompile Xen in order to

[RFC PATCH 03/22] x86/msr: always allow a pinned Dom0 to read any unknown MSR

2023-10-25 Thread Edwin Török
From: Edwin Török This can be useful if you realize you have to inspect the value of an MSR in production, without having to change into a new Xen first that handles the MSR. E.g. SMI count didn't use to be explicitly allowed in the past (it now is, see a previous commit), but there could be

Re: [PATCH v3 3/5] xen/arm: make has_vpci() depend on d->arch.has_vpci

2023-10-25 Thread Stewart Hildebrand
On 10/20/23 13:29, Julien Grall wrote: > Hi, > > On 09/10/2023 20:57, Stewart Hildebrand wrote: >> From: Oleksandr Andrushchenko >> >> VPCI is disabled on ARM. Make it depend on d->arch.has_vpci to enable the PCI >> passthrough support on ARM. >> >> While here, remove the comment on the

Re: [PATCH v3 2/5] xen/arm: pci: plumb xen_arch_domainconfig with pci info

2023-10-25 Thread Stewart Hildebrand
On 10/20/23 13:25, Julien Grall wrote: > On 09/10/2023 20:57, Stewart Hildebrand wrote: >> Add a flag to struct xen_arch_domainconfig to allow specifying at domain >> creation time whether the domain uses vPCI. >> >> Add a corresponding flag to struct arch_domain to indicate vPCI and set it >>

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 19:56 +0100, Andrew Cooper wrote: > On 25/10/2023 7:26 pm, David Woodhouse wrote: >   > > On Wed, 2023-10-25 at 13:20 -0500, Eric Blake wrote: > >   > > > On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote: > >   > > >   > > > > + > > > > +Booting Xen PV guests >

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-25 Thread Andrew Cooper
On 25/10/2023 7:26 pm, David Woodhouse wrote: > On Wed, 2023-10-25 at 13:20 -0500, Eric Blake wrote: >> On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote: >>> + >>> +Booting Xen PV guests >>> +- >>> + >>> +Booting PV guest kernels is possible by using the Xen PV

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 13:20 -0500, Eric Blake wrote: > On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote: > > From: David Woodhouse > > > > Add notes about console and network support, and how to launch PV guests. > > Clean up the disk configuration examples now that that's

Re: [PATCH v3 28/28] docs: update Xen-on-KVM documentation

2023-10-25 Thread Eric Blake
On Wed, Oct 25, 2023 at 03:50:42PM +0100, David Woodhouse wrote: > From: David Woodhouse > > Add notes about console and network support, and how to launch PV guests. > Clean up the disk configuration examples now that that's simpler, and > remove the comment about IDE unplug on q35/AHCI now

[PATCH 2/2] x86/Kconfig: Introduce CONFIG_{AMD,INTEL} and conditionalise ucode

2023-10-25 Thread Andrew Cooper
We eventually want to be able to build a stripped down Xen for a single platform. Make a start with CONFIG_{AMD,INTEL} (hidden behind EXPERT, but available to randconfig), and adjust the microcode logic. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné

[PATCH 1/2] x86/ucode: Move vendor specifics back out of early_microcode_init()

2023-10-25 Thread Andrew Cooper
I know it was me who dropped microcode_init_{intel,amd}() in c/s dd5f07997f29 ("x86/ucode: Rationalise startup and family/model checks"), but times have moved on. We've gained new conditional support, and a wish to compile-time specialise Xen to single platform. (Re)introduce

[PATCH 0/2] x86: ucode and CPU Kconfig

2023-10-25 Thread Andrew Cooper
A fix to the recent Ucode changes which I ultimately didn't insist on owing to the Xen 4.18 timeline, and enough of the start on the CPU Kconfig to allow randconfig to check the boundary. There are many more ucode fixes to come... Andrew Cooper (2): x86/ucode: Move vendor specifics back out of

Re: [XEN] xen/arm: arm32: Use adr_l instead of load_paddr for getting address of symbols

2023-10-25 Thread Michal Orzel
Hi Ayan, On 25/10/2023 19:03, Ayan Kumar Halder wrote: > Before the MMU is turned on, the address returned for any symbol will always > be > physical address. Thus, one can use adr_l instead of load_paddr. > > create_table_entry() now takes an extra argument to denote if it is called > after >

[ovmf test] 183526: all pass - PUSHED

2023-10-25 Thread osstest service owner
flight 183526 ovmf real [real] http://logs.test-lab.xenproject.org/osstest/logs/183526/ Perfect :-) All tests in this flight passed as required version targeted for testing: ovmf 884ef984541c3e346d39e423fea53cf25066ff5a baseline version: ovmf

[XEN] xen/arm: arm32: Use adr_l instead of load_paddr for getting address of symbols

2023-10-25 Thread Ayan Kumar Halder
Before the MMU is turned on, the address returned for any symbol will always be physical address. Thus, one can use adr_l instead of load_paddr. create_table_entry() now takes an extra argument to denote if it is called after the mmu is turned on or not. If it is called with mmu on, then it uses

Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10

2023-10-25 Thread Julien Grall
On 25/10/2023 17:01, Jan Beulich wrote: On 25.10.2023 17:58, Julien Grall wrote: On 25/10/2023 09:18, Jan Beulich wrote: On 24.10.2023 21:59, Stefano Stabellini wrote: If I understood correctly I am fine with that. To make sure we are all on the same page, can you provide a couple of

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

2023-10-25 Thread osstest service owner
flight 183522 xen-unstable real [real] http://logs.test-lab.xenproject.org/osstest/logs/183522/ Failures :-/ but no regressions. Tests which are failing intermittently (not blocking): test-amd64-i386-qemuu-rhel6hvm-amd 7 xen-install fail pass in 183519 test-armhf-armhf-libvirt-qcow2

Re: Lockdep show 6.6-rc regression in Xen HVM CPU hotplug

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 09:19 +0200, Juergen Gross wrote: > On 24.10.23 15:45, David Woodhouse wrote: > > On Tue, 2023-10-24 at 14:08 +0200, Juergen Gross wrote: > > > > > > > I can probably change xen_send_IPI_one() to not need > > > > irq_get_chip_data(). > > > > > > David, could you test the

Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10

2023-10-25 Thread Jan Beulich
On 25.10.2023 17:58, Julien Grall wrote: > On 25/10/2023 09:18, Jan Beulich wrote: >> On 24.10.2023 21:59, Stefano Stabellini wrote: >>> If I understood correctly I am fine with that. To make sure we are all >>> on the same page, can you provide a couple of samples? >> >> Taking the earlier

Re: [XEN PATCH v2 00/10] address violations of MISRA C:2012 Directive 4.10

2023-10-25 Thread Julien Grall
Hi, On 25/10/2023 09:18, Jan Beulich wrote: On 24.10.2023 21:59, Stefano Stabellini wrote: If I understood correctly I am fine with that. To make sure we are all on the same page, can you provide a couple of samples? Taking the earlier example, instead of DRIVERS_PASSTHROUGH_VTD_DMAR_H it

Re: [PATCH 38/45] hw/riscv: use qemu_configure_nic_device()

2023-10-25 Thread David Woodhouse
On Wed, 2023-10-25 at 12:42 -0300, Daniel Henrique Barboza wrote: > > I believe you forgot to remove the 'nd' variable. Building with this patch > (applying > patches 1 to 4 first) fails with: > > > ../hw/riscv/microchip_pfsoc.c: In function ‘microchip_pfsoc_soc_realize’: >

Re: [PATCH 38/45] hw/riscv: use qemu_configure_nic_device()

2023-10-25 Thread Daniel Henrique Barboza
On 10/22/23 12:51, David Woodhouse wrote: From: David Woodhouse Signed-off-by: David Woodhouse --- hw/riscv/microchip_pfsoc.c | 13 ++--- hw/riscv/sifive_u.c| 7 +-- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/hw/riscv/microchip_pfsoc.c

[xen-unstable-smoke test] 183525: tolerable all pass - PUSHED

2023-10-25 Thread osstest service owner
flight 183525 xen-unstable-smoke real [real] http://logs.test-lab.xenproject.org/osstest/logs/183525/ 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

Re: [XEN PATCH][for-4.19 v3 1/8] xen/include: add macro LOWEST_BIT

2023-10-25 Thread Jan Beulich
On 25.10.2023 16:50, Nicola Vetrini wrote: > Ok, I'll send a revised version using MASK_LOWEST_BIT, taking into > account also the > other comments about the explanation on the macro definition > (which some IDEs even show when hovering on its usage, which could > partially address > the latter

[PATCH v3 03/28] hw/xen: select kernel mode for per-vCPU event channel upcall vector

2023-10-25 Thread David Woodhouse
From: David Woodhouse A guest which has configured the per-vCPU upcall vector may set the HVM_PARAM_CALLBACK_IRQ param to fairly much anything other than zero. For example, Linux v6.0+ after commit b1c3497e604 ("x86/xen: Add support for HVMOP_set_evtchn_upcall_vector") will just do this after

[PATCH v3 05/28] hw/xen: fix XenStore watch delivery to guest

2023-10-25 Thread David Woodhouse
From: David Woodhouse When fire_watch_cb() found the response buffer empty, it would call deliver_watch() to generate the XS_WATCH_EVENT message in the response buffer and send an event channel notification to the guest… without actually *copying* the response buffer into the ring. So there was

[PATCH v3 11/28] i386/xen: advertise XEN_HVM_CPUID_UPCALL_VECTOR in CPUID

2023-10-25 Thread David Woodhouse
From: David Woodhouse This will allow Linux guests (since v6.0) to use the per-vCPU upcall vector delivered as MSI through the local APIC. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/kvm.c | 4 1 file changed, 4 insertions(+) diff --git

[PATCH v3 13/28] hw/xen: automatically assign device index to block devices

2023-10-25 Thread David Woodhouse
From: David Woodhouse There's no need to force the user to assign a vdev. We can automatically assign one, starting at xvda and searching until we find the first disk name that's unused. This means we can now allow '-drive if=xen,file=xxx' to work without an explicit separate -driver argument,

[PATCH v3 24/28] net: add qemu_create_nic_bus_devices()

2023-10-25 Thread David Woodhouse
From: David Woodhouse This will instantiate any NICs which live on a given bus type. Each bus is allowed *one* substitution (for PCI it's virtio → virtio-net-pci, for Xen it's xen → xen-net-device; no point in overengineering it unless we actually want more). Signed-off-by: David Woodhouse ---

[PATCH v3 27/28] hw/xen: use qemu_create_nic_bus_devices() to instantiate Xen NICs

2023-10-25 Thread David Woodhouse
From: David Woodhouse When instantiating XenBus itself, for each NIC which is configured with either the model unspecified, or set to to "xen" or "xen-net-device", create a corresponding xen-net-device for it. Now we can launch emulated Xen guests with '-nic user', and this fixes the setup for

[PATCH v3 25/28] hw/pci: add pci_init_nic_devices(), pci_init_nic_in_slot()

2023-10-25 Thread David Woodhouse
From: David Woodhouse The loop over nd_table[] to add PCI NICs is repeated in quite a few places. Add a helper function to do it. Some platforms also try to instantiate a specific model in a specific slot, to match the real hardware. Add pci_init_nic_in_slot() for that purpose. Signed-off-by:

[PATCH v3 15/28] hw/xen: do not repeatedly try to create a failing backend device

2023-10-25 Thread David Woodhouse
From: David Woodhouse If xen_backend_device_create() fails to instantiate a device, the XenBus code will just keep trying over and over again each time the bus is re-enumerated, as long as the backend appears online and in XenbusStateInitialising. The only thing which prevents the XenBus code

[PATCH v3 19/28] hw/xen: update Xen PV NIC to XenDevice model

2023-10-25 Thread David Woodhouse
From: David Woodhouse This allows us to use Xen PV networking with emulated Xen guests, and to add them on the command line or hotplug. Signed-off-by: David Woodhouse --- hw/net/meson.build| 2 +- hw/net/trace-events | 11 + hw/net/xen_nic.c | 484

[PATCH v3 08/28] i386/xen: Ignore VCPU_SSHOTTMR_future flag in set_singleshot_timer()

2023-10-25 Thread David Woodhouse
From: David Woodhouse Upstream Xen now ignores this flag¹, since the only guest kernel ever to use it was buggy. ¹ https://xenbits.xen.org/gitweb/?p=xen.git;a=commitdiff;h=19c6cbd909 Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 20

[PATCH v3 22/28] net: add qemu_{configure,create}_nic_device(), qemu_find_nic_info()

2023-10-25 Thread David Woodhouse
From: David Woodhouse Most code which directly accesses nd_table[] and nb_nics uses them for one of two things. Either "I have created a NIC device and I'd like a configuration for it", or "I will create a NIC device *if* there is a configuration for it". With some variants on the theme around

[PATCH v3 20/28] net: do not delete nics in net_cleanup()

2023-10-25 Thread David Woodhouse
From: David Woodhouse In net_cleanup() we only need to delete the netdevs, as those may have state which outlives Qemu when it exits, and thus may actually need to be cleaned up on exit. The nics, on the other hand, are owned by the device which created them. Most devices don't bother to clean

[PATCH v3 16/28] hw/xen: update Xen console to XenDevice model

2023-10-25 Thread David Woodhouse
From: David Woodhouse This allows (non-primary) console devices to be created on the command line and hotplugged. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/char/trace-events| 8 + hw/char/xen_console.c | 532 +++-

[PATCH v3 09/28] hw/xen: Clean up event channel 'type_val' handling to use union

2023-10-25 Thread David Woodhouse
From: David Woodhouse A previous implementation of this stuff used a 64-bit field for all of the port information (vcpu/type/type_val) and did atomic exchanges on them. When I implemented that in Qemu I regretted my life choices and just kept it simple with locking instead. So there's no need

[PATCH v3 02/28] i386/xen: fix per-vCPU upcall vector for Xen emulation

2023-10-25 Thread David Woodhouse
From: David Woodhouse The per-vCPU upcall vector support had three problems. Firstly it was using the wrong hypercall argument and would always return -EFAULT when the guest tried to set it up. Secondly it was using the wrong ioctl() to pass the vector to the kernel and thus the *kernel* would

[PATCH v3 18/28] hw/xen: only remove peers of PCI NICs on unplug

2023-10-25 Thread David Woodhouse
From: David Woodhouse When the Xen guest asks to unplug *emulated* NICs, it's kind of unhelpful also to unplug the peer of the *Xen* PV NIC. Signed-off-by: David Woodhouse --- hw/i386/xen/xen_platform.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git

[PATCH v3 04/28] hw/xen: don't clear map_track[] in xen_gnttab_reset()

2023-10-25 Thread David Woodhouse
From: David Woodhouse The refcounts actually correspond to 'active_ref' structures stored in a GHashTable per "user" on the backend side (mostly, per XenDevice). If we zero map_track[] on reset, then when the backend drivers get torn down and release their mapping we hit the

[PATCH v3 10/28] include: update Xen public headers to Xen 4.17.2 release

2023-10-25 Thread David Woodhouse
From: David Woodhouse ... in order to advertise the XEN_HVM_CPUID_UPCALL_VECTOR feature, which will come in a subsequent commit. Signed-off-by: David Woodhouse Acked-by: Paul Durrant --- hw/i386/kvm/xen_xenstore.c| 2 +- include/hw/xen/interface/arch-arm.h | 37

[PATCH v3 12/28] hw/xen: populate store frontend nodes with XenStore PFN/port

2023-10-25 Thread David Woodhouse
From: David Woodhouse This is kind of redundant since without being able to get these through some other method (HVMOP_get_param) the guest wouldn't be able to access XenStore in order to find them. Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- hw/i386/kvm/xen_xenstore.c | 11

[PATCH v3 00/28] Get Xen PV shim running in QEMU, add net & console

2023-10-25 Thread David Woodhouse
Round up a handful of outstanding fixes, add console support and fix up per-vCPU upcall vector support (which was previously untested), and that allows us to boot PV guests using the Xen "PV shim". Having fixed up the per-vCPU upcall vector support, pull in slightly newer Xen headers just for

[PATCH v3 23/28] net: report list of available models according to platform

2023-10-25 Thread David Woodhouse
From: David Woodhouse By noting the models for which a configuration was requested, we can give the user an accurate list of which NIC models were actually available on the platform/configuration that was otherwise chosen. Signed-off-by: David Woodhouse --- net/net.c | 94

[PATCH v3 01/28] i386/xen: Don't advertise XENFEAT_supervisor_mode_kernel

2023-10-25 Thread David Woodhouse
From: David Woodhouse This confuses lscpu into thinking it's running in PVH mode. Fixes: bedcc139248 ("i386/xen: implement HYPERVISOR_xen_version") Signed-off-by: David Woodhouse Reviewed-by: Paul Durrant --- target/i386/kvm/xen-emu.c | 1 - 1 file changed, 1 deletion(-) diff --git

[PATCH v3 07/28] hw/xen: use correct default protocol for xen-block on x86

2023-10-25 Thread David Woodhouse
From: David Woodhouse Even on x86_64 the default protocol is the x86-32 one if the guest doesn't specifically ask for x86-64. Fixes: b6af8926fb85 ("xen: add implementations of xen-block connect and disconnect functions...") Signed-off-by: David Woodhouse --- hw/block/xen-block.c | 6 +-

[PATCH v3 21/28] xen-platform: unplug AHCI disks

2023-10-25 Thread David Woodhouse
From: David Woodhouse To support Xen guests using the Q35 chipset, the unplug protocol needs to also remove AHCI disks. Make pci_xen_ide_unplug() more generic, iterating over the children of the PCI device and destroying the "ide-hd" devices. That works the same for both AHCI and IDE, as does

[PATCH v3 17/28] hw/xen: add support for Xen primary console in emulated mode

2023-10-25 Thread David Woodhouse
From: David Woodhouse The primary console is special because the toolstack maps a page into the guest for its ring, and also allocates the guest-side event channel. The guest's grant table is even primed to export that page using a known grant ref#. Add support for all that in emulated mode, so

[PATCH v3 26/28] hw/i386/pc: use qemu_get_nic_info() and pci_init_nic_devices()

2023-10-25 Thread David Woodhouse
From: David Woodhouse Eliminate direct access to nd_table[] and nb_nics by processing the the ISA NICs first and then calling pci_init_nic_devices() for the test. It's important to do this *before* the subsequent patch which registers the Xen PV network devices, because the code being remove

  1   2   >