linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/fpu: remove unused macros
@ 2020-01-21  8:50 Alex Shi
  2020-01-21 11:43 ` Cyrill Gorcunov
  0 siblings, 1 reply; 4+ messages in thread
From: Alex Shi @ 2020-01-21  8:50 UTC (permalink / raw)
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	x86, Sebastian Andrzej Siewior, Cyrill Gorcunov, Dave Hansen,
	Pankaj Bharadiya, Aubrey Li, linux-kernel

NR_VALID_PKRU_BITS/PKRU_VALID_MASK are never used after it was
introduced. So better to remove them.

Signed-off-by: Alex Shi <alex.shi@linux.alibaba.com>
Cc: Thomas Gleixner <tglx@linutronix.de> 
Cc: Ingo Molnar <mingo@redhat.com> 
Cc: Borislav Petkov <bp@alien8.de> 
Cc: "H. Peter Anvin" <hpa@zytor.com> 
Cc: x86@kernel.org 
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> 
Cc: Cyrill Gorcunov <gorcunov@gmail.com> 
Cc: Dave Hansen <dave.hansen@intel.com> 
Cc: Pankaj Bharadiya <pankaj.laxminarayan.bharadiya@intel.com> 
Cc: Aubrey Li <aubrey.li@linux.intel.com> 
Cc: linux-kernel@vger.kernel.org 
---
 arch/x86/kernel/fpu/xstate.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
index fa31470bbf24..73c3e2e72a88 100644
--- a/arch/x86/kernel/fpu/xstate.c
+++ b/arch/x86/kernel/fpu/xstate.c
@@ -899,8 +899,6 @@ const void *get_xsave_field_ptr(int xfeature_nr)
 
 #ifdef CONFIG_ARCH_HAS_PKEYS
 
-#define NR_VALID_PKRU_BITS (CONFIG_NR_PROTECTION_KEYS * 2)
-#define PKRU_VALID_MASK (NR_VALID_PKRU_BITS - 1)
 /*
  * This will go out and modify PKRU register to set the access
  * rights for @pkey to @init_val.
-- 
1.8.3.1


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

* Re: [PATCH] x86/fpu: remove unused macros
  2020-01-21  8:50 [PATCH] x86/fpu: remove unused macros Alex Shi
@ 2020-01-21 11:43 ` Cyrill Gorcunov
  2020-01-21 23:07   ` Dave Hansen
  0 siblings, 1 reply; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-01-21 11:43 UTC (permalink / raw)
  To: Alex Shi
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	x86, Sebastian Andrzej Siewior, Dave Hansen, Pankaj Bharadiya,
	Aubrey Li, linux-kernel

On Tue, Jan 21, 2020 at 04:50:11PM +0800, Alex Shi wrote:
> NR_VALID_PKRU_BITS/PKRU_VALID_MASK are never used after it was
> introduced. So better to remove them.

Dave moved them in so while they are not used indeed better to
get approve from him (to be sure they were not reserved for
future development).

Initial commit 8459429693395ca9e8d18101300b120ad9171795

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

* Re: [PATCH] x86/fpu: remove unused macros
  2020-01-21 11:43 ` Cyrill Gorcunov
@ 2020-01-21 23:07   ` Dave Hansen
  2020-01-22  6:51     ` Cyrill Gorcunov
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Hansen @ 2020-01-21 23:07 UTC (permalink / raw)
  To: Cyrill Gorcunov, Alex Shi
  Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov, H. Peter Anvin,
	x86, Sebastian Andrzej Siewior, Pankaj Bharadiya, Aubrey Li,
	linux-kernel

On 1/21/20 3:43 AM, Cyrill Gorcunov wrote:
> On Tue, Jan 21, 2020 at 04:50:11PM +0800, Alex Shi wrote:
>> NR_VALID_PKRU_BITS/PKRU_VALID_MASK are never used after it was
>> introduced. So better to remove them.
> Dave moved them in so while they are not used indeed better to
> get approve from him (to be sure they were not reserved for
> future development).
> 
> Initial commit 8459429693395ca9e8d18101300b120ad9171795

FWIW, I'm not a massive fan of blindly removing stuff like this.  Maybe
it's better to remove the cruft, but it's even better to try to figure
out why I might have added them in the first place. :)

I *think* it was an attempt to ensure that a resulting PKRU value can be
written to PKRU, independent of the type it was stored as.

Let me see if I can come up with something nicer than ripping these out.

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

* Re: [PATCH] x86/fpu: remove unused macros
  2020-01-21 23:07   ` Dave Hansen
@ 2020-01-22  6:51     ` Cyrill Gorcunov
  0 siblings, 0 replies; 4+ messages in thread
From: Cyrill Gorcunov @ 2020-01-22  6:51 UTC (permalink / raw)
  To: Dave Hansen
  Cc: Alex Shi, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
	H. Peter Anvin, x86, Sebastian Andrzej Siewior, Pankaj Bharadiya,
	Aubrey Li, linux-kernel

On Tue, Jan 21, 2020 at 03:07:23PM -0800, Dave Hansen wrote:
> FWIW, I'm not a massive fan of blindly removing stuff like this.  Maybe
> it's better to remove the cruft, but it's even better to try to figure
> out why I might have added them in the first place. :)
> 
> I *think* it was an attempt to ensure that a resulting PKRU value can be
> written to PKRU, independent of the type it was stored as.
> 
> Let me see if I can come up with something nicer than ripping these out.

Sure. Thanks a huge, Dave!

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

end of thread, other threads:[~2020-01-22  6:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-21  8:50 [PATCH] x86/fpu: remove unused macros Alex Shi
2020-01-21 11:43 ` Cyrill Gorcunov
2020-01-21 23:07   ` Dave Hansen
2020-01-22  6:51     ` Cyrill Gorcunov

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