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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 18 Apr 2024 19:30:52 +0200
From: Thomas Gleixner <tglx@...utronix.de>
To: Jacob Pan <jacob.jun.pan@...ux.intel.com>, Sean Christopherson
 <seanjc@...gle.com>
Cc: LKML <linux-kernel@...r.kernel.org>, X86 Kernel <x86@...nel.org>, Peter
 Zijlstra <peterz@...radead.org>, iommu@...ts.linux.dev, Lu Baolu
 <baolu.lu@...ux.intel.com>, kvm@...r.kernel.org, Dave Hansen
 <dave.hansen@...el.com>, Joerg Roedel <joro@...tes.org>, "H. Peter Anvin"
 <hpa@...or.com>, Borislav Petkov <bp@...en8.de>, Ingo Molnar
 <mingo@...hat.com>, Paul Luse <paul.e.luse@...el.com>, Dan Williams
 <dan.j.williams@...el.com>, Jens
 Axboe <axboe@...nel.dk>, Raj Ashok <ashok.raj@...el.com>, Kevin Tian
 <kevin.tian@...el.com>, maz@...nel.org, Robin Murphy
 <robin.murphy@....com>, jim.harris@...sung.com, a.manzanares@...sung.com,
 Bjorn Helgaas <helgaas@...nel.org>, guang.zeng@...el.com,
 robert.hoo.linux@...il.com, jacob.jun.pan@...ux.intel.com,
 oliver.sang@...el.com
Subject: Re: [PATCH v2 03/13] x86/irq: Remove bitfields in posted interrupt
 descriptor

On Wed, Apr 17 2024 at 11:01, Jacob Pan wrote:
> On Tue, 16 Apr 2024 17:39:42 -0700, Sean Christopherson <seanjc@...gle.com>
> wrote:
>> > diff --git a/arch/x86/kvm/vmx/posted_intr.c
>> > b/arch/x86/kvm/vmx/posted_intr.c index af662312fd07..592dbb765675 100644
>> > --- a/arch/x86/kvm/vmx/posted_intr.c
>> > +++ b/arch/x86/kvm/vmx/posted_intr.c
>> > @@ -107,7 +107,7 @@ void vmx_vcpu_pi_load(struct kvm_vcpu *vcpu, int
>> > cpu)
>> >  		 * handle task migration (@cpu != vcpu->cpu).
>> >  		 */
>> >  		new.ndst = dest;
>> > -		new.sn = 0;
>> > +		new.notif_ctrl &= ~POSTED_INTR_SN;  
>> 
>> At the risk of creating confusing, would it make sense to add
>> double-underscore, non-atomic versions of the set/clear helpers for ON
>> and SN?
>> 
>> I can't tell if that's a net positive versus open coding clear() and
>> set() here and below.
> IMHO, we can add non-atomic helpers when we have more than one user for
> each operation.
>
> I do have a stupid bug here, it should be:
> -               new.notif_ctrl &= ~POSTED_INTR_SN;
> +               new.notif_ctrl &= ~BIT(POSTED_INTR_SN);

That's a perfect reason to use a proper helper.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