Re: [PATCH] cmdline: document "extra_guest_irqs" upper bound

2023-04-04 Thread Andrew Cooper
On 04/04/2023 7:46 am, Jan Beulich wrote: > PHYSDEVOP_pirq_eoi_gmfn_v accepting just a single GFN implies that no > more than 32k pIRQ-s can be used by a domain. Document this upper bound. > > Signed-off-by: Jan Beulich Acked-by: Andrew Cooper > --- > I was uncertain about also introducing a bo

Re: [PATCH v4 09/12] tools: add physinfo arch_capabilities handling for Arm

2023-04-04 Thread Luca Fancellu
Hi Anthony, Thank you for your review > On 30 Mar 2023, at 17:49, Anthony PERARD wrote: > > On Mon, Mar 27, 2023 at 11:59:41AM +0100, Luca Fancellu wrote: >> --- >> tools/golang/xenlight/helpers.gen.go| 2 ++ >> tools/golang/xenlight/types.gen.go | 1 + >> tools/include/arm-arch-capabi

Re: [PATCH] cmdline: document "extra_guest_irqs" upper bound

2023-04-04 Thread Jan Beulich
On 04.04.2023 09:09, Andrew Cooper wrote: > On 04/04/2023 7:46 am, Jan Beulich wrote: >> PHYSDEVOP_pirq_eoi_gmfn_v accepting just a single GFN implies that no >> more than 32k pIRQ-s can be used by a domain. Document this upper bound. >> >> Signed-off-by: Jan Beulich > > Acked-by: Andrew Cooper

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

2023-04-04 Thread Oleksii
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 clarif

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

2023-04-04 Thread Jan Beulich
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 include debugging info > - resu

Re: [PATCH 13/13] aio: remove aio_disable_external() API

2023-04-04 Thread Juan Quintela
Stefan Hajnoczi wrote: > All callers now pass is_external=false to aio_set_fd_handler() and > aio_set_event_notifier(). The aio_disable_external() API that > temporarily disables fd handlers that were registered is_external=true > is therefore dead code. > > Remove aio_disable_external(), aio_enab

[PATCH v2] x86/PV: ignore PAE_MODE ELF note for 64-bit Dom0

2023-04-04 Thread Jan Beulich
Besides a printk() the main effect is slight corruption of the start info magic: While that's meant to be xen-3.0-x86_64, it wrongly ended up as xen-3.0-x86_64p. Note that no known users exist that would have developed a dependency on the bogus magic string. In particular Linux, NetBSD, and mini-o

[PATCH] cmdline: document and enforce "extra_guest_irqs" upper bounds

2023-04-04 Thread Jan Beulich
PHYSDEVOP_pirq_eoi_gmfn_v accepting just a single GFN implies that no more than 32k pIRQ-s can be used by a domain on x86. Document this upper bound. To also enforce the limit, (ab)use both arch_hwdom_irqs() (changing its parameter type) and setup_system_domains(). This is primarily to avoid expos

Re: [PATCH 13/13] aio: remove aio_disable_external() API

2023-04-04 Thread Dr. David Alan Gilbert
* Juan Quintela (quint...@redhat.com) wrote: > Stefan Hajnoczi wrote: > > All callers now pass is_external=false to aio_set_fd_handler() and > > aio_set_event_notifier(). The aio_disable_external() API that > > temporarily disables fd handlers that were registered is_external=true > > is therefore

Re: [RFC PATCH] x86/p2m-pt: do type recalculations with p2m read lock

2023-04-04 Thread Roger Pau Monné
On Mon, Apr 03, 2023 at 06:07:26PM +0200, Jan Beulich wrote: > On 03.04.2023 17:38, Roger Pau Monné wrote: > > On Mon, Apr 03, 2023 at 05:32:39PM +0200, Jan Beulich wrote: > >> On 03.04.2023 12:14, Roger Pau Monne wrote: > >>> Global p2m type recalculations (as triggered by logdirty) can create > >

[PATCH v2 00/15] x86: Merge cpuid and msr policy objects

2023-04-04 Thread Andrew Cooper
This is in order to be able to put MSR_ARCH_CAPS in a featureset. In hindsight it was a mistake separating CPUID and read-only MSR data into separate structs. Patches 1-8 were posted previously and have had the feedback addressed. Patches 9-15 are the result of splitting the older RFC patch 9 apa

[PATCH v2 01/15] x86: Rename struct cpu_policy to struct old_cpuid_policy

