lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200709215046.GJ199122@xz-x1>
Date:   Thu, 9 Jul 2020 17:50:46 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>
Cc:     Paolo Bonzini <pbonzini@...hat.com>, linux-kernel@...r.kernel.org,
        kvm@...r.kernel.org, Vitaly Kuznetsov <vkuznets@...hat.com>
Subject: Re: [PATCH 1/2] KVM: X86: Move ignore_msrs handling upper the stack

On Thu, Jul 09, 2020 at 02:26:52PM -0700, Sean Christopherson wrote:
> On Thu, Jul 09, 2020 at 05:09:19PM -0400, Peter Xu wrote:
> > Again, using host_initiated or not should be a different issue?  Frankly
> > speaking, I don't know whether it's an issue or not, but it's different from
> > what this series wants to do, because it'll be the same before/after this
> > series. Am I right?
> 
> I'm arguing that the TSX thing should be
> 
> diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c
> index 5eb618dbf211..e1fd5ac0df96 100644
> --- a/arch/x86/kvm/cpuid.c
> +++ b/arch/x86/kvm/cpuid.c
> @@ -1015,7 +1015,7 @@ bool kvm_cpuid(struct kvm_vcpu *vcpu, u32 *eax, u32 *ebx,
>                 *edx = entry->edx;
>                 if (function == 7 && index == 0) {
>                         u64 data;
> -                       if (!__kvm_get_msr(vcpu, MSR_IA32_TSX_CTRL, &data, true) &&
> +                       if (!kvm_get_msr(vcpu, MSR_IA32_TSX_CTRL, &data) &&
>                             (data & TSX_CTRL_CPUID_CLEAR))
>                                 *ebx &= ~(F(RTM) | F(HLE));
>                 }
> 
> At which point hoisting the ignored message up a few levels is pointless
> because the only users of __kvm_*et_msr() will do the explicit ignored_check.
> And I'm also arguing that KVM should never use __kvm_get_msr() for its own
> actions, as host_initiated=true should only be used for host VMM accesses and
> host_initiated=false actions should go through the proper checks and never
> get to the ignored_msrs logic (assuming no KVM bug).
> 
> > Or, please explain what's the "overruled objection" that you're talking about..
> 
> Sean: Objection your honor.
> Paolo: Overruled, you're wrong.
> Sean: Phooey.
> 
> My point is that even though I still object to this series, Paolo has final
> say.

I could be wrong, but I feel like Paolo was really respecting your input, as
always. It's just as simple as a 2:1 vote, isn't it? (I can still count myself
in for the vote, right? :)

Btw, you didn't reply to my other email:

  https://lore.kernel.org/kvm/20200626191118.GC175520@xz-x1/

Let me change the question a bit - Do you think e.g. we should never use
rdmsr*_safe() in the Linux kernel as long as the MSR has a bit somewhere
telling whether the MSR exists (so we should never trigger #GP on these MSRs)?
I think it's a similar question that we're discussing here..

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