lkml.org 
[lkml]   [2021]   [Dec]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [PATCH] KVM: x86: Always set kvm_run->if_flag
    On Mon, Dec 6, 2021 at 8:31 PM Marc Orr <marcorr@google.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@google.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@google.com>

    \
     
     \ /
      Last update: 2021-12-07 05:51    [W:2.639 / U:0.444 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site