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] [day] [month] [year] [list]
Message-ID: <2f4603f4c74ba21776ad6beff5f5b98025c99973.camel@intel.com>
Date: Tue, 24 Jun 2025 10:37:31 +0000
From: "Huang, Kai" <kai.huang@...el.com>
To: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"Neeraj.Upadhyay@....com" <Neeraj.Upadhyay@....com>
CC: "kvm@...r.kernel.org" <kvm@...r.kernel.org>, "tiala@...rosoft.com"
	<tiala@...rosoft.com>, "Vasant.Hegde@....com" <Vasant.Hegde@....com>,
	"Suravee.Suthikulpanit@....com" <Suravee.Suthikulpanit@....com>,
	"dave.hansen@...ux.intel.com" <dave.hansen@...ux.intel.com>,
	"Thomas.Lendacky@....com" <Thomas.Lendacky@....com>,
	"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>,
	"seanjc@...gle.com" <seanjc@...gle.com>, "mingo@...hat.com"
	<mingo@...hat.com>, "pbonzini@...hat.com" <pbonzini@...hat.com>,
	"tglx@...utronix.de" <tglx@...utronix.de>, "huibo.wang@....com"
	<huibo.wang@....com>, "Santosh.Shukla@....com" <Santosh.Shukla@....com>,
	"nikunj@....com" <nikunj@....com>, "hpa@...or.com" <hpa@...or.com>,
	"peterz@...radead.org" <peterz@...radead.org>, "bp@...en8.de" <bp@...en8.de>,
	"francescolavra.fl@...il.com" <francescolavra.fl@...il.com>,
	"naveen.rao@....com" <naveen.rao@....com>, "David.Kaplan@....com"
	<David.Kaplan@....com>, "x86@...nel.org" <x86@...nel.org>
Subject: Re: [RFC PATCH v7 18/37] x86/apic: Simplify bitwise operations on
 apic bitmap

On Tue, 2025-06-10 at 23:24 +0530, Neeraj Upadhyay wrote:
> Use 'regs' as a contiguous linear bitmap in  apic_{set|
					      ^
					      double whitespace here

> clear|test}_vector() while doing bitwise operations.
> This makes the code simpler by eliminating the need to
> determine the offset of the 32-bit register and the vector
> bit location within that register prior to performing
> bitwise operations.
> 
> This change results in slight increase in generated code
> size for gcc-14.2.

Seems the text wrap here is different from other patches, i.e., the
'textwidth' seems much smaller.

> 
> - Without change
> 
> apic_set_vector:

Perhaps add a blank line here to make it easier to read (also consistent
with below).

> 89 f8             mov    %edi,%eax
> 83 e7 1f          and    $0x1f,%edi
> c1 e8 05          shr    $0x5,%eax
> c1 e0 04          shl    $0x4,%eax
> 48 01 c6          add    %rax,%rsi
> f0 48 0f ab 3e    lock bts %rdi,(%rsi)
> c3                ret
> 
> - With change
> 
> apic_set_vector:
> 
> 89 f8             mov    %edi,%eax
> c1 e8 05          shr    $0x5,%eax
> 8d 04 40          lea    (%rax,%rax,2),%eax
> c1 e0 05          shl    $0x5,%eax
> 01 f8             add    %edi,%eax
> 89 c0             mov    %eax,%eax
> f0 48 0f ab 3e    lock bts %rax,(%rsi)
> c3                ret
> 
> But, lapic.o text size (bytes) decreases with this change:
> 
> Obj        Old-size      New-size
> 
> lapic.o    28832         28768
> 
> Signed-off-by: Neeraj Upadhyay <Neeraj.Upadhyay@....com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