Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2022-01-27 Thread Maxim Levitsky
On Thu, 2022-01-27 at 00:39 +, Mike Lothian wrote: > On Wed, 26 Jan 2022 at 10:12, Maxim Levitsky wrote: > > Great, your system does seem to support GA log > > (but a patch to check if, other that assume blindly that it is supported is > > something that should be done).

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2022-01-26 Thread Maxim Levitsky
On Wed, 2022-01-26 at 09:54 +, Mike Lothian wrote: > On Wed, 26 Jan 2022 at 07:34, Maxim Levitsky wrote: > > Could you post the whole dmesg, or at least: > > > > dmesg | grep AMD-Vi > > > > > > What CPU does your system have? > > > >

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2022-01-25 Thread Maxim Levitsky
On Tue, 2022-01-25 at 23:25 +, Mike Lothian wrote: > On Tue, 25 Jan 2022 at 19:26, Maxim Levitsky wrote: > > Could you just apply these patches on top of 5.15 kernel and see if you get > > the warning? > > > > If something could case it is I think patch

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2022-01-25 Thread Maxim Levitsky
s there. I wonder why your dmesg quote doesn't contain the C line where the warning happens. In partucular I added: if (WARN_ON(status & (MMIO_STATUS_GALOG_RUN_MASK))) That will fire if GA log is already running (maybe BIOS enabled it? - it really shouldn't do that) And that: if (WARN

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2021-12-10 Thread Maxim Levitsky
On Thu, 2021-12-02 at 01:08 +0200, Maxim Levitsky wrote: > On Tue, 2021-11-23 at 18:10 +0200, Maxim Levitsky wrote: > > As I sadly found out, a s3 cycle makes the AMD's iommu stop sending > > interrupts > > until the system is rebooted. > > > > I only noticed i

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-09 Thread Maxim Levitsky
On Thu, 2021-12-09 at 15:45 +, Sean Christopherson wrote: > On Thu, Dec 09, 2021, Maxim Levitsky wrote: > > On Thu, 2021-12-09 at 15:29 +0100, Paolo Bonzini wrote: > > > On 12/9/21 01:02, Sean Christopherson wrote: > > > > RDX, a.k.a. ir_data is NULL.

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-09 Thread Maxim Levitsky
ist with a NULL > > pi->ir_data. > > > > But none of the relevant code has seen any meaningful changes since 5.15, > > so odds > > are good I broke something :-/ Doesn't reproduce here yet even with my iommu changes :-( Oh well. Best regards, Maxim Levitsk

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
On Thu, 2021-12-09 at 00:04 +, Sean Christopherson wrote: > On Thu, Dec 09, 2021, Maxim Levitsky wrote: > > Host crash while running 32 bit VM and another 32 bit VM nested in it: > > > > [ 751.182290] BUG: kernel NULL pointer dereference, address: > >

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
On Wed, 2021-12-08 at 23:43 +, Sean Christopherson wrote: > On Thu, Dec 09, 2021, Maxim Levitsky wrote: > > > KVM: SVM: Remove unnecessary APICv/AVIC update in vCPU unblocking path > > ... > > > Probably just luck (can't reproduce this anymore) but > >

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
On Thu, 2021-12-09 at 01:37 +, Sean Christopherson wrote: > On Thu, Dec 09, 2021, Maxim Levitsky wrote: > > On Thu, 2021-12-09 at 01:00 +0200, Maxim Levitsky wrote: > > > Probably just luck (can't reproduce this anymore) but > > > while running some kvm unit t

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
On Thu, 2021-12-09 at 01:16 +0200, Maxim Levitsky wrote: > On Thu, 2021-12-09 at 01:00 +0200, Maxim Levitsky wrote: > > On Wed, 2021-12-08 at 01:52 +, Sean Christopherson wrote: > > > Overhaul and cleanup APIC virtualization (Posted Interrupts on Intel VMX, > > > AVI

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
On Thu, 2021-12-09 at 01:00 +0200, Maxim Levitsky wrote: > On Wed, 2021-12-08 at 01:52 +, Sean Christopherson wrote: > > Overhaul and cleanup APIC virtualization (Posted Interrupts on Intel VMX, > > AVIC on AMD SVM) to streamline things as much as possible, remove a bun

Re: [PATCH v3 00/26] KVM: x86: Halt and APICv overhaul

2021-12-08 Thread Maxim Levitsky
22:53:26 amdlaptop kernel: R10: 7f5376a396c0 R11: 0293 R12: 7f5376a3b640 Dec 08 22:53:26 amdlaptop kernel: R13: 0002 R14: 7f537ab66880 R15: Dec 08 22:53:26 amdlaptop kernel: Dec 08 22:53:26 amdlaptop kernel: ---[ end trace 676058aaf29d0267 ]--- I'll post my patches tomorrow, after some more testing. Best regards, Maxim Levitsky ___ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH v3 21/26] KVM: SVM: Drop AVIC's intermediate avic_set_running() helper

2021-12-08 Thread Maxim Levitsky
on top of this patch series, after I review it. I’ll post the unit test soon too. Still my gut feeling is that the errata is still there - I am still waiting for AMD to provide any info they could on this. Best regards, Maxim Levitsky >* IsRunning=0 before reading the v

Re: [PATCH 0/5] iommu/amd: fixes for suspend/resume

2021-12-01 Thread Maxim Levitsky
On Tue, 2021-11-23 at 18:10 +0200, Maxim Levitsky wrote: > As I sadly found out, a s3 cycle makes the AMD's iommu stop sending interrupts > until the system is rebooted. > > I only noticed it now because otherwise the IOMMU works, and these interrupts > are only used for errors

[PATCH 5/5] iommu/amd: remove useless irq affinity notifier

2021-11-23 Thread Maxim Levitsky
iommu->intcapxt_notify field is no longer used after a switch to a separate domain was done Fixes: d1adcfbb520c ("iommu/amd: Fix IOMMU interrupt generation in X2APIC mode") Signed-off-by: Maxim Levitsky --- drivers/iommu/amd/amd_iommu_types.h | 2 -- 1 file changed, 2 deletions(-

[PATCH 4/5] iommu/amd: x2apic mode: mask/unmask interrupts on suspend/resume

2021-11-23 Thread Maxim Levitsky
are not wakeup sources, remove IRQCHIP_SKIP_SET_WAKE flag and instead implement a dummy .irq_set_wake which doesn't allow the interrupt to become a wakeup source. Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky --- drivers/iommu/

[PATCH 3/5] iommu/amd: x2apic mode: setup the INTX registers on mask/unmask

2021-11-23 Thread Maxim Levitsky
This is more logically correct and will also allow us to to use mask/unmask logic to restore INTX setttings after the resume from s3/s4. Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky --- drivers/iommu/amd/i

[PATCH 2/5] iommu/amd: x2apic mode: re-enable after resume

2021-11-23 Thread Maxim Levitsky
Otherwise it is guaranteed to not work after the resume... Fixes: 66929812955bb ("iommu/amd: Add support for X2APIC IOMMU interrupts") Signed-off-by: Maxim Levitsky --- drivers/iommu/amd/init.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/iommu/am

[PATCH 1/5] iommu/amd: restore GA log/tail pointer on host resume

2021-11-23 Thread Maxim Levitsky
This will give IOMMU GA log a chance to work after resume from s3/s4. Fixes: 8bda0cfbdc1a6 ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Maxim Levitsky --- drivers/iommu/amd/init.c | 31 +++ 1 file changed, 15 insertions(+), 16

[PATCH 0/5] iommu/amd: fixes for suspend/resume

2021-11-23 Thread Maxim Levitsky
laptop with 4650U (which has the same issue) (I tested only INTX mode) Patch 1 is a small refactoring to remove an unused struct field. Best regards, Maxim Levitsky Maxim Levitsky (5): iommu/amd: restore GA log/tail pointer on host resume iommu/amd: x2apic mode: re-enable after resume iommu

Re: [PATCH v2] iommu/amd: Restore IRTE.RemapEn bit for amd_iommu_activate_guest_mode

2020-09-16 Thread Maxim Levitsky
r the amd_iommu_activate_guest_mode(). > Otherwise, this could trigger IO_PAGE_FAULT for the VFIO based VMs with > AVIC enabled. > > Reported-by: Maxim Levitsky > Tested-by: Maxim Levitsky > Cc: Joao Martins > Fixes: e52d58d54a321 ("iommu/amd: Use cmpxchg_dou

Re: [PATCH] iommu/amd: fix interrupt remapping for avic

2020-09-15 Thread Maxim Levitsky
On Mon, 2020-09-14 at 21:48 +0700, Suravee Suthikulpanit wrote: > Maxim, > > On 9/13/2020 7:42 PM, Maxim Levitsky wrote: > > Commit e52d58d54a32 ("iommu/amd: Use cmpxchg_double() when updating 128-bit > > IRTE") > > accidentally removed an assumption tha

[PATCH] iommu/amd: fix interrupt remapping for avic

2020-09-13 Thread Maxim Levitsky
bled would eventually crash and show IOMMU errors like that: AMD-Vi: Event logged [IO_PAGE_FAULT domain=0x0055 address=0xfffdf800 flags=0x0008] Fixes: e52d58d54a321 ("iommu/amd: Use cmpxchg_double() when updating 128-bit IRTE") Signed-off-by: Maxim Levitsky --- drivers/iommu/