Re: [PATCH v2 15/20] amd_iommu: Toggle memory regions based on address translation mode

2025-05-11 Thread Sairaj Kodilkar
On 5/2/2025 7:46 AM, Alejandro Jimenez wrote: Enable the appropriate memory region for an address space depending on the address translation mode selected for it. This is currently based on a generic x86 IOMMMU property, and only done during the address space s/IOMMMU/IOMMU initialization.

Re: [PATCH v2 09/20] amd_iommu: Add basic structure to support IOMMU notifier updates

2025-05-11 Thread Sairaj Kodilkar
On 5/2/2025 7:45 AM, Alejandro Jimenez wrote: Add the minimal data structures required to maintain a list of address spaces (i.e. devices) with registered notifiers, and to update the type of events that require notifications. Note that the ability to register for MAP notifications is not avai

Re: [PATCH v2 05/20] amd_iommu: Add helper function to extract the DTE

2025-05-11 Thread Sairaj Kodilkar
On 5/2/2025 7:45 AM, Alejandro Jimenez wrote: Extracting the DTE from a given AMDVIAddressSpace pointer structure is a common operation required for syncing the shadow page tables. Implement a helper to do it and check for common error conditions. Signed-off-by: Alejandro Jimenez --- hw/i3

Re: How to mark internal properties

2025-05-11 Thread Markus Armbruster
Thomas Huth writes: > On 09/05/2025 09.32, Zhao Liu wrote: >> On Fri, May 09, 2025 at 02:49:27PM +0800, Xiaoyao Li wrote: >>> Date: Fri, 9 May 2025 14:49:27 +0800 >>> From: Xiaoyao Li >>> Subject: Re: [PATCH v4 12/27] target/i386/cpu: Remove >>> CPUX86State::enable_cpuid_0xb field >>> >>> On 5

Re: [PATCH v10 3/3] migration: write zero pages when postcopy enabled

2025-05-11 Thread Prasad Pandit
Hi, On Fri, 9 May 2025 at 20:41, Peter Xu wrote: > Isn't that what multifd is doing already? > typedef struct { > ... > /* > * This array contains the pointers to: > * - normal pages (initial normal_pages entries) > * - zero pages (following zero_pages entries) > */

Re: [PATCH v2 0/2] amd_iommu: Fixes

2025-05-11 Thread Sairaj Kodilkar
++ Philippe Mathieu-Daudé On 5/9/2025 12:15 PM, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup because amd iommu enables the no DMA memory region even when guest is using DMA remapping mode.

Re: [PATCH v2 0/2] amd_iommu: Fixes

2025-05-11 Thread Sairaj Kodilkar
On 5/11/2025 11:22 PM, Michael S. Tsirkin wrote: On Fri, May 09, 2025 at 12:15:24PM +0530, Sairaj Kodilkar wrote: Fix following two issues in the amd viommu 1. The guest fails to setup the passthrough device when for following setup because amd iommu enables the no DMA memory region even

Re: [PATCH v2 2/2] hw/i386/amd_iommu: Fix xtsup when vcpus < 255

2025-05-11 Thread Michael S. Tsirkin
On Mon, May 12, 2025 at 09:36:51AM +0530, Sairaj Kodilkar wrote: > From: Vasant Hegde > > If vCPUs > 255 then x86 common code (x86_cpus_init()) call > kvm_enable_x2apic(). > But if vCPUs <= 255 then it won't call kvm_enable_x2apic(). > > Booting guest in x2apic mode, amd-iommu,xtsup=on and <= 2

[PATCH v3] qtest/migration/rdma: Add test for rdma migration with ipv6

2025-05-11 Thread Li Zhijian via
Recently, we removed ipv6 restriction[0] from RDMA migration, add a test for it. [0] https://lore.kernel.org/qemu-devel/20250326095224.9918-1-jinpu.w...@ionos.com/ Cc: Jack Wang Cc: Michael R. Galaxy Cc: Peter Xu Cc: Yu Zhang Reviewed-by: Jack Wang Signed-off-by: Li Zhijian --- V3: - ski

