Re: [PATCH v4 1/2] acpi: Make TPM version configurable.

2023-05-04 Thread Jan Beulich
On 04.05.2023 19:51, Jennifer Herbert wrote: > This patch makes the TPM version, for which the ACPI library probes, > configurable. > If acpi_config.tpm_verison is set to 1, it indicates that 1.2 (TCPA) should > be probed. > I have also added to hvmloader an option to allow setting this new confi

Re: [PATCH v1 3/6] iommu/arm: Introduce iommu_add_dt_pci_device API

2023-05-04 Thread Jan Beulich
On 04.05.2023 23:54, Stewart Hildebrand wrote: > On 5/2/23 03:44, Jan Beulich wrote: >> On 01.05.2023 22:03, Stewart Hildebrand wrote: >>> @@ -228,6 +229,9 @@ int iommu_release_dt_devices(struct domain *d); >>> * (IOMMU is not enabled/present or device is not connected to it). >>> */ >>>

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

2023-05-04 Thread Viresh Kumar
On 05-04-23, 05:12, Viresh Kumar wrote: > On 04-04-23, 21:16, Oleksandr Tyshchenko wrote: > > ok, probably makes sense > > While testing both foreign and grant mappings I stumbled upon another > related problem. How do I control the creation of iommu node from > guest configuration file, irrespect

Re: [PATCH] build: shorten macro references

2023-05-04 Thread Jan Beulich
On 04.05.2023 19:24, Andrew Cooper wrote: > On 04/05/2023 5:16 pm, Jan Beulich wrote: >> Presumably by copy-and-paste we've accumulated a number of instances of >> $(@D)/$(@F), which really is nothing else than $@. The split form only >> needs using when we want to e.g. insert a leading . at the be

Re: [PATCH v1] xen/sched/null: avoid crash after failed domU creation

2023-05-04 Thread Juergen Gross
On 01.05.23 22:30, Stewart Hildebrand wrote: When creating a domU, but the creation fails, there is a corner case that may lead to a crash in the null scheduler when running a debug build of Xen. (XEN) (XEN) Panic on CPU 0: (XEN) Assertion 'npc->unit == u

[linux-linus test] 180531: regressions - FAIL

2023-05-04 Thread osstest service owner
flight 180531 linux-linus real [real] http://logs.test-lab.xenproject.org/osstest/logs/180531/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-armhf-armhf-xl-credit1 8 xen-boot fail REGR. vs. 180278 build-arm64-pvops

Re: [PATCH RFC 16/43] x86-64: Use per-cpu stack canary if supported by compiler

2023-05-04 Thread Hou Wenlong
On Thu, May 04, 2023 at 12:31:59PM +0200, Juergen Gross wrote: > On 28.04.23 11:50, Hou Wenlong wrote: > >From: Brian Gerst > > > >From: Brian Gerst > > > >If the compiler supports it, use a standard per-cpu variable for the > >stack protector instead of the old fixed location. Keep the fixed >

[qemu-mainline test] 180530: tolerable FAIL - PUSHED

2023-05-04 Thread osstest service owner
flight 180530 qemu-mainline real [real] http://logs.test-lab.xenproject.org/osstest/logs/180530/ Failures :-/ but no regressions. Tests which did not succeed, but are not blocking: test-armhf-armhf-libvirt 16 saverestore-support-checkfail like 180522 test-amd64-amd64-xl-qemuu-win7-amd6

Re: [patch V2 34/38] x86/cpu/amd; Invoke detect_extended_topology_early() on boot CPU

2023-05-04 Thread Andrew Cooper
On 04/05/2023 8:02 pm, Thomas Gleixner wrote: > From: Thomas Gleixner > > The early detection stores the extended topology leaf number which is > required for parallel hotplug. > > Signed-off-by: Thomas Gleixner It occurs to me that this and the previous patch are stale given that we no longer l

Re: [PATCH v1 3/6] iommu/arm: Introduce iommu_add_dt_pci_device API

2023-05-04 Thread Stewart Hildebrand
On 5/2/23 03:44, Jan Beulich wrote: > On 01.05.2023 22:03, Stewart Hildebrand wrote: >> @@ -228,6 +229,9 @@ int iommu_release_dt_devices(struct domain *d); >> * (IOMMU is not enabled/present or device is not connected to it). >> */ >> int iommu_add_dt_device(struct dt_device_node *np); >>

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

