[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <f1b01b4903564f2c8c267a3996e1ac29@huawei.com>
Date: Fri, 6 Mar 2020 02:17:08 +0000
From: linmiaohe <linmiaohe@...wei.com>
To: Paolo Bonzini <pbonzini@...hat.com>,
"vkuznets@...hat.com" <vkuznets@...hat.com>
CC: "rkrcmar@...hat.com" <rkrcmar@...hat.com>,
"sean.j.christopherson@...el.com" <sean.j.christopherson@...el.com>,
"jmattson@...gle.com" <jmattson@...gle.com>,
"joro@...tes.org" <joro@...tes.org>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"mingo@...hat.com" <mingo@...hat.com>,
"bp@...en8.de" <bp@...en8.de>, "hpa@...or.com" <hpa@...or.com>,
"kvm@...r.kernel.org" <kvm@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>
Subject: Re: [PATCH] KVM: VMX: Use wrapper macro
~RMODE_GUEST_OWNED_EFLAGS_BITS directly
Paolo Bonzini <pbonzini@...hat.com> wrote:
>On 05/03/20 03:35, linmiaohe wrote:
>> (X86_EFLAGS_IOPL | X86_EFLAGS_VM) indicates the eflag bits that can
>> not be owned by realmode guest, i.e. ~RMODE_GUEST_OWNED_EFLAGS_BITS.
>
>... but ~RMODE_GUEST_OWNED_EFLAGS_BITS is the bits that are owned by the host; they could be 0 or 1 and that's why the code was using X86_EFLAGS_IOPL | X86_EFLAGS_VM.
>
>I understand where ~RMODE_GUEST_OWNED_EFLAGS_BITS is better than X86_EFLAGS_IOPL | X86_EFLAGS_VM, but I cannot think of a way to express it that is the best of both worlds.
>
Define a macro RMODE_HOST_OWNED_EFLAGS_BITS for (X86_EFLAGS_IOPL | X86_EFLAGS_VM) as suggested by Vitaly seems a good way to fix this ? Thanks.
Powered by blists - more mailing lists