linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL] Final KVM fix for Linux 6.7
@ 2024-01-04 15:48 Paolo Bonzini
  2024-01-05 17:21 ` Linus Torvalds
  2024-01-05 18:10 ` pr-tracker-bot
  0 siblings, 2 replies; 6+ messages in thread
From: Paolo Bonzini @ 2024-01-04 15:48 UTC (permalink / raw)
  To: torvalds; +Cc: linux-kernel, kvm, peterz, paulmck

Linus,

The following changes since commit ac865f00af293d081356bec56eea90815094a60e:

  Merge tag 'pci-v6.7-fixes-2' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci (2024-01-03 14:18:57 -0800)

are available in the Git repository at:

  https://git.kernel.org/pub/scm/virt/kvm/kvm.git tags/for-linus

for you to fetch changes up to 971079464001c6856186ca137778e534d983174a:

  KVM: x86/pmu: fix masking logic for MSR_CORE_PERF_GLOBAL_CTRL (2024-01-04 16:31:27 +0100)

This is technically not a KVM patch, but I am sending it anyway considering that:

- the patch is doing nothing but undoing a Boolean logic brain fart, restoring
  the pre-6.0 logic

- the function is literally called intel_guest_get_msrs and I am touching only
  the "guest" field, so the non-KVM effects are clearly nil

- this part of the file is often marked as "KVM" in the commit summaries, and
  sent via the KVM tree with Acked-by (usually from PeterZ, whom I am CCing)

- we are pretty close to the release but many people are still in Christmas
  vacation mode/mood

- the bug is not theoretical, Paul described the reproducer as triggering
  "rarely but intolerably often"

- writing this explanation almost took more time than writing the patch,
  thus proving that I reaallyy would like this in 6.7

Thanks,

Paolo

----------------------------------------------------------------
* Fix Boolean logic in intel_guest_get_msrs

----------------------------------------------------------------
Paolo Bonzini (1):
      KVM: x86/pmu: fix masking logic for MSR_CORE_PERF_GLOBAL_CTRL

 arch/x86/events/intel/core.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Final KVM fix for Linux 6.7
  2024-01-04 15:48 [GIT PULL] Final KVM fix for Linux 6.7 Paolo Bonzini
@ 2024-01-05 17:21 ` Linus Torvalds
  2024-01-05 17:29   ` Sean Christopherson
  2024-01-05 18:10 ` pr-tracker-bot
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2024-01-05 17:21 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: linux-kernel, kvm, peterz, paulmck

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Final KVM fix for Linux 6.7
  2024-01-05 17:21 ` Linus Torvalds
@ 2024-01-05 17:29   ` Sean Christopherson
  2024-01-05 17:35     ` Paolo Bonzini
  2024-01-05 17:38     ` Linus Torvalds
  0 siblings, 2 replies; 6+ messages in thread
From: Sean Christopherson @ 2024-01-05 17:29 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Paolo Bonzini, linux-kernel, kvm, peterz, paulmck

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 :-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Final KVM fix for Linux 6.7
  2024-01-05 17:29   ` Sean Christopherson
@ 2024-01-05 17:35     ` Paolo Bonzini
  2024-01-05 17:38     ` Linus Torvalds
  1 sibling, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2024-01-05 17:35 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Linus Torvalds, linux-kernel, kvm, peterz, paulmck

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Final KVM fix for Linux 6.7
  2024-01-05 17:29   ` Sean Christopherson
  2024-01-05 17:35     ` Paolo Bonzini
@ 2024-01-05 17:38     ` Linus Torvalds
  1 sibling, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2024-01-05 17:38 UTC (permalink / raw)
  To: Sean Christopherson; +Cc: Paolo Bonzini, linux-kernel, kvm, peterz, paulmck

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [GIT PULL] Final KVM fix for Linux 6.7
  2024-01-04 15:48 [GIT PULL] Final KVM fix for Linux 6.7 Paolo Bonzini
  2024-01-05 17:21 ` Linus Torvalds
@ 2024-01-05 18:10 ` pr-tracker-bot
  1 sibling, 0 replies; 6+ messages in thread
From: pr-tracker-bot @ 2024-01-05 18:10 UTC (permalink / raw)
  To: Paolo Bonzini; +Cc: torvalds, linux-kernel, kvm, peterz, paulmck

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!

-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/prtracker.html

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-01-05 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-04 15:48 [GIT PULL] Final KVM fix for Linux 6.7 Paolo Bonzini
2024-01-05 17:21 ` Linus Torvalds
2024-01-05 17:29   ` Sean Christopherson
2024-01-05 17:35     ` Paolo Bonzini
2024-01-05 17:38     ` Linus Torvalds
2024-01-05 18:10 ` pr-tracker-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).