Re: [PATCH v3 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag

2025-05-11 Thread Thomas Huth
On 06/05/2025 16.38, Philippe Mathieu-Daudé wrote: E1000_FLAG_MAC was only used by the hw_compat_2_4[] array, via the 'extra_mac_registers=off' property. We removed all machines using that array, lets remove all the code around E1000_FLAG_MAC, including the MAC_ACCESS_FLAG_NEEDED enum, similarly

[PATCH] target/riscv/kvm/kvm-cpu: Fixed the issue of resume after QEMU+KVM migration

2025-05-11 Thread 谢波
This patch fixes two critical issues in QEMU with KVM: Post-Migration Failure in User Mode: When QEMU with KVM is running in user mode, the guest may fail to function correctly after migration. Multi-Core Guest Inconsistency: After migration, only the first CPU (core 0) remains functional, while

Query Regarding VM Consistent Snapshot Approaches and Impact of QEMU Guest Agent Freeze

2025-05-11 Thread P, Rajasekar
Dear KVM Team, I am currently evaluating different approaches to achieve VM-consistent snapshots and would appreciate your insights on the matter. My analysis has identified two main approaches for quiescing a VM: 1. Quiescing by pausing (or suspending) the entire VM - as currently impleme

[PATCH] target/riscv/kvm/kvm-cpu: Fixed the issue of resume after QEMU+KVM migration

2025-05-11 Thread 谢波
This patch fixes two critical issues in QEMU with KVM: Post-Migration Failure in User Mode: When QEMU with KVM is running in user mode, the guest may fail to function correctly after migration. Multi-Core Guest Inconsistency: After migration, only the first CPU (core 0) remains functional, while

Re: [PATCH v2 2/2] qtest/migration/rdma: Add test for rdma migration with ipv6

2025-05-11 Thread Zhijian Li (Fujitsu)
On 09/05/2025 23:32, Peter Xu wrote: > Does this mean I'll need to setup twice, one for each v? > > Even if so, I did this: > > ===8<=== > $ sudo ../scripts/rdma-migration-helper.sh setup > Setup new rdma/rxe wlp0s20f3_rxe for wlp0s20f3 with 192.168.68.123 > $ sudo IP_FAMILY=ipv6 ../scripts/rdm

RE: [PATCH v1 12/22] hw/misc/aspeed_hace Support to dump plaintext and digest for better debugging

2025-05-11 Thread Jamin Lin
Hi Cédric > Subject: Re: [PATCH v1 12/22] hw/misc/aspeed_hace Support to dump > plaintext and digest for better debugging > > On 3/21/25 10:26, Jamin Lin wrote: > > 1. Disabled by default. Uncomment "#define DEBUG_HACE 1" to enable it. > > 2. Uses the "qemu_hexdump" API to dump the digest result.

[PATCH v2 1/2] hw/i386/amd_iommu: Fix device setup failure when PT is on.

2025-05-11 Thread Sairaj Kodilkar
Current amd_iommu enables the iommu_nodma address space when pt_supported flag is on. This causes device to bypass the IOMMU and use untranslated address to perform DMA when guest kernel uses DMA mode, resulting in failure to setup the devices in the guest. Fix the issue by always enabling amdvi_d

[PATCH v2 2/2] hw/i386/amd_iommu: Fix xtsup when vcpus < 255

2025-05-11 Thread Sairaj Kodilkar
From: Vasant Hegde If vCPUs > 255 then x86 common code (x86_cpus_init()) call kvm_enable_x2apic(). But if vCPUs <= 255 then it won't call kvm_enable_x2apic(). Booting guest in x2apic mode, amd-iommu,xtsup=on and <= 255 vCPUs is broken as it fails to call kvm_enable_x2apic(). Fix this by adding

[PATCH 30/50] ppc/xive: Add xive_tctx_pipr_present() to present new interrupt

2025-05-11 Thread Nicholas Piggin
xive_tctx_pipr_update() is used for multiple things. In an effort to make things simpler and less overloaded, split out the function that is used to present a new interrupt to the tctx. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c| 8 +++- hw/intc/xive2.c | 2 +- include/h

[PATCH 02/50] ppc/xive: Report access size in XIVE TM operation error logs

2025-05-11 Thread Nicholas Piggin
Report access size in XIVE TM operation error logs. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 3eb28c2265..80b07a0afe 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -326,

[PATCH 08/50] ppc/xive2: Use fair irq target search algorithm

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles The current xive algorithm for finding a matching group vCPU target always uses the first vCPU found. And, since it always starts the search with thread 0 of a core, thread 0 is almost always used to handle group interrupts. This can lead to additional interrupt latency and po

Re: [PATCH v4 11/13] KVM: Introduce CVMPrivateSharedListener for attribute changes during page conversions

2025-05-11 Thread Chenyi Qiang
On 5/9/2025 5:03 PM, Baolu Lu wrote: > On 4/7/2025 3:49 PM, Chenyi Qiang wrote: >> With the introduction of the RamBlockAttribute object to manage >> RAMBlocks with guest_memfd and the implementation of >> PrivateSharedManager interface to convey page conversion events, it is >> more elegant to

[PATCH 38/50] ppc/xive2: Avoid needless interrupt re-check on CPPR set

2025-05-11 Thread Nicholas Piggin
When CPPR priority is decreased, pending interrupts do not need to be re-checked if one is already presented because by definition that will be the highest priority. This prevents a presented group interrupt from being lost. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 4 +++- 1 file ch

[PATCH 42/50] ppc/xive: Redistribute phys after pulling of pool context

2025-05-11 Thread Nicholas Piggin
After pulling the pool context, if a pool irq had been presented and was cleared in the process, there could be a pending irq in phys that should be presented. Process the phys irq ring after pulling pool ring to catch this case and avoid losing irqs. Signed-off-by: Nicholas Piggin --- hw/intc/x

[PATCH 37/50] ppc/xive2: Consolidate presentation processing in context push

2025-05-11 Thread Nicholas Piggin
OS-push operation must re-present pending interrupts. Use the newly created xive2_tctx_process_pending() function instead of duplicating the logic. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 42 ++ 1 file changed, 10 insertions(+), 32 deletions(-

[PATCH 47/50] ppc/xive2: Implement POOL LGS push TIMA op

2025-05-11 Thread Nicholas Piggin
Implement set LGS for the POOL ring. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 8 1 file changed, 8 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index dc64edf13d..807a1c1c34 100644 --- a/hw/intc/xive.c +++ b/hw/intc/xive.c @@ -532,6 +532,12 @@ static void xive_t

[PATCH 45/50] ppc/xive2: redistribute group interrupts on context push

2025-05-11 Thread Nicholas Piggin
When pushing a context, any presented group interrupt should be redistributed before processing pending interrupts to present highest priority. This can occur when pushing the POOL ring when the valid PHYS ring has a group interrupt presented, because they share signal registers. Signed-off-by: N

[PATCH 39/50] ppc/xive: Assert group interrupts were redistributed

2025-05-11 Thread Nicholas Piggin
Add some assertions to try to ensure presented group interrupts do not get lost without being redistributed, if they become precluded by CPPR or preempted by a higher priority interrupt. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 2 ++ hw/intc/xive2.c | 1 + 2 files changed, 3 insertio

[PATCH 14/50] ppc/xive: Explicitly zero NSR after accepting

2025-05-11 Thread Nicholas Piggin
Have xive_tctx_accept clear NSR in one shot rather than masking out bits as they are tested, which makes it clear it's reset to 0, and does not have a partial NSR value in the register. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-)

[PATCH 16/50] ppc/xive: Fix pulling pool and phys contexts

2025-05-11 Thread Nicholas Piggin
This improves the implementation of pulling pool and phys contexts in XIVE1, by following closer the OS pulling code. In particular, the old ring data is returned rather than the modified, and irq signals are reset on pull. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 66

[PATCH 11/50] ppc/xive2: Do not present group interrupt on OS-push if precluded by CPPR

2025-05-11 Thread Nicholas Piggin
Group interrupts should not be taken from the backlog and presented if they are precluded by CPPR. Fixes: 855434b3b8 ("ppc/xive2: Process group backlog when pushing an OS context") Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff

[PATCH 34/50] ppc/xive: tctx_accept only lower irq line if an interrupt was presented

2025-05-11 Thread Nicholas Piggin
The relationship between an interrupt signaled in the TIMA and the QEMU irq line to the processor to be 1:1, so they should be raised and lowered together and "just in case" lowering should be avoided (it could mask Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 3 +-- 1 file changed, 1 ins

[PATCH 01/50] ppc/xive: Fix xive trace event output

2025-05-11 Thread Nicholas Piggin
Typo, IBP should be IPB. Signed-off-by: Nicholas Piggin --- hw/intc/trace-events | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/intc/trace-events b/hw/intc/trace-events index 0ba9a02e73..f77f9733c9 100644 --- a/hw/intc/trace-events +++ b/hw/intc/trace-events @@ -274

[PATCH 48/50] ppc/xive2: Implement PHYS ring VP push TIMA op

2025-05-11 Thread Nicholas Piggin
Implement the phys (aka hard) VP push. PowerVM uses this operation. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 2 ++ hw/intc/xive2.c| 11 +++ include/hw/ppc/xive2.h | 2 ++ 3 files changed, 15 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c index 80

[PATCH 27/50] ppc/xive2: redistribute irqs for pool and phys ctx pull

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles When disabling (pulling) an xive interrupt context, we need to redistribute any active group interrupts to other threads that can handle the interrupt if possible. This support had already been added for the OS context but had not yet been added to the pool or physical context.

[PATCH 18/50] pnv/xive2: Print value in invalid register write logging

2025-05-11 Thread Nicholas Piggin
From: Michael Kowal This can make it easier to see what the target system is trying to do. [npiggin: split from larger patch] Signed-off-by: Michael Kowal --- hw/intc/pnv_xive2.c | 24 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/hw/intc/pnv_xive2.c b

[PATCH 50/50] ppc/xive2: Enable lower level contexts on VP push

2025-05-11 Thread Nicholas Piggin
When pushing a context, the lower-level context becomes valid if it had V=1, and so on. Iterate lower level contexts and send them pending interrupts if they become enabled. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 36 1 file changed, 28 insertion

[PATCH 29/50] ppc/xive2: Redistribute group interrupt preempted by higher priority interrupt

2025-05-11 Thread Nicholas Piggin
A group interrupt that gets preempted by a higher priority interrupt delivery must be redistributed otherwise it would get lost. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 14 -- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/hw/intc/xive2.c b/hw/intc/xive2.

[PATCH 49/50] ppc/xive: Split need_resend into restore_nvp

2025-05-11 Thread Nicholas Piggin
This is needed by the next patch which will re-send on all lower rings when pushing a context. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 24 hw/intc/xive2.c | 28 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/hw/

[PATCH 31/50] ppc/xive: Fix high prio group interrupt being preempted by low prio VP

2025-05-11 Thread Nicholas Piggin
xive_tctx_pipr_present() as implemented with xive_tctx_pipr_update() causes VP-directed (group==0) interrupt to be presented in PIPR and NSR despite being a lower priority than the currently presented group interrupt. This must not happen. The IPB bit should record the low priority VP interrupt, b

[PATCH 46/50] ppc/xive2: Implement set_os_pending TIMA op

2025-05-11 Thread Nicholas Piggin
xive2 must take into account redistribution of group interrupts if the VP directed priority exceeds the group interrupt priority after this operation. The xive1 code is not group aware so implement this for xive2. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 2 ++ hw/intc/xive2.c

[PATCH 21/50] ppc/xive2: add interrupt priority configuration flags

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Adds support for extracting additional configuration flags from the XIVE configuration register that are needed for redistribution of group interrupts. Signed-off-by: Glenn Miles --- hw/intc/pnv_xive2.c | 16 hw/intc/pnv_xive2_regs.h | 1 + include/hw/p

[PATCH 35/50] ppc/xive: Add xive_tctx_pipr_set() helper function

2025-05-11 Thread Nicholas Piggin
Have xive_tctx_notify() also set the new PIPR value and rename it to xive_tctx_pipr_set(). This can replace the last xive_tctx_pipr_update() caller because it does not need to update IPB (it already sets it). Signed-off-by: Nicholas Piggin --- hw/intc/xive.c| 39 +++--

[PATCH 33/50] ppc/xive: tctx signaling registers rework

2025-05-11 Thread Nicholas Piggin
The tctx "signaling" registers (PIPR, CPPR, NSR) raise an interrupt on the target CPU thread. The POOL and PHYS rings both raise hypervisor interrupts, so they both share one set of signaling registers in the PHYS ring. The PHYS NSR register contains a field that indicates which ring has presented

[PATCH 05/50] ppc/xive2: fix context push calculation of IPB priority

2025-05-11 Thread Nicholas Piggin
Pushing a context and loading IPB from NVP is defined to merge ('or') that IPB into the TIMA IPB register. PIPR should therefore be calculated based on the final IPB value, not just the NVP value. Fixes: 9d2b6058c5b ("ppc/xive2: Add grouping level to notification") Signed-off-by: Nicholas Piggin

[PATCH 43/50] ppc/xive: Check TIMA operations validity

2025-05-11 Thread Nicholas Piggin
Certain TIMA operations should only be performed when a ring is valid, others when the ring is invalid, and they are considered undefined if used incorrectly. Add checks for this condition. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c| 196 +-

[PATCH 23/50] ppc/xive: Add more interrupt notification tracing

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Add more tracing around notification, redistribution, and escalation. Signed-off-by: Glenn Miles --- hw/intc/trace-events | 6 ++ hw/intc/xive.c | 3 +++ hw/intc/xive2.c | 13 - 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/hw/in

[PATCH 09/50] ppc/xive2: Fix irq preempted by lower priority group irq

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles A problem was seen where uart interrupts would be lost resulting in the console hanging. Traces showed that a lower priority interrupt was preempting a higher priority interrupt, which would result in the higher priority interrupt never being handled. The new interrupt's priori

[PATCH 28/50] ppc/xive: Change presenter .match_nvt to match not present

2025-05-11 Thread Nicholas Piggin
Have the match_nvt method only perform a TCTX match but don't present the interrupt, the caller presents. This has no functional change, but allows for more complicated presentation logic after matching. Signed-off-by: Nicholas Piggin --- hw/intc/pnv_xive.c| 16 +++--- hw/intc/pnv_xi

[PATCH 41/50] ppc/xive2: Prevent pulling of pool context losing phys interrupt

2025-05-11 Thread Nicholas Piggin
When the pool context is pulled, the shared pool/phys signal is reset, which loses the qemu irq if a phys interrupt was presented. Only reset the signal if a poll irq was presented. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 18 ++ 1 file changed, 10 insertions(+), 8 d

[PATCH 26/50] ppc/xive2: Redistribute group interrupt precluded by CPPR update

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Add support for redistributing a presented group interrupt if it is precluded as a result of changing the CPPR value. Without this, group interrupts can be lost. Signed-off-by: Glenn Miles --- hw/intc/xive2.c | 82 - 1 file chan

[PATCH 44/50] ppc/xive2: Implement pool context push TIMA op

2025-05-11 Thread Nicholas Piggin
Implement pool context push TIMA op. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 4 hw/intc/xive2.c| 50 -- include/hw/ppc/xive2.h | 2 ++ 3 files changed, 39 insertions(+), 17 deletions(-) diff --git a/hw/intc/xive.c b/hw/i

[PATCH 36/50] ppc/xive2: split tctx presentation processing from set CPPR

2025-05-11 Thread Nicholas Piggin
The second part of the set CPPR operation is to process (or re-present) any pending interrupts after CPPR is adjusted. Split this presentation processing out into a standalone function that can be used in other places. Signed-off-by: Nicholas Piggin --- hw/intc/xive2.c | 137 +++

[PATCH 19/50] pnv/xive2: VC_ENDC_WATCH_SPEC regs should read back WATCH_FULL

2025-05-11 Thread Nicholas Piggin
Firmware expects to read back the WATCH_FULL bit from the VC_ENDC_WATCH_SPEC register, so don't clear it on read. Don't bother clearing the reads-as-zero CONFLICT bit because it's masked at write already. Signed-off-by: Nicholas Piggin --- hw/intc/pnv_xive2.c | 1 - 1 file changed, 1 deletion(-

[PATCH 25/50] ppc/xive2: Implement "Ack OS IRQ to even report line" TIMA op

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Booting AIX in a PowerVM partition requires the use of the "Acknowledge O/S Interrupt to even O/S reporting line" special operation provided by the IBM XIVE interrupt controller. This operation is invoked by writing a byte (data is irrelevant) to offset 0xC10 of the Thread Inter

[PATCH 40/50] ppc/xive2: implement NVP context save restore for POOL ring

2025-05-11 Thread Nicholas Piggin
In preparation to implement POOL context push, add support for POOL NVP context save/restore. The NVP p bit is defined in the spec as follows: If TRUE, the CPPR of a Pool VP in the NVP is updated during store of the context with the CPPR of the Hard context it was running under. It's not

[PATCH 32/50] ppc/xive: Split xive recompute from IPB function

2025-05-11 Thread Nicholas Piggin
Further split xive_tctx_pipr_update() by splitting out a new function that is used to re-compute the PIPR from IPB. This is generally only used with XIVE1, because group interrputs require more logic. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 25 ++--- 1 file change

[PATCH 22/50] ppc/xive2: Support redistribution of group interrupts

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles When an XIVE context is pulled while it has an active, unacknowledged group interrupt, XIVE will check to see if a context on another thread can handle the interrupt and, if so, notify that context. If there are no contexts that can handle the interrupt, then the interrupt is a

[PATCH 24/50] ppc/xive2: Improve pool regs variable name

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Change pregs to pool_regs, for clarity. [npiggin: split from larger patch] Signed-off-by: Glenn Miles --- hw/intc/xive2.c | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/hw/intc/xive2.c b/hw/intc/xive2.c index 968b698677..ec4b9320b4 100644 ---

[PATCH 20/50] pnv/xive2: Permit valid writes to VC/PC Flush Control registers

2025-05-11 Thread Nicholas Piggin
From: Michael Kowal Writes to the Flush Control registers were logged as invalid when they are allowed. Clearing the unsupported want_cache_disable feature is supported, so don't log an error in that case. Signed-off-by: Michael Kowal --- hw/intc/pnv_xive2.c | 36 ++

[PATCH 10/50] ppc/xive2: Fix treatment of PIPR in CPPR update

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles According to the XIVE spec, updating the CPPR should also update the PIPR. The final value of the PIPR depends on other factors, but it should never be set to a value that is above the CPPR. Also added support for redistributing an active group interrupt when it is precluded as

[PATCH 12/50] ppc/xive2: Set CPPR delivery should account for group priority

2025-05-11 Thread Nicholas Piggin
The group interrupt delivery flow selects the group backlog scan if LSMFB < IPB, but that scan may find an interrupt with a priority >= IPB. In that case, the VP-direct interrupt should be chosen. This extends to selecting the lowest prio between POOL and PHYS rings. Implement this just by re-star

[PATCH 04/50] ppc/xive2: Remote VSDs need to match on forwarding address

2025-05-11 Thread Nicholas Piggin
From: Michael Kowal In a multi chip environment there will be remote/forwarded VSDs. The check to find a matching INT controller (XIVE) of the remote block number was checking the INTs chip number. Block numbers are not tied to a chip number. The matching remote INT is the one that matches the

[PATCH 13/50] ppc/xive: tctx_notify should clear the precluded interrupt

2025-05-11 Thread Nicholas Piggin
If CPPR is lowered to preclude the pending interrupt, NSR should be cleared and the qemu_irq should be lowered. This avoids some cases of supurious interrupts. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/intc/xive.c b/hw/intc/xive.c

[PATCH 17/50] pnv/xive2: Support ESB Escalation

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles Add support for XIVE ESB Interrupt Escalation. Suggested-by: Michael Kowal [This change was taken from a patch provided by Michael Kowal.] Signed-off-by: Glenn Miles --- hw/intc/xive2.c | 62 ++--- include/hw/ppc/xive2.h | 1

[PATCH 07/50] ppc/xive2: Reset Generation Flipped bit on END Cache Watch

2025-05-11 Thread Nicholas Piggin
From: Michael Kowal When the END Event Queue wraps the END EQ Generation bit is flipped and the Generation Flipped bit is set to one. On a END cache Watch read operation, the Generation Flipped bit needs to be reset. While debugging an error modified END not valid error messages to include the

[PATCH 15/50] ppc/xive: Move NSR decoding into helper functions

2025-05-11 Thread Nicholas Piggin
Rather than functions to return masks to test NSR bits, have functions to test those bits directly. This should be no functional change, it just makes the code more readable. Signed-off-by: Nicholas Piggin --- hw/intc/xive.c| 51 +++ include/hw/ppc

[PATCH 03/50] ppc/xive2: Fix calculation of END queue sizes

2025-05-11 Thread Nicholas Piggin
From: Glenn Miles The queue size of an Event Notification Descriptor (END) is determined by the 'cl' and QsZ fields of the END. If the cl field is 1, then the queue size (in bytes) will be the size of a cache line 128B * 2^QsZ and QsZ is limited to 4. Otherwise, it will be 4096B * 2^QsZ with QsZ

[PATCH 06/50] ppc/xive: Fix PHYS NSR ring matching

2025-05-11 Thread Nicholas Piggin
Test that the NSR exception bit field is equal to the pool ring value, rather than any common bits set, which is more correct (although there is no practical bug because the LSI NSR type is not implemented and POOL/PHYS NSR are encoded with exclusive bits). Fixes: 4c3ccac636 ("pnv/xive: Add specia

[PATCH 00/50] ppc/xive: updates for PowerVM

2025-05-11 Thread Nicholas Piggin
These changes gets the powernv xive2 to the point it is able to run PowerVM with good stability. * Various bug fixes around lost interrupts particularly. * Major group interrupt work, in particular around redistributing interrupts. Upstream group support is not in a complete or usable state as

Re: [PATCH v4 01/13] memory: Export a helper to get intersection of a MemoryRegionSection with a given range

2025-05-11 Thread Zhao Liu
On Mon, Apr 07, 2025 at 03:49:21PM +0800, Chenyi Qiang wrote: > Date: Mon, 7 Apr 2025 15:49:21 +0800 > From: Chenyi Qiang > Subject: [PATCH v4 01/13] memory: Export a helper to get intersection of a > MemoryRegionSection with a given range > X-Mailer: git-send-email 2.43.5 > > Rename the helper

Re: How to mark internal properties (was: Re: [PATCH v4 12/27] target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field)

2025-05-11 Thread Zhao Liu
On Fri, May 09, 2025 at 12:04:19PM +0200, Thomas Huth wrote: > Date: Fri, 9 May 2025 12:04:19 +0200 > From: Thomas Huth > Subject: How to mark internal properties (was: Re: [PATCH v4 12/27] > target/i386/cpu: Remove CPUX86State::enable_cpuid_0xb field) > > On 09/05/2025 09.32, Zhao Liu wrote: >

RE: [PULL 22/23] tests/function/aspeed: Add functional test for ast2700fc

2025-05-11 Thread Steven Lee
Hi Cédric, Peter, > -Original Message- > From: Peter Maydell > Sent: Friday, May 9, 2025 11:28 PM > To: Cédric Le Goater > Cc: qemu-...@nongnu.org; qemu-devel@nongnu.org; Steven Lee > > Subject: Re: [PULL 22/23] tests/function/aspeed: Add functional test for > ast2700fc > > On Fri, 9 M

Re: [v2] tests/qtest: Add qtest for NPCM8XX PSPI module

2025-05-11 Thread Tim Lee
Hi Peter, Sorry about that. When I ran this qtest and I found an error then I tried to modify npcm_pspi driver to make data register read/write test pass. [R +0.080118] writew 0xf0201002 0x4 [S +0.080126] OK [R +0.080148] readw 0xf0201002 [S +0.080153] OK 0x0004 [R +0.080168] writew 0x

RE: [PATCH v1 11/22] hw/misc/aspeed_hace: Add trace-events for better debugging

2025-05-11 Thread Jamin Lin
Hi Cédric > From: Cédric Le Goater > > Subject: Re: [PATCH v1 11/22] hw/misc/aspeed_hace: Add trace-events for > better debugging > > On 3/21/25 10:26, Jamin Lin wrote: > > Introduced "trace_aspeed_hace_addr", "trace_aspeed_hace_sg", > > "trace_aspeed_hace_read", and "trace_aspeed_hace_write" tr

[PATCH v6 17/24] target/m68k: Split gen_ea_mode_fp for load/store

2025-05-11 Thread Richard Henderson
Replace with gen_load_mode_fp and gen_store_mode_fp. Return bool for success from the new functions. Remove gen_ldst_fp and ea_what as unused. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 125 +--- 1 file

[PATCH v6 16/24] target/m68k: Remove env argument to gen_ea_mode_fp

2025-05-11 Thread Richard Henderson
Use the env pointer in DisasContext. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 21 ++--- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 2c2d83e61b..7

[PATCH v6 22/24] tests/tcg/m68k: Add packed decimal tests

2025-05-11 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- tests/tcg/m68k/packeddecimal-1.c | 46 ++ tests/tcg/m68k/packeddecimal-2.c | 55 tests/tcg/m68k/Makefile.target | 4 ++- 3 files changed, 104 insertions(+), 1 dele

[PATCH v6 15/24] target/m68k: Remove env argument to gen_store_mode

2025-05-11 Thread Richard Henderson
Use the env pointer in DisasContext. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index c3cf1c9f91..2c2d83e61b 10064

Re: [PATCH] target/sparc: don't set FSR_NVA when comparing unordered floats

2025-05-11 Thread Richard Henderson
On 4/25/25 02:35, Clément Chigot wrote: FSR_NVA should be set when one of the operands is a signaling NaN or when using FCMPEx instructions. But those cases are already handled within check_ieee_exception or floatxx_compare functions. Otherwise, it should be left untouched. FTR, this was detecte

Re: [PATCH v4 20/23] target/xtensa: call plugin trap callbacks

2025-05-11 Thread Max Filippov
On Sun, May 11, 2025 at 6:14 AM Julian Ganz wrote: > > We recently introduced API for registering callbacks for trap related > events as well as the corresponding hook functions. Due to differences > between architectures, the latter need to be called from target specific > code. > > This change p

[PATCH v6 09/24] target/m68k: Use OS_UNSIZED in LEA, PEA, JMP

2025-05-11 Thread Richard Henderson
For LEA and PEA, while the manual says "size = (long)", it also says that the pre-decrement and post-increment addressing modes are illegal. For JMP, the manual says "unsized". OS_UNSIZED is the way to signal gen_lea_mode to reject those addressing modes. Signed-off-by: Richard Henderson --- ta

[PATCH v6 13/24] target/m68k: Remove env argument to gen_lea_mode

2025-05-11 Thread Richard Henderson
Use the env pointer in DisasContext. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 23 +++ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index 1a589874db.

[PATCH v6 12/24] target/m68k: Remove env argument to gen_lea_indexed

2025-05-11 Thread Richard Henderson
Use the env pointer in DisasContext. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 16 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index c16925670d..1a589874

[PATCH v6 01/24] target/m68k: Add FPSR exception bit defines

2025-05-11 Thread Richard Henderson
Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.h| 21 + target/m68k/fpu_helper.c | 22 +++--- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index d9db6a4

[PATCH v6 07/24] target/m68k: Merge gen_ea into SRC_EA and DEST_EA

2025-05-11 Thread Richard Henderson
This will enable further cleanups further down the call chain. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 24 ++-- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/tr

[PATCH v6 05/24] target/m68k: Update FPSR for FMOVECR

2025-05-11 Thread Richard Henderson
This instruction sets CC and EXC bits just like any other. So far we do not properly emulate inexact for the various rom entries, but we can certainly update CC correctly. Signed-off-by: Richard Henderson --- target/m68k/fpu_helper.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/m68

[PATCH v6 24/24] target/m68k: Implement FPIAR

2025-05-11 Thread Richard Henderson
So far, this is only read-as-written. Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2497 Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 1 + target/m68k/cpu.c | 23 ++- target/m68k/helper.c| 14

[PATCH v6 03/24] target/m68k: Keep FPSR up-to-date

2025-05-11 Thread Richard Henderson
Proper support for m68k exceptions will require testing the FPCR vs the FPSR for every instruction. As a step, do not keep FPSR bits in fp_status, but copy them back to the FPSR in every instruction. Since most of the FPSR must be updated on every insn, handle this from the existing helper_ftst a

[PATCH v6 10/24] target/m68k: Move pre-dec/post-inc to gen_lea_mode

2025-05-11 Thread Richard Henderson
Move autoinc down the call chain so that it happens in one place, more or less. This unifies code from gen_ea_mode and gen_ea_mode_fp, as well as the by-hand autoinc from CAS, TAS, MOVES, and MAC. In FMOVE_FCR and FMOVEM, use delay_set_areg to update the value to be stored at the end of the insn.

[PATCH v6 14/24] target/m68k: Remove env argument to gen_load_mode

2025-05-11 Thread Richard Henderson
Use the env pointer in DisasContext. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 31 --- 1 file changed, 12 insertions(+), 19 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c index cc3

[PATCH v6 20/24] target/m68k: Merge gen_store_fp, gen_store_mode_fp

2025-05-11 Thread Richard Henderson
This enables the exceptions raised by the actual store to be reflected as a failure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 107 1 file changed, 53 insertions(+), 54 deletions(-) diff --git a/t

[PATCH v6 18/24] target/m68k: Move gen_addr_fault into gen_{load, store}_mode_fp

2025-05-11 Thread Richard Henderson
Move the exception to be raised into the helpers. This in preparation for raising other exceptions, and still wanting to return failure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions

[PATCH v6 08/24] target/m68k: Use g_assert_not_reached in gen_lea_mode and gen_ea_mode

2025-05-11 Thread Richard Henderson
The mode argument is extracted from 3 bits, and all cases are covered. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/target/m68k/translate.c b/target/m68k/translate.c ind

[PATCH v6 11/24] target/m68k: Split gen_ea_mode for load/store

2025-05-11 Thread Richard Henderson
Replace with gen_load_mode and gen_store_mode. Return bool for success from gen_store_mode, which makes store_dummy unused. Signed-off-by: Richard Henderson --- target/m68k/translate.c | 157 1 file changed, 77 insertions(+), 80 deletions(-) diff --git a

[PATCH v6 23/24] target/m68k: Make vmstate variables static

2025-05-11 Thread Richard Henderson
These need not be exported beyond cpu.c. Fix a typo in vmstate_fpu. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index 866d32fc9f..f

[PATCH v6 04/24] target/m68k: Update FPSR.EXC

2025-05-11 Thread Richard Henderson
So far we've only been updating the AEXC byte. Update the EXC byte as well. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/fpu_helper.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/target/m68k/fpu_helper.c b/target/m6

[PATCH v6 19/24] target/m68k: Merge gen_load_fp, gen_load_mode_fp

2025-05-11 Thread Richard Henderson
This enables the exceptions raised by the actual load to be reflected as a failure. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/translate.c | 104 1 file changed, 51 insertions(+), 53 deletions(-) diff --git a/ta

[PATCH v6 02/24] target/m68k: Restore fp rounding mode on vm load

2025-05-11 Thread Richard Henderson
Call cpu_m68k_set_fpcr to make sure softfloat internals are up-to-date with the restored FPCR. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/m68k/cpu.c b/target/m68k/cpu.c index c5196a612e..7

[PATCH v6 00/24] target/m68k: fpu improvements

2025-05-11 Thread Richard Henderson
v3: https://lore.kernel.org/qemu-devel/20240909172823.649837-1-richard.hender...@linaro.org/ v4: https://lore.kernel.org/qemu-devel/20250224171444.440135-1-richard.hender...@linaro.org/ v5: https://lore.kernel.org/qemu-devel/20250507211300.9735-1-richard.hender...@linaro.org/ Changes for v6:

[PATCH v6 06/24] target/m68k: Introduce M68K_FEATURE_FPU_PACKED_DECIMAL

2025-05-11 Thread Richard Henderson
Set for 68020 and 68030, but does nothing so far. Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Richard Henderson --- target/m68k/cpu.h | 2 ++ target/m68k/cpu.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/target/m68k/cpu.h b/target/m68k/cpu.h index 0630eb26c2..8adb1c6515 100644

  1   2   >