2023-05-04 Thread Kevin Wolf
Am 04.05.2023 um 21:53 hat Stefan Hajnoczi geschrieben: > v5: > - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] > - Stash SCSIDevice id/lun values for VIRTIO_SCSI_T_TRANSPORT_RESET event > before unrealizing the SCSIDevice [Kevin] > - Keep vhost-user-blk export .detach(

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

2023-05-04 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > 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

Re: [PATCH v4 18/20] virtio-scsi: implement BlockDevOps->drained_begin()

2023-05-04 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > The virtio-scsi Host Bus Adapter provides access to devices on a SCSI > bus. Those SCSI devices typically have a BlockBackend. When the > BlockBackend enters a drained section, the SCSI device must temporarily > stop submitting new I/O reque

Re: [PATCH v4 17/20] virtio-blk: implement BlockDevOps->drained_begin()

2023-05-04 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > Detach ioeventfds during drained sections to stop I/O submission from > the guest. virtio-blk is no longer reliant on aio_disable_external() > after this patch. This will allow us to remove the > aio_disable_external() API once all other cod

[ovmf test] 180535: all pass - PUSHED

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

Re: [PATCH v4 16/20] virtio: make it possible to detach host notifier from any thread

2023-05-04 Thread Kevin Wolf
Am 25.04.2023 um 19:27 hat Stefan Hajnoczi geschrieben: > virtio_queue_aio_detach_host_notifier() does two things: > 1. It removes the fd handler from the event loop. > 2. It processes the virtqueue one last time. > > The first step can be peformed by any thread and without taking the > AioContext

[PATCH v5 13/21] hw/xen: do not set is_external=true on evtchn fds

2023-05-04 Thread Stefan Hajnoczi
is_external=true suspends fd handlers between aio_disable_external() and aio_enable_external(). The block layer's drain operation uses this mechanism to prevent new I/O from sneaking in between bdrv_drained_begin() and bdrv_drained_end(). The previous commit converted the xen-block device to use B

[PATCH v5 15/21] block/export: don't require AioContext lock around blk_exp_ref/unref()

2023-05-04 Thread Stefan Hajnoczi
The FUSE export calls blk_exp_ref/unref() without the AioContext lock. Instead of fixing the FUSE export, adjust blk_exp_ref/unref() so they work without the AioContext lock. This way it's less error-prone. Suggested-by: Paolo Bonzini Signed-off-by: Stefan Hajnoczi --- include/block/export.h

[PATCH v5 21/21] aio: remove aio_disable_external() API

2023-05-04 Thread Stefan Hajnoczi
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_enable_external(), and the is_external

[PATCH v5 17/21] virtio: make it possible to detach host notifier from any thread

2023-05-04 Thread Stefan Hajnoczi
virtio_queue_aio_detach_host_notifier() does two things: 1. It removes the fd handler from the event loop. 2. It processes the virtqueue one last time. The first step can be peformed by any thread and without taking the AioContext lock. The second step may need the AioContext lock (depending on t

[PATCH v5 12/21] xen-block: implement BlockDevOps->drained_begin()

2023-05-04 Thread Stefan Hajnoczi
Detach event channels during drained sections to stop I/O submission from the ring. xen-block is no longer reliant on aio_disable_external() after this patch. This will allow us to remove the aio_disable_external() API once all other code that relies on it is converted. Extend xen_device_set_event

[PATCH v5 19/21] virtio-scsi: implement BlockDevOps->drained_begin()

2023-05-04 Thread Stefan Hajnoczi
The virtio-scsi Host Bus Adapter provides access to devices on a SCSI bus. Those SCSI devices typically have a BlockBackend. When the BlockBackend enters a drained section, the SCSI device must temporarily stop submitting new I/O requests. Implement this behavior by temporarily stopping virtio-scs

[PATCH v5 18/21] virtio-blk: implement BlockDevOps->drained_begin()

2023-05-04 Thread Stefan Hajnoczi
Detach ioeventfds during drained sections to stop I/O submission from the guest. virtio-blk is no longer reliant on aio_disable_external() after this patch. This will allow us to remove the aio_disable_external() API once all other code that relies on it is converted. Take extra care to avoid atta

[PATCH v5 14/21] block/export: rewrite vduse-blk drain code

2023-05-04 Thread Stefan Hajnoczi
vduse_blk_detach_ctx() waits for in-flight requests using AIO_WAIT_WHILE(). This is not allowed according to a comment in bdrv_set_aio_context_commit(): /* * Take the old AioContex when detaching it from bs. * At this point, new_context lock is already acquired, and we are now * also ta

[PATCH v5 20/21] virtio: do not set is_external=true on host notifiers

2023-05-04 Thread Stefan Hajnoczi
Host notifiers can now use is_external=false since virtio-blk and virtio-scsi no longer rely on is_external=true for drained sections. Signed-off-by: Stefan Hajnoczi --- hw/virtio/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/virtio/virtio.c b/hw/virtio/vi

[PATCH v5 16/21] block/fuse: do not set is_external=true on FUSE fd

2023-05-04 Thread Stefan Hajnoczi
This is part of ongoing work to remove the aio_disable_external() API. Use BlockDevOps .drained_begin/end/poll() instead of aio_set_fd_handler(is_external=true). As a side-effect the FUSE export now follows AioContext changes like the other export types. Signed-off-by: Stefan Hajnoczi --- bloc

[PATCH v5 11/21] block: drain from main loop thread in bdrv_co_yield_to_drain()

2023-05-04 Thread Stefan Hajnoczi
For simplicity, always run BlockDevOps .drained_begin/end/poll() callbacks in the main loop thread. This makes it easier to implement the callbacks and avoids extra locks. Move the function pointer declarations from the I/O Code section to the Global State section for BlockDevOps, BdrvChildClass,

[PATCH v5 10/21] block: add blk_in_drain() API

2023-05-04 Thread Stefan Hajnoczi
The BlockBackend quiesce_counter is greater than zero during drained sections. Add an API to check whether the BlockBackend is in a drained section. The next patch will use this API. Signed-off-by: Stefan Hajnoczi --- include/sysemu/block-backend-global-state.h | 1 + block/block-backend.c

[PATCH v5 08/21] block/export: stop using is_external in vhost-user-blk server

2023-05-04 Thread Stefan Hajnoczi
vhost-user activity must be suspended during bdrv_drained_begin/end(). This prevents new requests from interfering with whatever is happening in the drained section. Previously this was done using aio_set_fd_handler()'s is_external argument. In a multi-queue block layer world the aio_disable_exter

[PATCH v5 09/21] hw/xen: do not use aio_set_fd_handler(is_external=true) in xen_xenstore

2023-05-04 Thread Stefan Hajnoczi
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. Reviewed-by: David Woodhouse Reviewed-by: Paul Durrant Signed-off-by:

[PATCH v5 07/21] block/export: wait for vhost-user-blk requests when draining

2023-05-04 Thread Stefan Hajnoczi
Each vhost-user-blk request runs in a coroutine. When the BlockBackend enters a drained section we need to enter a quiescent state. Currently any in-flight requests race with bdrv_drained_begin() because it is unaware of vhost-user-blk requests. When blk_co_preadv/pwritev()/etc returns it wakes th

[PATCH v5 06/21] util/vhost-user-server: rename refcount to in_flight counter

2023-05-04 Thread Stefan Hajnoczi
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 the vhost-user coroutine when there are n

[PATCH v5 04/21] virtio-scsi: avoid race between unplug and transport event

2023-05-04 Thread Stefan Hajnoczi
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_device_find/get() no longer see it. scsi_target_emulate_report_luns() also ne

[PATCH v5 05/21] virtio-scsi: stop using aio_disable_external() during unplug

2023-05-04 Thread Stefan Hajnoczi
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 using aio_disable_external(). It was only

[PATCH v5 03/21] hw/qdev: introduce qdev_is_realized() helper

2023-05-04 Thread Stefan Hajnoczi
Add a helper function to check whether the device is realized without requiring the Big QEMU Lock. The next patch adds a second caller. The goal is to avoid spreading DeviceState field accesses throughout the code. Suggested-by: Philippe Mathieu-Daudé Reviewed-by: Philippe Mathieu-Daudé Signed-o

[PATCH v5 00/21] block: remove aio_disable_external() API

2023-05-04 Thread Stefan Hajnoczi
v5: - Use atomic accesses for in_flight counter in vhost-user-server.c [Kevin] - Stash SCSIDevice id/lun values for VIRTIO_SCSI_T_TRANSPORT_RESET event before unrealizing the SCSIDevice [Kevin] - Keep vhost-user-blk export .detach() callback so ctx is set to NULL [Kevin] - Narrow BdrvChildClass a

[PATCH v5 02/21] block-backend: split blk_do_set_aio_context()

2023-05-04 Thread Stefan Hajnoczi
blk_set_aio_context() is not fully transactional because blk_do_set_aio_context() updates blk->ctx outside the transaction. Most of the time this goes unnoticed but a BlockDevOps.drained_end() callback that invokes blk_get_aio_context() fails assert(ctx == blk->ctx). This happens because blk->ctx i

[PATCH v5 01/21] block: Fix use after free in blockdev_mark_auto_del()

2023-05-04 Thread Stefan Hajnoczi
From: Kevin Wolf job_cancel_locked() drops the job list lock temporarily and it may call aio_poll(). We must assume that the list has changed after this call. Also, with unlucky timing, it can end up freeing the job during job_completed_txn_abort_locked(), making the job pointer invalid, too. Fo

[PATCH 3/6] x86/cpuid: Rename FSCAPINTS to X86_NR_FEAT

2023-05-04 Thread Andrew Cooper
The latter is more legible, and consistent with X86_NR_{CAPS,SYNTH,BUG} which already exist. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- xen/arch/x86/cpu-policy.c | 22 +++--- xen/arch/x86/cpu/common.

[PATCH 1/6] x86/cpu-policy: Drop build time cross-checks of featureset sizes

2023-05-04 Thread Andrew Cooper
These BUILD_BUG_ON()s exist to cover the curious absence of a diagnostic for code which looks like: uint32_t foo[1] = { 1, 2, 3 }; However, GCC 12 at least does now warn for this: foo.c:1:24: error: excess elements in array initializer [-Werror] 884 | uint32_t foo[1] = { 1, 2, 3 };

[PATCH 4/6] x86/cpu-policy: Split cpuid-consts.h out of cpu-policy.h

2023-05-04 Thread Andrew Cooper
In order to disentangle X86_NR_FEAT from FEATURESET_NR_ENTRIES, we need to adjust asm/cpufeatures.h's inclusion of cpuid-autogen.h, and including all of cpu-policy.h ends with cyclic dependences and a mess. Split the FEATURESET_* constants out into a new header. Signed-off-by: Andrew Cooper ---

[PATCH 5/6] x86/cpu-policy: Disentangle X86_NR_FEAT and FEATURESET_NR_ENTRIES

2023-05-04 Thread Andrew Cooper
When adding new words to a featureset, there is a reasonable amount of boilerplate and it is preforable to split the addition into multiple patches. GCC 12 spotted a real (transient) error which occurs when splitting additions like this. Right now, FEATURESET_NR_ENTRIES is dynamically generated f

[PATCH 0/6] x86: Fix transient build breakage with featureset additions

2023-05-04 Thread Andrew Cooper
See patch 5 for details. Patch 6 is just an example that demonstrates the fix working in practice. Andrew Cooper (6): x86/cpu-policy: Drop build time cross-checks of featureset sizes x86/cpuid: Rename NCAPINTS to X86_NR_CAPS x86/cpuid: Rename FSCAPINTS to X86_NR_FEAT x86/cpu-policy: Split

[PATCH 6/6] DO NOT APPLY: Example breakage

2023-05-04 Thread Andrew Cooper
Prior to disentangling X86_NR_FEAT from FEATURESET_NR_ENTRIES, GCC 12 correctly notices: lib/x86/cpuid.c: In function 'x86_cpu_policy_to_featureset': lib/x86/cpuid.c:82:7: error: array subscript 16 is outside array bounds of 'uint32_t[16]' {aka 'unsigned int[16]'} [-Werror=array-bounds=]

[PATCH 2/6] x86/cpuid: Rename NCAPINTS to X86_NR_CAPS

2023-05-04 Thread Andrew Cooper
The latter is more legible, and consistent with X86_NR_{SYNTH,BUG} which already exist. No functional change. Signed-off-by: Andrew Cooper --- CC: Jan Beulich CC: Roger Pau Monné CC: Wei Liu --- xen/arch/x86/alternative.c | 2 +- xen/arch/x86/cpu/common.c | 12 +

[xen-unstable test] 180528: tolerable FAIL - PUSHED

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

[patch V2 20/38] cpu/hotplug: Remove cpu_report_state() and related unused cruft

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner No more users. Signed-off-by: Thomas Gleixner --- include/linux/cpu.h |2 - kernel/smpboot.c| 90 2 files changed, 92 deletions(-) --- --- a/include/linux/cpu.h +++ b/include/linux/cpu.h @@ -184,8 +184,6 @@ v

[patch V2 18/38] cpu/hotplug: Add CPU state tracking and synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The CPU state tracking and synchronization mechanism in smpboot.c is completely independent of the hotplug code and all logic around it is implemented in architecture specific code. Except for the state reporting of the AP there is absolutely nothing architecture specific a

[patch V2 34/38] x86/cpu/amd; Invoke detect_extended_topology_early() on boot CPU

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The early detection stores the extended topology leaf number which is required for parallel hotplug. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/cpu/amd.c |2 ++ 1 file changed, 2 insertions(+) --- --- a/arch/x86/kernel/cpu/amd.c +++ b/arch/x86/kernel/cpu/amd.

[patch V2 23/38] csky/smp: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Cc: Guo Ren Cc: linux-c...@vger.kernel.org --- arch/csky/Kconfig |1 + arch/csky/include/asm/smp.h |2 +- arch/csk

[patch V2 30/38] x86/smpboot: Enable split CPU startup

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The x86 CPU bringup state currently does AP wake-up, wait for AP to respond and then release it for full bringup. It is safe to be split into a wake-up and and a separate wait+release state. Provide the required functions and enable the split CPU bringup, which prepares fo

[patch V2 36/38] x86/smpboot: Implement a bit spinlock to protect the realmode stack

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Parallel AP bringup requires that the APs can run fully parallel through the early startup code including the real mode trampoline. To prepare for this implement a bit-spinlock to serialize access to the real mode stack so that parallel upcoming APs are not going to corrupt

[patch V2 32/38] cpu/hotplug: Allow "parallel" bringup up to CPUHP_BP_KICK_AP_STATE

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner There is often significant latency in the early stages of CPU bringup, and time is wasted by waking each CPU (e.g. with SIPI/INIT/INIT on x86) and then waiting for it to respond before moving on to the next. Allow a platform to enable parallel setup which brings all to be o

[patch V2 26/38] riscv: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Acked-by: Palmer Dabbelt Cc: Paul Walmsley Cc: linux-ri...@lists.infradead.org --- arch/riscv/Kconfig |1 + arch/r

[patch V2 27/38] cpu/hotplug: Remove unused state functions

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner All users converted to the hotplug core mechanism. Signed-off-by: Thomas Gleixner --- include/linux/cpu.h |2 - kernel/smpboot.c| 75 2 files changed, 77 deletions(-) --- --- a/include/linux/cpu.h +++ b/inclu

[patch V2 22/38] arm64: smp: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Tested-by: Mark Rutland Cc: Catalin Marinas Cc: Will Deacon Cc: linux-arm-ker...@lists.infradead.org --- arch/arm64/Kconfig

[patch V2 24/38] MIPS: SMP_CPS: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. This unfortunately requires to add dead reporting to the non CPS platforms as CPS is the only user, but it allows an overall consolidation of this functionality. No functional change intended. Sign

[patch V2 21/38] ARM: smp: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Cc: Russell King Cc: Arnd Bergmann Cc: linux-arm-ker...@lists.infradead.org --- arch/arm/Kconfig |1 + arch/arm/inclu

[patch V2 16/38] x86/xen/smp_pv: Remove wait for CPU online

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Whether the control CPU runs in a wait loop or sleeps in the core code waiting for the online operation to complete makes no difference.

[patch V2 37/38] x86/smpboot: Support parallel startup of secondary CPUs

2023-05-04 Thread Thomas Gleixner
From: David Woodhouse In parallel startup mode the APs are kicked alive by the control CPU quickly after each other and run through the early startup code in parallel. The real-mode startup code is already serialized with a bit-spinlock to protect the real-mode stack. In parallel startup mode th

[patch V2 33/38] x86/topology: Store extended topology leaf information

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Save the extended topology leaf number if it exists and is valid in preparation of parallel CPU bringup. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/topology.h |1 + arch/x86/kernel/cpu/topology.c |3 +++ 2 files changed, 4 insertions(+) --- --- a/ar

[patch V2 35/38] x86/apic: Save the APIC virtual base address

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner For parallel CPU brinugp it's required to read the APIC ID in the low level startup code. The virtual APIC base address is a constant because its a fix-mapped address. Exposing that constant which is composed via macros to assembly code is non-trivial dues to header inclusio

[patch V2 29/38] cpu/hotplug: Provide a split up CPUHP_BRINGUP mechanism

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The bring up logic of a to be onlined CPU consists of several parts, which are considered to be a single hotplug state: 1) Control CPU issues the wake-up 2) To be onlined CPU starts up, does the minimal initialization, reports to be alive and waits for release int

[patch V2 31/38] x86/apic: Provide cpu_primary_thread mask

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Make the primary thread tracking CPU mask based in preparation for simpler handling of parallel bootup. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/apic.h |2 -- arch/x86/include/asm/topology.h | 19 +++ arch/x86/kernel/apic/apic.c

[patch V2 17/38] x86/xen/hvm: Get rid of DEAD_FROZEN handling

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner No point in this conditional voodoo. Un-initializing the lock mechanism is safe to be called unconditionally even if it was already invoked when the CPU died. Remove the invocation of xen_smp_intr_free() as that has been already cleaned up in xen_cpu_dead_hvm(). Signed-off

[patch V2 28/38] cpu/hotplug: Reset task stack state in _cpu_up()

2023-05-04 Thread Thomas Gleixner
From: David Woodhouse Commit dce1ca0525bf ("sched/scs: Reset task stack state in bringup_cpu()") ensured that the shadow call stack and KASAN poisoning were removed from a CPU's stack each time that CPU is brought up, not just once. This is not incorrect. However, with parallel bringup the idle

[patch V2 38/38] x86/smpboot/64: Implement arch_cpuhp_init_parallel_bringup() and enable it

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Implement the validation function which tells the core code whether parallel bringup is possible. The only condition for now is that the kernel does not run in an encrypted guest as these will trap the RDMSR via #VC, which cannot be handled at that point in early startup.

[patch V2 25/38] parisc: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Switch to the CPU hotplug core state tracking and synchronization mechanim. No functional change intended. Signed-off-by: Thomas Gleixner Cc: "James E.J. Bottomley" Cc: Helge Deller Cc: linux-par...@vger.kernel.org --- arch/parisc/Kconfig |1 + arch/parisc

[patch V2 19/38] x86/smpboot: Switch to hotplug core state synchronization

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The new AP state tracking and synchronization mechanism in the CPU hotplug core code allows to remove quite some x86 specific code: 1) The AP alive synchronization based on cpumasks 2) The decision whether an AP can be brought up again Signed-off-by: Thomas Gleixner

[patch V2 13/38] x86/smpboot: Remove cpu_callin_mask

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Now that TSC synchronization is SMP function call based there is no reason to wait for the AP to be set in smp_callin_mask. The control CPU waits for the AP to set itself in the online mask anyway. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c | 61 +

[patch V2 15/38] x86/smpboot: Remove wait for cpu_online()

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Now that the core code drops sparse_irq_lock after the idle thread synchronized, it's pointless to wait for the AP to mark itself online. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c | 26 ++ 1 file changed, 2 insertions(+), 24 d

[patch V2 14/38] cpu/hotplug: Rework sparse_irq locking in bringup_cpu()

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner There is no harm to hold sparse_irq lock until the upcoming CPU completes in cpuhp_online_idle(). This allows to remove cpu_online() synchronization from architecture code. Signed-off-by: Thomas Gleixner --- kernel/cpu.c | 28 +++- 1 file change

[patch V2 12/38] x86/smpboot: Make TSC synchronization function call based

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Spin-waiting on the control CPU until the AP reaches the TSC synchronization is just a waste especially in the case that there is no synchronization required. As the synchronization has to run with interrupts disabled the control CPU part can just be done from a SMP functio

[patch V2 09/38] x86/smpboot: Get rid of cpu_init_secondary()

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The synchronization of the AP with the control CPU is a SMP boot problem and has nothing to do with cpu_init(). Open code cpu_init_secondary() in start_secondary() and move wait_for_master_cpu() into the SMP boot code. No functional change. Signed-off-by: Thomas Gleixner

[patch V2 11/38] x86/smpboot: Move synchronization masks to SMP boot code

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner The usage is in smpboot.c and not in the CPU initialization code. The XEN_PV usage of cpu_callout_mask is obsolete as cpu_init() not longer waits and cacheinfo has its own CPU mask now, so cpu_callout_mask can be made static too. Signed-off-by: Thomas Gleixner --- arch/

[patch V2 10/38] x86/cpu/cacheinfo: Remove cpu_callout_mask dependency

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner cpu_callout_mask is used for the stop machine based MTRR/PAT init. In preparation of moving the BP/AP synchronization to the core hotplug code, use a private CPU mask for cacheinfo and manage it in the starting/dying hotplug state. Signed-off-by: Thomas Gleixner --- arc

[patch V2 06/38] x86/smpboot: Remove the CPU0 hotplug kludge

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner This was introduced with commit e1c467e69040 ("x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI") to eventually support physical hotplug of CPU0: "We'll change this code in the future to wake up hard offlined CPU0 if real platform and request are available.

[patch V2 07/38] x86/smpboot: Restrict soft_restart_cpu() to SEV

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Now that the CPU0 hotplug cruft is gone, the only user is AMD SEV. Signed-off-by: Thomas Gleixner Cc: Tom Lendacky --- arch/x86/kernel/callthunks.c |2 +- arch/x86/kernel/head_32.S| 14 -- arch/x86/kernel/head_64.S|2 +- 3 files changed, 2

[patch V2 08/38] x86/smpboot: Split up native_cpu_up() into separate phases and document them

2023-05-04 Thread Thomas Gleixner
From: David Woodhouse There are four logical parts to what native_cpu_up() does on the BSP (or on the controlling CPU for a later hotplug): 1) Wake the AP by sending the INIT/SIPI/SIPI sequence. 2) Wait for the AP to make it as far as wait_for_master_cpu() which sets that CPU's bit in cpu

[patch V2 05/38] x86/topology: Remove CPU0 hotplug option

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner This was introduced together with commit e1c467e69040 ("x86, hotplug: Wake up CPU0 via NMI instead of INIT, SIPI, SIPI") to eventually support physical hotplug of CPU0: "We'll change this code in the future to wake up hard offlined CPU0 if real platform and request are a

[patch V2 00/38] cpu/hotplug, x86: Reworked parallel CPU bringup

2023-05-04 Thread Thomas Gleixner
Hi! This is version 2 of the reworked parallel bringup series. Version 1 can be found here: https://lore.kernel.org/lkml/20230414225551.858160...@linutronix.de Background -- The reason why people are interested in parallel bringup is to shorten the (kexec) reboot time of cloud server

[patch V2 01/38] x86/smpboot: Cleanup topology_phys_to_logical_pkg()/die()

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner Make topology_phys_to_logical_pkg_die() static as it's only used in smpboot.c and fixup the kernel-doc warnings for both functions. Signed-off-by: Thomas Gleixner --- arch/x86/include/asm/topology.h |3 --- arch/x86/kernel/smpboot.c | 10 ++ 2 files c

[patch V2 04/38] x86/smpboot: Rename start_cpu0() to soft_restart_cpu()

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner This is used in the SEV play_dead() implementation to re-online CPUs. But that has nothing to do with CPU0. Signed-off-by: Thomas Gleixner Cc: Tom Lendacky --- arch/x86/include/asm/cpu.h |2 +- arch/x86/kernel/callthunks.c |2 +- arch/x86/kernel/head_32.S|

[patch V2 02/38] cpu/hotplug: Mark arch_disable_smp_support() and bringup_nonboot_cpus() __init

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner No point in keeping them around. Signed-off-by: Thomas Gleixner --- arch/x86/kernel/smpboot.c |4 ++-- kernel/cpu.c |2 +- kernel/smp.c |2 +- 3 files changed, 4 insertions(+), 4 deletions(-) --- --- a/arch/x86/kernel/smpboot.c +++ b

[patch V2 03/38] x86/smpboot: Avoid pointless delay calibration if TSC is synchronized

2023-05-04 Thread Thomas Gleixner
From: Thomas Gleixner When TSC is synchronized across sockets then there is no reason to calibrate the delay for the first CPU which comes up on a socket. Just reuse the existing calibration value. This removes 100ms pointlessly wasted time from CPU hotplug per socket. Signed-off-by: Thomas Gl

[ovmf test] 180532: all pass - PUSHED

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

RE: [patch 00/37] cpu/hotplug, x86: Reworked parallel CPU bringup

2023-05-04 Thread Thomas Gleixner
Michael! On Thu, Apr 27 2023 at 14:48, Michael Kelley wrote: > From: Thomas Gleixner Sent: Friday, April 14, 2023 4:44 > PM > > I smoke-tested several Linux guest configurations running on Hyper-V, > using the "kernel/git/tglx/devel.git hotplug" tree as updated on April 26th. > No functional iss

Re: xenstored: EACCESS error accessing control/feature-balloon 1

2023-05-04 Thread zithro
On 04 May 2023 17:59, Yann Dirson wrote: On 5/4/23 15:58, zithro wrote: Hi, [ snipped for brevity, report summary: XAPI daemon in domU tries to write to a non-existent xenstore node in a non-XAPI dom0 ] On 12 Apr 2023 18:41, Yann Dirson wrote: Is there anything besides XAPI using this node,

[PATCH v4 1/2] acpi: Make TPM version configurable.

2023-05-04 Thread Jennifer Herbert
This patch makes the TPM version, for which the ACPI library probes, configurable. If acpi_config.tpm_verison is set to 1, it indicates that 1.2 (TCPA) should be probed. I have also added to hvmloader an option to allow setting this new config, which can be triggered by setting the platform/tpm_

[PATCH v4 2/2] acpi: Add TPM2 interface definition.

2023-05-04 Thread Jennifer Herbert
This patch introduces an optional TPM 2 interface definition to the ACPI table, which is to be used as part of a vTPM 2 implementation. Signed-off-by: Jennifer Herbert Reviewed-by: Jason Andryuk Acked-by: Jan Beulich --- CC: Jan Beulich CC: Andrew Cooper CC: Roger Pau Monné CC: Jason Andryuk

[PATCH v4 0/2] acpi: Make TPM version configurable.

2023-05-04 Thread Jennifer Herbert
This patch series makes the TPM version, for which the ACPI library probes, configurable, and then add support for TPM version 2. Changes from version 3: * Omit tpm_version 0 case, to fallback to 1.2, previously intended for compatibility for unknown code. * Add checks for xenstore tpm_version

Re: [PATCH] build: shorten macro references

2023-05-04 Thread Andrew Cooper
On 04/05/2023 5:16 pm, Jan Beulich wrote: > Presumably by copy-and-paste we've accumulated a number of instances of > $(@D)/$(@F), which really is nothing else than $@. The split form only > needs using when we want to e.g. insert a leading . at the beginning of > the file name portion of the full

Re: [PATCH v3 05/14 RESEND] xenpm: Change get-cpufreq-para output for internal

2023-05-04 Thread Jason Andryuk
On Thu, May 4, 2023 at 10:35 AM Jan Beulich wrote: > > On 01.05.2023 21:30, Jason Andryuk wrote: > > When using HWP, some of the returned data is not applicable. In that > > case, we should just omit it to avoid confusing the user. So switch to > > printing the base and turbo frequencies since t

Re: [PATCH v3 04/14 RESEND] cpufreq: Add Hardware P-State (HWP) driver

2023-05-04 Thread Jason Andryuk
On Thu, May 4, 2023 at 9:11 AM Jan Beulich wrote: > > On 01.05.2023 21:30, Jason Andryuk wrote: > > For cpufreq=xen:hwp, placing the option inside the governor wouldn't > > work. Users would have to select the hwp-internal governor to turn off > > hwp support. > > I'm afraid I don't understand th

[libvirt test] 180524: regressions - FAIL

2023-05-04 Thread osstest service owner
flight 180524 libvirt real [real] flight 180533 libvirt real-retest [real] http://logs.test-lab.xenproject.org/osstest/logs/180524/ http://logs.test-lab.xenproject.org/osstest/logs/180533/ Regressions :-( Tests which did not succeed and are blocking, including tests which could not be run: test-

[PATCH] build: shorten macro references

2023-05-04 Thread Jan Beulich
Presumably by copy-and-paste we've accumulated a number of instances of $(@D)/$(@F), which really is nothing else than $@. The split form only needs using when we want to e.g. insert a leading . at the beginning of the file name portion of the full name. Signed-off-by: Jan Beulich --- a/xen/arch

Re: xenstored: EACCESS error accessing control/feature-balloon 1

2023-05-04 Thread Yann Dirson
On 5/4/23 15:58, zithro wrote: > Hi, > > [ snipped for brevity, report summary: > XAPI daemon in domU tries to write to a non-existent xenstore node in > a non-XAPI dom0 ] > > On 12 Apr 2023 18:41, Yann Dirson wrote: >> Is there anything besides XAPI using this node, or the other data >> publish

Re: [PATCH v2 1/2] build: don't export building_out_of_srctree

2023-05-04 Thread Jan Beulich
On 04.05.2023 16:49, Anthony PERARD wrote: > On Wed, Mar 29, 2023 at 12:22:16PM +0200, Jan Beulich wrote: >> I don't view a variable of this name as suitable for exporting, the more > > We could rename it. > >> that it carries entirely redundant information. The reasons for its > > The patch rep

Re: [PATCH v2 2/2] build: omit "source" symlink when building hypervisor in-tree

2023-05-04 Thread Anthony PERARD
On Wed, Mar 29, 2023 at 12:23:37PM +0200, Jan Beulich wrote: > This symlink is getting in the way of using e.g. "find" on the xen/ > subtree, and it isn't really needed when not building out-of-tree: > The one use that there was can easily be avoided. > > Signed-off-by: Jan Beulich Reviewed-by:

Re: [PATCH v2 1/2] build: don't export building_out_of_srctree

2023-05-04 Thread Anthony PERARD
On Wed, Mar 29, 2023 at 12:22:16PM +0200, Jan Beulich wrote: > I don't view a variable of this name as suitable for exporting, the more We could rename it. > that it carries entirely redundant information. The reasons for its The patch replace building_out_of_srctree with abs_objtree and abs_src

  1   2   >