Re: KVM: PPC: Book3E: KVM HV host module doesn't work anymore

2024-12-22 Thread Paolo Bonzini
On 12/20/24 13:48, Christian Zigotzky wrote: Maybe the kvm updates [1] from Paolo Bonzini are responsible for this issue. + Paolo Bonzini I have found some changes in the e500_mmu_host.c file (a/arch/powerpc/ kvm/e500_mmu_host.c) in the kvm updates [1]. -- Christian [1] https

Re: KVM: PPC: Book3E: KVM HV host module doesn't work anymore

2024-12-22 Thread Paolo Bonzini
On Sun, Dec 22, 2024 at 5:24 PM Christian Zigotzky wrote: > Hello Paolo, > > I tried it but there is a host boot issue at the same time. Bisect log: > https://github.com/chzigotzky/kernels/issues/4 Thanks, I left there some instructions which I'll copy here for reference. We need to bisect the h

[PATCH 5/5] KVM: e500: perform hugepage check after looking up the PFN

2025-01-12 Thread Paolo Bonzini
after __kvm_faultin_pfn() has returned. Then find the largest size that will satisfy the guest's request while staying within a single host PTE. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500_mmu_host.c | 178 --- 1 file changed, 69 insertions(+)

[PATCH 4/5] KVM: e500: map readonly host pages for read

2025-01-12 Thread Paolo Bonzini
s forcibly mapped read-only. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500_mmu_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index b1be39639d4a..b38679e5821b 100644 --- a/arch/p

[PATCH 2/5] KVM: e500: use shadow TLB entry as witness for writability

2025-01-12 Thread Paolo Bonzini
; second, because what really matters is whether the _shadow_ TLB entry is writable. If it is not writable, the page can be released as non-dirty. Shift from using tlbe_is_writable(gtlbe) to doing the same check on the shadow TLB entry. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm

[PATCH 3/5] KVM: e500: track host-writability of pages

2025-01-12 Thread Paolo Bonzini
Add the possibility of marking a page so that the UW and SW bits are force-cleared. This is stored in the private info so that it persists across multiple calls to kvmppc_e500_setup_stlbe. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500.h | 2 ++ arch/powerpc/kvm

[PATCH v2 0/5] KVM: e500: map readonly host pages for read, and cleanup

2025-01-12 Thread Paolo Bonzini
olo v1->v2: do not bother checking again that a memslot exists, instead add a fix to restore irqs even if !ptep Paolo Bonzini (5): KVM: e500: always restore irqs KVM: e500: use shadow TLB entry as witness for writability KVM: e500: track host-writability of pages KVM: e500:

[PATCH 1/5] KVM: e500: always restore irqs

2025-01-12 Thread Paolo Bonzini
If find_linux_pte fails, IRQs will not be restored. This is unlikely to happen in practice since it would have been reported as hanging hosts, but it should of course be fixed anyway. Cc: sta...@vger.kernel.org Reported-by: Sean Christopherson Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm

[PATCH] KVM: allow NULL writable argument to __kvm_faultin_pfn

2024-12-31 Thread Paolo Bonzini
ned-off-by: Paolo Bonzini --- virt/kvm/kvm_main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c index de2c11dae231..5177e56fdbd5 100644 --- a/virt/kvm/kvm_main.c +++ b/virt/kvm/kvm_main.c @@ -2975,10 +2975,11 @@ kvm_pfn_t __kvm_f

Re: KVM: PPC: Book3E: KVM HV host module doesn't work anymore

2024-12-23 Thread Paolo Bonzini
ca93 (the above is the rebased hash). Thank you very much, your work was really helpful! Can you test this simple patch? ------- 8< From: Paolo Bonzini Subject: [PATCH] KVM: allow NULL writable argument to __kvm_faultin_pfn kvm_follow_pfn() is able to work with

[PATCH 3/5] KVM: e500: track host-writability of pages

