Skip to contentSkip to conversation

x86/fpu: remove unused macros

PATCH In review Alex Shi 3 participants 4 messages Jan 21, 2020 – Jan 22, 2020 x86

lore
Share & tools
lore

Alex Shi

author
#0 lore raw

PATCH 1/1 x86/fpu: remove unused macros

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

Cc Thomas Gleixner <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc "H. Peter Anvin" <[email protected]>
Cc Sebastian Andrzej Siewior <[email protected]>
Cc Cyrill Gorcunov <[email protected]>
Cc Dave Hansen <[email protected]>
Cc Pankaj Bharadiya <[email protected]>
Cc Aubrey Li <[email protected]>
---
 arch/x86/kernel/fpu/xstate.c | 2 --
 1 file changed, 2 deletions(-)
arch/x86/kernel/fpu/xstate.c +0 -2
index fa31470bbf24..73c3e2e72a88 100644
@@ -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.
Signature · 1 line
1.8.3.1
#1 lore raw
Quoted 2 lines · Alex Shi

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

#2 lore raw
Quoted 8 lines · Cyrill Gorcunov
Quoted 2 lines · Alex Shi

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.

#3 lore raw
Quoted 8 lines · Dave Hansen

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!