2023-04-04 Thread Andrew Cooper
We want to merge struct cpuid_policy and struct msr_policy together, and the result wants to be called struct cpu_policy. The current struct cpu_policy, being a pair of pointers, isn't terribly useful. Rename the type to struct old_cpu_policy, but it will disappear entirely once the merge is comp

[PATCH v2 02/15] x86: Rename {domctl,sysctl}.cpu_policy.{cpuid,msr}_policy fields

2023-04-04 Thread Andrew Cooper
These weren't great names to begin with, and using {leaves,msrs} matches up better with the existing nr_{leaves,msr} parameters anyway. Furthermore, by renaming these fields we can get away with using some #define trickery to avoid the struct {cpuid,msr}_policy merge needing to happen in a single

[PATCH v2 08/15] x86: Drop struct old_cpu_policy

2023-04-04 Thread Andrew Cooper
With all the complicated callers of x86_cpu_policies_are_compatible() updated to use a single cpu_policy object, we can drop the final user of struct old_cpu_policy. Update x86_cpu_policies_are_compatible() to take (new) cpu_policy pointers, reducing the amount of internal pointer chasing, and upd

[PATCH v2 09/15] x86: Out-of-inline the policy<->featureset convertors

2023-04-04 Thread Andrew Cooper
These are already getting over-large for being inline functions, and are only going to grow more over time. Out of line them, yielding the following net delta from bloat-o-meter: add/remove: 2/0 grow/shrink: 0/4 up/down: 276/-1877 (-1601) Switch to the newer cpu_policy terminology while doing

[PATCH v2 06/15] x86: Merge a domain's {cpuid,msr} policy objects

2023-04-04 Thread Andrew Cooper
Right now, they're the same underlying type, containing disjoint information. Drop the d->arch.msr pointer, and union d->arch.cpuid to give it a second name of cpu_policy in the interim. Merge init_domain_{cpuid,msr}_policy() into a single init_domain_cpu_policy(), moving the implementation into

[PATCH v2 07/15] x86: Merge xc_cpu_policy's cpuid and msr objects

2023-04-04 Thread Andrew Cooper
Right now, they're the same underlying type, containing disjoint information. Use a single object instead. Also take the opportunity to rename 'entries' to 'msrs' which is more descriptive, and more in line with nr_msrs being the count of MSR entries in the API. test-tsx uses xg_private.h to acc

[PATCH v2 05/15] x86: Merge the system {cpuid,msr} policy objects

2023-04-04 Thread Andrew Cooper
Right now, they're the same underlying type, containing disjoint information. Introduce a new cpu-policy.{h,c} to be the new location for all policy handling logic. Place the combined objects in __ro_after_init, which is new since the original logic was written. As we're trying to phase out the

[PATCH v2 04/15] x86: Merge struct msr_policy into struct cpu_policy

2023-04-04 Thread Andrew Cooper
As with the cpuid side, use a temporary define to make struct msr_policy still work. Note, this means that domains now have two separate struct cpu_policy allocations with disjoint information, and system policies are in a similar position, as well as xc_cpu_policy objects in libxenguest. All of

[PATCH v2 03/15] x86: Rename struct cpuid_policy to struct cpu_policy

2023-04-04 Thread Andrew Cooper
Also merge lib/x86/cpuid.h entirely into lib/x86/cpu-policy.h Use a temporary define to make struct cpuid_policy still work. There's one forward declaration of struct cpuid_policy in tools/tests/x86_emulator/x86-emulate.h that isn't covered by the define, and it's easier to rename that now than t

Re: [PATCH 08/13] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore

2023-04-04 Thread David Woodhouse
On Mon, 2023-04-03 at 14:29 -0400, Stefan Hajnoczi wrote: > There is no need to suspend activity between aio_disable_external() and > aio_enable_external(), which is mainly used for the block layer's drain > operation. > > This is part of ongoing work to remove the aio_disable_external() API. > >

[PATCH v2 11/15] x86/boot: Merge CPUID policy initialisation logic into cpu-policy.c

2023-04-04 Thread Andrew Cooper
Switch to the newer cpu_policy nomenclature. Do some easy cleanup of includes. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * New --- xen/arch/x86/cpu-policy.c | 752 xen/arch/x86/cpuid.c

[PATCH v2 12/15] x86/emul: Switch x86_emulate_ctxt to cpu_policy

2023-04-04 Thread Andrew Cooper
As with struct domain, retain cpuid as a valid alias for local code clarity. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * Retain cpuid compatibility alias. * Split out of RFC patch. --- tools/fuzz/x86_instruction_emulator/fuzz-emul.c | 2 +- tools/

