Message ID | 20240104154844.129586-1-pbonzini@redhat.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [GIT,PULL] Final KVM fix for Linux 6.7 | expand |
On Thu, 4 Jan 2024 at 07:48, Paolo Bonzini <pbonzini@redhat.com> wrote: > > * Fix Boolean logic in intel_guest_get_msrs I think the intention of the original was to write this as .guest = intel_ctrl & ~(cpuc->intel_ctrl_host_mask | pebs_mask), but your version certainly works too. Pulled. Linus
On Fri, Jan 05, 2024, Linus Torvalds wrote: > On Thu, 4 Jan 2024 at 07:48, Paolo Bonzini <pbonzini@redhat.com> wrote: > > > > * Fix Boolean logic in intel_guest_get_msrs > > I think the intention of the original was to write this as > > .guest = intel_ctrl & ~(cpuc->intel_ctrl_host_mask | pebs_mask), > > but your version certainly works too. Ha! That's what I suggested too, clearly Paolo is the weird one :-)
On Fri, Jan 5, 2024 at 6:29 PM Sean Christopherson <seanjc@google.com> wrote: > > On Fri, Jan 05, 2024, Linus Torvalds wrote: > > On Thu, 4 Jan 2024 at 07:48, Paolo Bonzini <pbonzini@redhat.com> wrote: > > > > > > * Fix Boolean logic in intel_guest_get_msrs > > > > I think the intention of the original was to write this as > > > > .guest = intel_ctrl & ~(cpuc->intel_ctrl_host_mask | pebs_mask), > > > > but your version certainly works too. > > Ha! That's what I suggested too, clearly Paolo is the weird one :-) Not that I don't like your version; but since you hadn't provided (yet) a Signed-off-by I had not looked at the patch until now. In the end it's a coin toss between "fix what was clearly intended" and "restore the logic before the broken commit". I picked the latter because when trying to reverse engineer Linus's brain processes I tend to overthink these things. :) That counts as being weird, I guess. Paolo
On Fri, 5 Jan 2024 at 09:29, Sean Christopherson <seanjc@google.com> wrote: > > Ha! That's what I suggested too, clearly Paolo is the weird one :-) Well, it's technically one fewer operation to do it our way, but Paolo's version is (a) textually one character shorter (b) something the compiler can (and likely will) munge anyway, since boolean operation optimizations are common (c) with the 'andn' instruction, the "fewer operations" isn't necessarily fewer instructions Of course, we can't currently use 'andn' in kernel code due to it being much too new and requires BMI1. Plus the memory op version is the wrong way around (ie the "not" part of the op only works on register inputs), but _evenbtually_ that might have been an argument. Linus
The pull request you sent on Thu, 4 Jan 2024 16:48:44 +0100:
> https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/7987b8b75f1b0d00483629a0ba006dac81e227c8
Thank you!