[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALMp9eR6tORQsSm6fGYumY9QrQVHTo3BxempwYRyOEYrv+zHew@mail.gmail.com>
Date: Mon, 6 Dec 2021 20:49:02 -0800
From: Jim Mattson <jmattson@...gle.com>
To: Marc Orr <marcorr@...gle.com>
Cc: pbonzini@...hat.com, seanjc@...gle.com, vkuznets@...hat.com,
wanpengli@...cent.com, joro@...tes.org, tglx@...utronix.de,
mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com,
x86@...nel.org, hpa@...or.com, thomas.lendacky@....com,
kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] KVM: x86: Always set kvm_run->if_flag
On Mon, Dec 6, 2021 at 8:31 PM Marc Orr <marcorr@...gle.com> wrote:
>
> The kvm_run struct's if_flag is apart of the userspace/kernel API. The
Typo: 'a part'.
> SEV-ES patches failed to set this flag because it's no longer needed by
> QEMU (according to the comment in the source code). However, other
> hypervisors may make use of this flag. Therefore, set the flag for
> guests with encrypted regiesters (i.e., with guest_state_protected set).
Typo: 'registers'.
> Fixes: f1c6366e3043 ("KVM: SVM: Add required changes to support intercepts under SEV-ES")
> Signed-off-by: Marc Orr <marcorr@...gle.com>
> ---
> - /*
> - * if_flag is obsolete and useless, so do not bother
> - * setting it for SEV-ES guests. Userspace can just
> - * use kvm_run->ready_for_interrupt_injection.
> - */
> - kvm_run->if_flag = !vcpu->arch.guest_state_protected
> - && (kvm_get_rflags(vcpu) & X86_EFLAGS_IF) != 0;
> -
> + kvm_run->if_flag = static_call(kvm_x86_get_if_flag)(vcpu);
I'm sorry that I missed that change when it first went by. Maintaining
backwards compatibility with existing userspace code is a fundamental
tenet of Linux kernel development.
Acked-by: Jim Mattson <jmattson@...gle.com>
Powered by blists - more mailing lists