[PATCH v2 10/15] x86/boot: Move MSR policy initialisation logic into cpu-policy.c

2023-04-04 Thread Andrew Cooper
Switch to the newer cpu_policy nomenclature. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * New --- xen/arch/x86/cpu-policy.c | 84 +++ xen/arch/x86/include/asm/cpu-policy.h | 3 + xen/arch/x8

[PATCH v2 15/15] x86: Remove temporary {cpuid,msr}_policy defines

2023-04-04 Thread Andrew Cooper
With all code areas updated, drop the temporary defines and adjust all remaining users. No practical change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * Split out of RFC patch --- xen/arch/x86/cpu/mcheck/mce_intel.c| 2 +- xen/arch/x86/cpuid.

[PATCH v2 13/15] tools/fuzz: Rework afl-policy-fuzzer

2023-04-04 Thread Andrew Cooper
With cpuid_policy and msr_policy merged to form cpu_policy, merge the respective fuzzing logic. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * New --- tools/fuzz/cpu-policy/afl-policy-fuzzer.c | 57 --- 1 file changed, 20 insertion

[PATCH v2 14/15] libx86: Update library API for cpu_policy

2023-04-04 Thread Andrew Cooper
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 --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu v2: * New --- tools/fuzz/cpu-policy/afl-poli

Re: [PATCH v2] x86/PV: ignore PAE_MODE ELF note for 64-bit Dom0

2023-04-04 Thread Roger Pau Monné
On Tue, Apr 04, 2023 at 11:19:08AM +0200, Jan Beulich wrote: > Besides a printk() the main effect is slight corruption of the start > info magic: While that's meant to be xen-3.0-x86_64, it wrongly ended > up as xen-3.0-x86_64p. > > Note that no known users exist that would have developed a depend

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

2023-04-04 Thread Roger Pau Monné
On Wed, Feb 15, 2023 at 03:54:11PM +0100, 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-bit hypervisor: The "extended > CR3" format has to be used there as well, to fit the address in the only > 32-bit wide reg

[linux-linus test] 180131: regressions - trouble: fail/pass/starved

2023-04-04 Thread osstest service owner
flight 180131 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/180131/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: build-arm64-pvops 6 kernel-build fail in 180130 REGR. vs. 180116 Tests which are fai

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

2023-04-04 Thread Jan Beulich
On 04.04.2023 12:12, Roger Pau Monné wrote: > On Wed, Feb 15, 2023 at 03:54:11PM +0100, 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-bit hypervisor: The "extended >> CR3" format has to be used there as well,

Re: [PATCH] cmdline: document and enforce "extra_guest_irqs" upper bounds

2023-04-04 Thread Andrew Cooper
On 04/04/2023 10:20 am, Jan Beulich wrote: > PHYSDEVOP_pirq_eoi_gmfn_v accepting just a single GFN implies that no > more than 32k pIRQ-s can be used by a domain on x86. Document this upper > bound. > > To also enforce the limit, (ab)use both arch_hwdom_irqs() (changing its > parameter type) and se

Re: [PATCH v2] x86/PV: ignore PAE_MODE ELF note for 64-bit Dom0

2023-04-04 Thread Andrew Cooper
On 04/04/2023 10:19 am, Jan Beulich wrote: > Besides a printk() the main effect is slight corruption of the start > info magic: While that's meant to be xen-3.0-x86_64, it wrongly ended > up as xen-3.0-x86_64p. > > Note that no known users exist that would have developed a dependency on > the bogus

Re: [XEN v4 11/11] xen/arm: p2m: Enable support for 32bit IPA for ARM_32

2023-04-04 Thread Ayan Kumar Halder
On 30/03/2023 22:45, Julien Grall wrote: CAUTION: This message has originated from an External Source. Please use proper judgment and caution when opening attachments, clicking links, or responding to this email. Hi Ayan, Hi Julien, I need some clarifications. On 21/03/2023 14:03, Aya

Re: [PATCH] cmdline: document and enforce "extra_guest_irqs" upper bounds

