• Alexander Graf's avatar
    KVM: PPC: Move Shadow MSR calculation to function · a76f8497
    Alexander Graf authored
    We keep a copy of the MSR around that we use when we go into the guest context.
    
    That copy is basically the normal process MSR flags OR some allowed guest
    specified MSR flags. We also AND the external providers into this, so we get
    traps on FPU usage when we haven't activated it on the host yet.
    
    Currently this calculation is part of the set_msr function that we use whenever
    we set the guest MSR value. With the external providers, we also have the case
    that we don't modify the guest's MSR, but only want to update the shadow MSR.
    
    So let's move the shadow MSR parts to a separate function that we then use
    whenever we only need to update it. That way we don't accidently kvm_vcpu_block
    within a preempt notifier context.
    Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
    Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
    a76f8497
book3s.c 30.6 KB