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

Christian Zigotzky chzigotzky at xenosoft.de
Tue Dec 24 22:05:06 AEDT 2024


On 23/12/24 16:37, Paolo Bonzini wrote:
>
>
> On Mon, Dec 23, 2024 at 3:41 PM Christian Zigotzky 
> <chzigotzky at xenosoft.de> wrote:
>> Bisecting: a merge base must be tested
>> [e9001a382fa2c256229adc68d55212028b01d515] Merge tag
>> 'kvmarm-fixes-6.12-3' of
>> git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
>>
>> The host system doesn't boot.
>> Unfortunately, there isn't a guest kernel boot log via serial log.
>
> No big deal since the boot hang was fixed via rebase.
>
>>      git checkout -b bisection-rebase
>> b467ab82a9fde4b46c0cd2c299220857afb0e0d4
>>      git rebase v6.12
>>
>> The host kernel boots but the guest kernel doesn't boot so KVM HV
>> doesn't work.
>
> As expected, so that's good.
>
>>      git bisect start
>>      git bisect bad bisection-rebase
>>      git bisect good v6.12
>>
>> [skipping bisection process]
>>
>> `edebc0a1b7ab5ff19b4f5cd011c93196fc34b3e4 is the first bad commit
>
> Ok, that means that the culprit is commit 419cfb983ca93 (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 <pbonzini at redhat.com>
> Subject: [PATCH] KVM: allow  NULL writable argument to __kvm_faultin_pfn
>
> kvm_follow_pfn() is able to work with NULL in the .map_writable field
> of the homonymous struct.  But __kvm_faultin_pfn() rejects the combo
> despite KVM for e500 trying to use it.  Indeed .map_writable is not
> particularly useful if the flags include FOLL_WRITE and readonly
> guest memory is not supported, so add support to __kvm_faultin_pfn()
> for this case.
>
> Fixes: 1c7b627e9306 ("KVM: Add kvm_faultin_pfn() to specifically 
> service guest page faults")
> Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
>
> 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_faultin_pfn(const struct 
> kvm_memory_slot *slot, gfn_t gfn,
>          .refcounted_page = refcounted_page,
>      };
>
> -    if (WARN_ON_ONCE(!writable || !refcounted_page))
> +    if (WARN_ON_ONCE(!refcounted_page))
>          return KVM_PFN_ERR_FAULT;
>
> -    *writable = false;
> +    if (writable)
> +        *writable = false;
>      *refcounted_page = NULL;
>
>      return kvm_follow_pfn(&kfp);
>
> Thanks,
>
> Paolo

Hello Paolo,

Thanks a lot for your patch.

I tested it with the RC4 of kernel 6.13 today but unfortunately it 
doesn't solve the KVM HV issue. The guest system doesn't boot and I 
can't see any error messages. (console=ttyS0)

Regards,

Christian

-- 
Sent with BrassMonkey 33.4.0 (https://github.com/wicknix/brass-monkey/releases/tag/33.4.0)



More information about the Linuxppc-dev mailing list