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, 12 Oct 2023 12:26:49 +0200
From:   Lucy Mielke <lucymielke@...oud.com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     Peter Zijlstra <peterz@...radead.org>, mingo@...hat.com,
        acme@...nel.org, mark.rutland@....com,
        alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
        namhyung@...nel.org, irogers@...gle.com, adrian.hunter@...el.com,
        tglx@...utronix.de, bp@...en8.de, dave.hansen@...ux.intel.com,
        x86@...nel.org, hpa@...or.com, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH] perf/x86/p4: Fix "Wunused-but-set-variable" warning

Am Mon, Oct 09, 2023 at 09:29:50AM -0700 schrieb Sean Christopherson:
> 
> rdmsr() writes to "high", but nothing ever reads from high.  FWIW, I would _love_
> for rdmsrl() to have return semantics, e.g. to be able to do:
> 
> 	low  = (u32)rdmsrl(MSR_IA32_MISC_ENABLE);
> 
> or even
> 
> 	if (!(rdmsrl(MSR_IA32_MISC_ENABLE) & BIT(7)))

I have taken a look and it seems to me like this macro is called quite a lot
for different things thoughout the kernel tree, including drivers. If
one were to change it to have return semantics instead of the way it
currently works, you'd have to change around 300 occurences, right?
(Let me know if I misunderstood something.)

Return semantics or not, since the only way "high" is used in p4_pmu_init()
is by being written to by rdmsr(), the variable can be completely removed by
just using rdmsrl(). Would this be a patch you'd be interested in?

Mit freundlichen Grüßen / Best regards,
	Lucy

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