2023-04-04 Thread Jan Beulich
On 04.04.2023 12:34, Andrew Cooper wrote: > On 04/04/2023 10:20 am, Jan Beulich wrote: >> --- a/xen/arch/arm/include/asm/irq.h >> +++ b/xen/arch/arm/include/asm/irq.h >> @@ -52,7 +52,7 @@ struct arch_irq_desc { >> >> extern const unsigned int nr_irqs; >> #define nr_static_irqs NR_IRQS >> -#defi

[PATCH] x86emul: correct AVX512VL+VPCLMUL test descriptions

2023-04-04 Thread Jan Beulich
The stride values (based on 32-bit element size) were wrong for these two test, yielding misleading output (especially when comparing with the test variants also involving AVX512-VBMI2). Also insert a missing blank on a nearby, related line. Signed-off-by: Jan Beulich --- a/tools/tests/x86_emul

Re: [PATCH] x86emul: correct AVX512VL+VPCLMUL test descriptions

2023-04-04 Thread Andrew Cooper
On 04/04/2023 11:48 am, Jan Beulich wrote: > The stride values (based on 32-bit element size) were wrong for these > two test, yielding misleading output (especially when comparing with the > test variants also involving AVX512-VBMI2). > > Also insert a missing blank on a nearby, related line. > >

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

2023-04-04 Thread Roger Pau Monné
On Tue, Apr 04, 2023 at 12:31:31PM +0200, Jan Beulich wrote: > On 04.04.2023 12:12, Roger Pau Monné wrote: > > On Wed, Feb 15, 2023 at 03:54:11PM +0100, 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-bit h

Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-04 Thread Stefan Hajnoczi
On Mon, Apr 03, 2023 at 10:47:11PM +0200, Philippe Mathieu-Daudé wrote: > On 3/4/23 20:29, Stefan Hajnoczi wrote: > > Only report a transport reset event to the guest after the SCSIDevice > > has been unrealized by qdev_simple_device_unplug_cb(). > > > > qdev_simple_device_unplug_cb() sets the SCS

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

2023-04-04 Thread Andrew Cooper
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-bit hypervisor: Is this really true?  Even when looking at Xen 4.2, 32bit guests are required to pass a full 4k page, not a 32b quad. Which

Re: [PATCH] x86/pci: Correct ECS handling with CF8/CFC emulation

2023-04-04 Thread Andrew Cooper
On 03/04/2023 2:26 pm, Roger Pau Monné wrote: > On Mon, Apr 03, 2023 at 11:16:52AM +0100, Andrew Cooper wrote: >> On 03/04/2023 9:57 am, Roger Pau Monné wrote: >> (Quick tangent...  Our PCI handling is currently very dumb.  >> pci_mmcfg_read() returns its value by pointer but the callers never >> c

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

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

Re: [PATCH 02/13] virtio-scsi: stop using aio_disable_external() during unplug

2023-04-04 Thread Paolo Bonzini
On 4/3/23 20:29, Stefan Hajnoczi wrote: This patch is part of an effort to remove the aio_disable_external() API because it does not fit in a multi-queue block layer world where many AioContexts may be submitting requests to the same disk. The SCSI emulation code is already in good shape to stop

Re: [PATCH 04/13] util/vhost-user-server: rename refcount to in_flight counter

2023-04-04 Thread Paolo Bonzini
On 4/3/23 20:29, Stefan Hajnoczi wrote: The VuServer object has a refcount field and ref/unref APIs. The name is confusing because it's actually an in-flight request counter instead of a refcount. Normally a refcount destroys the object upon reaching zero. The VuServer counter is used to wake up

Re: [PATCH 00/13] block: remove aio_disable_external() API

2023-04-04 Thread Paolo Bonzini
On 4/3/23 20:29, Stefan Hajnoczi wrote: The aio_disable_external() API temporarily suspends file descriptor monitoring in the event loop. The block layer uses this to prevent new I/O requests being submitted from the guest and elsewhere between bdrv_drained_begin() and bdrv_drained_end(). While

Re: [PATCH 11/13] block/fuse: take AioContext lock around blk_exp_ref/unref()

2023-04-04 Thread Paolo Bonzini
On 4/3/23 20:30, Stefan Hajnoczi wrote: These functions must be called with the AioContext acquired: /* Callers must hold exp->ctx lock */ void blk_exp_ref(BlockExport *exp) ... /* Callers must hold exp->ctx lock */ void blk_exp_unref(BlockExport *exp) Signed-off-by: Stefan Hajno

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

2023-04-04 Thread Luca Fancellu
Hi Anthony, Thanks for your review > 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 100644 >> --- a/docs/man/xl.cfg.5.pod

Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-04 Thread Paolo Bonzini
On 4/4/23 15:06, Stefan Hajnoczi wrote: Would this be more useful as a qdev_is_realized() helper? Yes. There are no other users, but I think a helper makes sense. Agreed; anyway, Reviewed-by: Paolo Bonzini Paolo

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

2023-04-04 Thread Anthony PERARD
On Fri, Mar 24, 2023 at 08:37:06PM +, Andrew Cooper wrote: > On 24/03/2023 8:28 pm, Andrew Cooper wrote: > > On 24/03/2023 6:58 pm, osstest service owner wrote: > >> flight 179929 xen-unstable-smoke real [real] > >> http://logs.test-lab.xenproject.org/osstest/logs/179929/ > >> > >> Regressions

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

2023-04-04 Thread Jan Beulich
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-bit hypervisor: > > Is this really true?  Even when looking at Xen 4.2, 32bit guests are > req

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

2023-04-04 Thread Jan Beulich
On 04.04.2023 13:41, Roger Pau Monné wrote: > On Tue, Apr 04, 2023 at 12:31:31PM +0200, Jan Beulich wrote: >> On 04.04.2023 12:12, Roger Pau Monné wrote: >>> On Wed, Feb 15, 2023 at 03:54:11PM +0100, Jan Beulich wrote: While the PAE-extended-CR3 VM assist is a 32-bit only concept, it still >>>

Re: [PATCH 01/13] virtio-scsi: avoid race between unplug and transport event

2023-04-04 Thread Michael S. Tsirkin
On Mon, Apr 03, 2023 at 02:29:52PM -0400, Stefan Hajnoczi wrote: > Only report a transport reset event to the guest after the SCSIDevice > has been unrealized by qdev_simple_device_unplug_cb(). > > qdev_simple_device_unplug_cb() sets the SCSIDevice's qdev.realized field > to false so that scsi_dev

[PATCH 0/9] x86emul: misc additions

2023-04-04 Thread Jan Beulich
This series adds support for a number of more or less recently announced ISA extensions. Plus a little bit of (more or less related) cleanup. The series interacts mildly (and only contextually) with the AVX512-FP16 one. Note that patch 1 was previously posted standalone; the posting here is unchang

[PATCH 1/9] x86emul: support LKGS

2023-04-04 Thread Jan Beulich
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 testcase, also add a SWAPGS one. In order to not affect the behavior of pre-existing tests, install write

[PATCH 2/9] x86emul: support WRMSRNS

2023-04-04 Thread Jan Beulich
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. As there's no other infrastructure needed beyond permitting the insn for PV privileged-op emulation (in particular no separate new VMEXIT) we

[PATCH 3/9] x86emul: drop regs field from emulator state structure

2023-04-04 Thread Jan Beulich
For an unclear reason 0552a8cfda43 ("x86emul: track only rIP in emulator state") converted the original struct cpu_user_regs instance to a pointer, rather than dropping the field altogether: The pointer merely aliases the one in the context structure. Signed-off-by: Jan Beulich --- a/xen/arch/x8

[PATCH 4/9] x86emul: support CMPccXADD

2023-04-04 Thread Jan Beulich
Unconditionally wire this through the ->rmw() hook. Since x86_emul_rmw() now wants to construct and invoke a stub, make stub_exn available to it via a new field in the emulator state structure. Signed-off-by: Jan Beulich --- # SDE: -grr or -srf --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/li

[PATCH 5/9] x86emul: re-use new stub_exn field in state structure

2023-04-04 Thread Jan Beulich
This can now also be used to reduce the number of parameters x86emul_fpu() needs to take. Signed-off-by: Jan Beulich --- We could of course set the struct field once early in x86_emulate(), but for now I think we're better off leaving it as NULL where not actually needed. --- a/xen/arch/x86/x86_

[PATCH 6/9] x86emul: support AVX-IFMA insns

2023-04-04 Thread Jan Beulich
As in a few cases before (in particular: AVX512_IFMA), since the insns here and in particular their memory access patterns follow the usual scheme, I didn't think it was necessary to add a contrived test specifically for them. Signed-off-by: Jan Beulich --- a/tools/libs/light/libxl_cpuid.c +++ b

[PATCH 7/9] x86emul: support AVX-VNNI-INT8

2023-04-04 Thread Jan Beulich
These are close relatives of the AVX-VNNI ISA extension. Since the insns here and in particular their memory access patterns follow the usual scheme (and especially the byte variants of AVX-VNNI), I didn't think it was necessary to add a contrived test specifically for them. While making the addit

[PATCH 8/9] x86emul: support AVX-NE-CONVERT insns

2023-04-04 Thread Jan Beulich
Matching what was done earlier, explicit tests are added only for irregular insn / memory access patterns. Signed-off-by: Jan Beulich --- SDE: -grr or -srf --- a/tools/libs/light/libxl_cpuid.c +++ b/tools/libs/light/libxl_cpuid.c @@ -242,6 +242,7 @@ int libxl_cpuid_parse_config(libxl_cpuid

[PATCH 9/9] x86emul+VMX: support {RD,WR}MSRLIST

2023-04-04 Thread Jan Beulich
These are "compound" instructions to issue a series of RDMSR / WRMSR respectively. In the emulator we can therefore implement them by using the existing msr_{read,write}() hooks. The memory accesses utilize that the HVM ->read() / ->write() hooks are already linear-address (x86_seg_none) aware (by

Re: [PATCH 9/9] x86emul+VMX: support {RD,WR}MSRLIST

2023-04-04 Thread Jan Beulich
On 04.04.2023 16:55, Jan Beulich wrote: > These are "compound" instructions to issue a series of RDMSR / WRMSR > respectively. In the emulator we can therefore implement them by using > the existing msr_{read,write}() hooks. The memory accesses utilize that > the HVM ->read() / ->write() hooks are

Re: [PATCH v2 09/15] x86: Out-of-inline the policy<->featureset convertors

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > These are already getting over-large for being inline functions, and are only > going to grow more over time. Out of line them, yielding the following net > delta from bloat-o-meter: > > add/remove: 2/0 grow/shrink: 0/4 up/down: 276/-1877 (-1601) > >

Re: [PATCH v2 10/15] x86/boot: Move MSR policy initialisation logic into cpu-policy.c

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > Switch to the newer cpu_policy nomenclature. > > No practical change. > > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich

Re: [PATCH] x86/pci: Correct ECS handling with CF8/CFC emulation

2023-04-04 Thread Roger Pau Monné
On Tue, Apr 04, 2023 at 02:27:36PM +0100, Andrew Cooper wrote: > On 03/04/2023 2:26 pm, Roger Pau Monné wrote: > > On Mon, Apr 03, 2023 at 11:16:52AM +0100, Andrew Cooper wrote: > >> On 03/04/2023 9:57 am, Roger Pau Monné wrote: > >> (Quick tangent...  Our PCI handling is currently very dumb.  > >>

Re: [PATCH v2 11/15] x86/boot: Merge CPUID policy initialisation logic into cpu-policy.c

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > Switch to the newer cpu_policy nomenclature. Do some easy cleanup of > includes. > > No practical change. > > Signed-off-by: Andrew Cooper > --- > CC: Jan Beulich > CC: Roger Pau Monné > CC: Wei Liu > > v2: > * New > --- > xen/arch/x86/cpu-polic

Re: [PATCH] x86/pci: Correct ECS handling with CF8/CFC emulation

2023-04-04 Thread Jan Beulich
On 04.04.2023 17:04, Roger Pau Monné wrote: > On Tue, Apr 04, 2023 at 02:27:36PM +0100, Andrew Cooper wrote: >> On 03/04/2023 2:26 pm, Roger Pau Monné wrote: >>> On Mon, Apr 03, 2023 at 11:16:52AM +0100, Andrew Cooper wrote: On 03/04/2023 9:57 am, Roger Pau Monné wrote: >> @@ -1104,6 +1092

Re: [PATCH v2 12/15] x86/emul: Switch x86_emulate_ctxt to cpu_policy

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > As with struct domain, retain cpuid as a valid alias for local code clarity. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [PATCH v2 13/15] tools/fuzz: Rework afl-policy-fuzzer

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > With cpuid_policy and msr_policy merged to form cpu_policy, merge the > respective fuzzing logic. > > Signed-off-by: Andrew Cooper Reviewed-by: Jan Beulich

Re: [PATCH v2 09/15] x86: Out-of-inline the policy<->featureset convertors

2023-04-04 Thread Andrew Cooper
On 04/04/2023 4:01 pm, Jan Beulich wrote: > On 04.04.2023 11:52, Andrew Cooper wrote: >> These are already getting over-large for being inline functions, and are only >> going to grow more over time. Out of line them, yielding the following net >> delta from bloat-o-meter: >> >> add/remove: 2/0

Re: [PATCH v2 14/15] libx86: Update library API for cpu_policy

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, 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. That'll then require passing in a callback function anyway, such that different environments can use dif

Re: [PATCH v2 14/15] libx86: Update library API for cpu_policy

2023-04-04 Thread Andrew Cooper
On 04/04/2023 4:34 pm, Jan Beulich wrote: > On 04.04.2023 11:52, 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. > That'll then require passing in a callback function anyw

Re: [PATCH v2 15/15] x86: Remove temporary {cpuid,msr}_policy defines

2023-04-04 Thread Jan Beulich
On 04.04.2023 11:52, Andrew Cooper wrote: > With all code areas updated, drop the temporary defines and adjust all > remaining users. > > No practical change. > > Signed-off-by: Andrew Cooper Acked-by: Jan Beulich

Re: [PATCH v2] xen/pvcalls: don't call bind_evtchn_to_irqhandler() under lock

2023-04-04 Thread Oleksandr Tyshchenko
On 03.04.23 12:27, Juergen Gross wrote: Hello Juergen > bind_evtchn_to_irqhandler() shouldn't be called under spinlock, as it > can sleep. > > This requires to move the calls of create_active() out of the locked > regions. This is no problem, as the worst which could happen would be > a spuri

Re: [PATCH v2 11/15] x86/boot: Merge CPUID policy initialisation logic into cpu-policy.c

2023-04-04 Thread Andrew Cooper
On 04/04/2023 4:16 pm, Jan Beulich wrote: > On 04.04.2023 11:52, Andrew Cooper wrote: >> Switch to the newer cpu_policy nomenclature. Do some easy cleanup of >> includes. >> >> No practical change. >> >> Signed-off-by: Andrew Cooper >> --- >> CC: Jan Beulich >> CC: Roger Pau Monné >> CC: Wei Li

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

2023-04-04 Thread Roger Pau Monné
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 04.04.2023 12:12, Roger Pau Monné wrote: > >>> On Wed, Feb 15, 2023 at 03:54:11PM +0100, Jan Beulich wrote: > Whil

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

2023-04-04 Thread Sergey Dyasli
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 libxenctrl. Signed-off-by: Sergey Dyasli --- v3 --> v4: -

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

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

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

2023-04-04 Thread Sergey Dyasli
As a wrapper for XENPF_get_cpu_version platform op. Signed-off-by: Sergey Dyasli --- v3 --> v4: - Replaced DECLARE_PLATFORM_OP - Removed NULL checks --- tools/include/xenctrl.h | 1 + tools/libs/ctrl/xc_misc.c | 17 + 2 files changed, 18 insertions(+) diff --git a/tools/inclu

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

2023-04-04 Thread Sergey Dyasli
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 ops. Example output: Intel: CPU signature

Re: [PATCH v2 1/3] efi: try to use the currently set GOP mode

2023-04-04 Thread Jan Beulich
On 31.03.2023 11:59, Roger Pau Monne wrote: > Modify efi_find_gop_mode() so that passing cols or rows as 0 is > interpreted as a request to attempt to keep the currently set mode, > and do so if the mode query for information is successful and the depth > is supported. > > Signed-off-by: Roger Pau

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

2023-04-04 Thread Sergey Dyasli
Posting v4 with addressed review comments. Changes from v3 are available in each patch. Sergey Dyasli (3): tools/xenctrl: add xc_get_cpu_version() x86/platform: introduce XENPF_get_ucode_revision tools/xen-ucode: print information about currently loaded ucode tools/include/xenctrl.h

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

2023-04-04 Thread Bjorn Helgaas
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 convert > users accordingly. > > Note, the amount of lines grew due to th

Re: [PATCH v2 11/15] x86/boot: Merge CPUID policy initialisation logic into cpu-policy.c

2023-04-04 Thread Jan Beulich
On 04.04.2023 17:45, Andrew Cooper wrote: > On 04/04/2023 4:16 pm, Jan Beulich wrote: >> On 04.04.2023 11:52, Andrew Cooper wrote: >>> @@ -20,10 +26,332 @@ struct cpu_policy __ro_after_init hvm_max_cpu_policy; >>> struct cpu_policy __ro_after_init hvm_def_cpu_policy; >>> #endif >>> >>> +const u

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

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

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

2023-04-04 Thread Andrew Cooper
On 04/04/2023 2:51 pm, Anthony PERARD wrote: > On Fri, Mar 24, 2023 at 08:37:06PM +, Andrew Cooper wrote: >> On 24/03/2023 8:28 pm, Andrew Cooper wrote: >>> On 24/03/2023 6:58 pm, osstest service owner wrote: flight 179929 xen-unstable-smoke real [real] http://logs.test-lab.xenproject

Re: [PATCH v3 1/3] xen/riscv: introduce setup_initial_pages

2023-04-04 Thread Oleksii
Hi Julien, On Wed, 2023-03-29 at 14:06 +0200, Jan Beulich wrote: > > > > +void __init setup_initial_pagetables(void) > > > > +{ > > > > +    struct mmu_desc mmu_desc = { 0, 0, NULL, 0 }; > > > > + > > > > +    /* > > > > + * Access to _{stard, end } is always PC-relative > > > > + * thereb

Re: [PATCH] tools/xendomains: Only save/restore/migrate if supported by xenlight

2023-04-04 Thread Anthony PERARD
On Wed, Mar 22, 2023 at 01:58:00PM +, Peter Hoyes wrote: > From: Peter Hoyes > > Saving, restoring and migrating domains are not currently supported on > arm and arm64 platforms, so xendomains prints the warning: > > An error occurred while saving domain: > command not implemented > > w

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

2023-04-04 Thread Roger Pau Monné
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 04.04.2023 12:12, Roger Pau Monné wrote: > > >

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

2023-04-04 Thread Oleksandr Tyshchenko
On 30.03.23 10:35, Viresh Kumar wrote: Hello Viresh The strings won't be an exact match, and 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. Signed-off-by: Viresh Kumar It feels to me

[ovmf test] 180138: all pass - PUSHED

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

Re: [PULL 13/27] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-04-04 Thread Peter Maydell
On Tue, 7 Mar 2023 at 18:27, David Woodhouse wrote: > > From: Paul Durrant > > Signed-off-by: Paul Durrant > Signed-off-by: David Woodhouse > Reviewed-by: Paul Durrant > --- Hi; Coverity points out a memory leak in this code (CID 1508098): > +static struct qemu_xs_handle *libxenstore_open(vo

Re: [PULL 13/27] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-04-04 Thread David Woodhouse
On Tue, 2023-04-04 at 18:35 +0100, Peter Maydell wrote: > On Tue, 7 Mar 2023 at 18:27, David Woodhouse > wrote: > > > > From: Paul Durrant > > > > Signed-off-by: Paul Durrant > > Signed-off-by: David Woodhouse > > Reviewed-by: Paul Durrant > > --- > > Hi; Coverity points out a memory leak i

Re: [PULL 13/27] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-04-04 Thread Peter Maydell
On Tue, 4 Apr 2023 at 18:45, David Woodhouse wrote: > > On Tue, 2023-04-04 at 18:35 +0100, Peter Maydell wrote: > > On Tue, 7 Mar 2023 at 18:27, David Woodhouse > > wrote: > > > > > > From: Paul Durrant > > > > > > Signed-off-by: Paul Durrant > > > Signed-off-by: David Woodhouse > > > Reviewed

Re: [PATCH] libxl: arm: Allow grant mappings for backends running on Dom0

2023-04-04 Thread Oleksandr Tyshchenko
On 30.03.23 11:43, Viresh Kumar wrote: Hello Viresh Currently, we add grant mapping related device tree properties if the backend domain is not Dom0. While Dom0 is privileged and can do foreign mapping for the entire guest memory, it is still okay for Dom0 to access guest's memory via grant

Re: [PULL 13/27] hw/xen: Add xenstore operations to allow redirection to internal emulation

2023-04-04 Thread David Woodhouse
On Tue, 2023-04-04 at 18:45 +0100, Peter Maydell wrote: > On Tue, 4 Apr 2023 at 18:45, David Woodhouse > wrote: > > > > On Tue, 2023-04-04 at 18:35 +0100, Peter Maydell wrote: > > > On Tue, 7 Mar 2023 at 18:27, David Woodhouse > > > > > > wrote: > > > > > > > > From: Paul Durrant > > > > > >

[PATCH] hw/xen: Fix memory leak in libxenstore_open() for Xen

2023-04-04 Thread David Woodhouse
From: David Woodhouse There was a superfluous allocation of the XS handle, leading to it being leaked on both the error path and the success path (where it gets allocated again). Spotted by Coverity (CID 1508098). Fixes: ba2a92db1ff6 ("hw/xen: Add xenstore operations to allow redirection to in

Re: [PATCH] hw/xen: Fix memory leak in libxenstore_open() for Xen

2023-04-04 Thread Peter Maydell
On Tue, 4 Apr 2023 at 19:25, David Woodhouse wrote: > > From: David Woodhouse > > There was a superfluous allocation of the XS handle, leading to it > being leaked on both the error path and the success path (where it gets > allocated again). > > Spotted by Coverity (CID 1508098). > > Fixes: ba2a

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

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

  1   2   >