2025-01-09 Thread Paolo Bonzini
Add the possibility of marking a page so that the UW and SW bits are force-cleared. This is stored in the private info so that it persists across multiple calls to kvmppc_e500_setup_stlbe. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500.h | 2 ++ arch/powerpc/kvm

[PATCH 4/5] KVM: e500: map readonly host pages for read

2025-01-09 Thread Paolo Bonzini
s forcibly mapped read-only. Reported-by: Christian Zigotzky Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500_mmu_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kvm/e500_mmu_host.c b/arch/powerpc/kvm/e500_mmu_host.c index e332a10fff00..7752b7f24

[PATCH 2/5] KVM: e500: use shadow TLB entry as witness for writability

2025-01-09 Thread Paolo Bonzini
; second, because what really matters is whether the _shadow_ TLB entry is writable. If it is not writable, the page can be released as non-dirty. Shift from using tlbe_is_writable(gtlbe) to doing the same check on the shadow TLB entry. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm

[PATCH 5/5] KVM: e500: perform hugepage check after looking up the PFN

2025-01-09 Thread Paolo Bonzini
after __kvm_faultin_pfn() has returned. Then find the largest size that will satisfy the guest's request while staying within a single host PTE. Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500_mmu_host.c | 180 --- 1 file changed, 70 insertions(+)

[PATCH 0/5] KVM: e500: map readonly host pages for read, and cleanup

2025-01-09 Thread Paolo Bonzini
Christian, please test this as we do not have e500 hardware readily availabe. Thanks, Paolo Supersedes: <20250101064928.389504-1-pbonz...@redhat.com> Paolo Bonzini (5): KVM: e500: retry if no memslot is found KVM: e500: use shadow TLB entry as witness for writability KVM: e500: track

[PATCH 1/5] KVM: e500: retry if no memslot is found

2025-01-09 Thread Paolo Bonzini
Avoid a NULL pointer dereference if the memslot table changes between the exit and the call to kvmppc_e500_shadow_map(). Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini --- arch/powerpc/kvm/e500_mmu_host.c | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/powerpc/kvm

Re: [PATCH 0/7] KVM: x86: nVMX IRQ fix and VM teardown cleanups

2025-02-26 Thread Paolo Bonzini
On 2/25/25 00:55, Sean Christopherson wrote: This was _supposed_ to be a tiny one-off patch to fix a nVMX bug where KVM fails to detect that, after nested VM-Exit, L1 has a pending IRQ (or NMI). But because x86's nested teardown flows are garbage (KVM simply forces a nested VM-Exit to put the vCP

Re: [PATCH 1/7] KVM: x86: Free vCPUs before freeing VM state

2025-02-25 Thread Paolo Bonzini
On 2/25/25 00:55, Sean Christopherson wrote: Free vCPUs before freeing any VM state, as both SVM and VMX may access VM state when "freeing" a vCPU that is currently "in" L2, i.e. that needs to be kicked out of nested guest mode. Commit 6fcee03df6a1 ("KVM: x86: avoid loading a vCPU after .vm_dest

Re: [PATCH 1/7] KVM: x86: Free vCPUs before freeing VM state

2025-02-26 Thread Paolo Bonzini
On Wed, Feb 26, 2025 at 1:27 AM Sean Christopherson wrote: > > On Wed, Feb 26, 2025, Paolo Bonzini wrote: > > On 2/25/25 00:55, Sean Christopherson wrote: > > > Free vCPUs before freeing any VM state, as both SVM and VMX may access > > > VM state when "freein

Re: [Kernel 6.12.17] [PowerPC e5500] KVM HV compilation error

2025-03-05 Thread Paolo Bonzini
On Wed, Mar 5, 2025 at 3:19 PM Greg KH wrote: > On Wed, Mar 05, 2025 at 03:14:13PM +0100, Christian Zigotzky wrote: > > Hi All, > > > > The stable long-term kernel 6.12.17 cannot compile with KVM HV support for > > e5500 PowerPC machines anymore. > > > > Bug report: https://github.com/chzigotzky/

<    1   2   3   4