2023-09-15 17:17:24

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/sev: Make early_set_memory_decrypted() calls page aligned


* Steve Rutherford <[email protected]> wrote:

> early_set_memory_decrypted() assumes its parameters are page aligned.
> Non-page aligned calls result in additional pages being marked as
> decrypted via the encryption status hypercall, which results in
> consistent corruption of pages during live migration. Live
> migration requires accurate encryption status information to avoid
> migrating pages from the wrong perspective.
>
> Fixes: 4716276184ec ("X86/KVM: Decrypt shared per-cpu variables when SEV is active")
> Signed-off-by: Steve Rutherford <[email protected]>
> ---
> arch/x86/kernel/kvm.c | 14 +++++++++++++-
> 1 file changed, 13 insertions(+), 1 deletion(-)

I suppose this fix is going through the KVM tree, or should we pick it up
in the x86 tree?

Thanks,

Ingo


2023-09-16 06:30:23

by Steve Rutherford

[permalink] [raw]
Subject: Re: [PATCH] x86/sev: Make early_set_memory_decrypted() calls page aligned

I believe V3 of this fix was already merged into both x86 and Linus'
tree (I think as ac3f9c9f1b37edaa7d1a9b908bc79d843955a1a2, "x86/sev:
Make enc_dec_hypercall() accept a size instead of npages").


On Fri, Sep 15, 2023 at 4:59 AM Ingo Molnar <[email protected]> wrote:
>
>
> * Steve Rutherford <[email protected]> wrote:
>
> > early_set_memory_decrypted() assumes its parameters are page aligned.
> > Non-page aligned calls result in additional pages being marked as
> > decrypted via the encryption status hypercall, which results in
> > consistent corruption of pages during live migration. Live
> > migration requires accurate encryption status information to avoid
> > migrating pages from the wrong perspective.
> >
> > Fixes: 4716276184ec ("X86/KVM: Decrypt shared per-cpu variables when SEV is active")
> > Signed-off-by: Steve Rutherford <[email protected]>
> > ---
> > arch/x86/kernel/kvm.c | 14 +++++++++++++-
> > 1 file changed, 13 insertions(+), 1 deletion(-)
>
> I suppose this fix is going through the KVM tree, or should we pick it up
> in the x86 tree?
>
> Thanks,
>
> Ingo

2023-09-16 12:15:19

by Ingo Molnar

[permalink] [raw]
Subject: Re: [PATCH] x86/sev: Make early_set_memory_decrypted() calls page aligned


* Steve Rutherford <[email protected]> wrote:

> I believe V3 of this fix was already merged into both x86 and Linus'
> tree (I think as ac3f9c9f1b37edaa7d1a9b908bc79d843955a1a2, "x86/sev:
> Make enc_dec_hypercall() accept a size instead of npages").

Erm ... indeed, and I forgot to mark the old v1 thread as read and then
promptly forgot about it all ... ;-)

Thanks,

Ingo