[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <0689bda9-e91a-2b06-3dd6-f78572879296@redhat.com>
Date: Tue, 26 Jan 2021 19:23:12 +0100
From: Paolo Bonzini <pbonzini@...hat.com>
To: Chenyi Qiang <chenyi.qiang@...el.com>,
Sean Christopherson <sean.j.christopherson@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Xiaoyao Li <xiaoyao.li@...el.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC 5/7] KVM: MMU: Add support for PKS emulation
On 07/08/20 10:48, Chenyi Qiang wrote:
>
> if (pte_access & PT_USER_MASK)
> pkr_bits = (vcpu->arch.pkru >> (pte_pkey * 2)) & 3;
> + else if (!kvm_get_msr(vcpu, MSR_IA32_PKRS, &pkrs))
> + pkr_bits = (pkrs >> (pte_pkey * 2)) & 3;
You should be able to always use vcpu->arch.pkrs here. So
pkr = pte_access & PT_USER_MASK ? vcpu->arch.pkru : vcpu->arch.pkrs;
pkr_bits = (pkr >> pte_pkey * 2) & 3;
Paolo
Powered by blists - more mailing lists