2020-01-21 08:43:12

by Alex Shi

[permalink] [raw]
Subject: [PATCH] x86/iperm: remove unused pointers

No one use the prev/next pointers in its function after commit 22fe5b0439dd
("x86/ioperm: Move TSS bitmap update to exit to user work"). So better to
remove them.

Signed-off-by: Alex Shi <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Borislav Petkov <[email protected]>
Cc: "H. Peter Anvin" <[email protected]>
Cc: [email protected]
Cc: Andy Lutomirski <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Dave Hansen <[email protected]>
Cc: Waiman Long <[email protected]>
Cc: Marcelo Tosatti <[email protected]>
Cc: [email protected]
---
arch/x86/kernel/process.c | 4 ----
1 file changed, 4 deletions(-)

diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
index 61e93a318983..839b5244e3b7 100644
--- a/arch/x86/kernel/process.c
+++ b/arch/x86/kernel/process.c
@@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)

void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
{
- struct thread_struct *prev, *next;
unsigned long tifp, tifn;

- prev = &prev_p->thread;
- next = &next_p->thread;
-
tifn = READ_ONCE(task_thread_info(next_p)->flags);
tifp = READ_ONCE(task_thread_info(prev_p)->flags);

--
1.8.3.1


2020-01-21 14:17:23

by Waiman Long

[permalink] [raw]
Subject: Re: [PATCH] x86/iperm: remove unused pointers

On 1/21/20 3:40 AM, Alex Shi wrote:
> No one use the prev/next pointers in its function after commit 22fe5b0439dd
> ("x86/ioperm: Move TSS bitmap update to exit to user work"). So better to
> remove them.
>
> Signed-off-by: Alex Shi <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: [email protected]
> Cc: Andy Lutomirski <[email protected]>
> Cc: Rik van Riel <[email protected]>
> Cc: Dave Hansen <[email protected]>
> Cc: Waiman Long <[email protected]>
> Cc: Marcelo Tosatti <[email protected]>
> Cc: [email protected]
> ---
> arch/x86/kernel/process.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 61e93a318983..839b5244e3b7 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
>
> void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
> {
> - struct thread_struct *prev, *next;
> unsigned long tifp, tifn;
>
> - prev = &prev_p->thread;
> - next = &next_p->thread;
> -
> tifn = READ_ONCE(task_thread_info(next_p)->flags);
> tifp = READ_ONCE(task_thread_info(prev_p)->flags);
>

Acked-by: Waiman Long <[email protected]>

2020-01-22 13:17:27

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH] x86/iperm: remove unused pointers

On Tue, Jan 21, 2020 at 04:40:54PM +0800, Alex Shi wrote:
> No one use the prev/next pointers in its function after commit 22fe5b0439dd
> ("x86/ioperm: Move TSS bitmap update to exit to user work"). So better to
> remove them.
>
> Signed-off-by: Alex Shi <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Ingo Molnar <[email protected]>
> Cc: Borislav Petkov <[email protected]>
> Cc: "H. Peter Anvin" <[email protected]>
> Cc: [email protected]
> Cc: Andy Lutomirski <[email protected]>
> Cc: Rik van Riel <[email protected]>
> Cc: Dave Hansen <[email protected]>
> Cc: Waiman Long <[email protected]>
> Cc: Marcelo Tosatti <[email protected]>
> Cc: [email protected]
> ---
> arch/x86/kernel/process.c | 4 ----
> 1 file changed, 4 deletions(-)
>
> diff --git a/arch/x86/kernel/process.c b/arch/x86/kernel/process.c
> index 61e93a318983..839b5244e3b7 100644
> --- a/arch/x86/kernel/process.c
> +++ b/arch/x86/kernel/process.c
> @@ -615,12 +615,8 @@ void speculation_ctrl_update_current(void)
>
> void __switch_to_xtra(struct task_struct *prev_p, struct task_struct *next_p)
> {
> - struct thread_struct *prev, *next;
> unsigned long tifp, tifn;
>
> - prev = &prev_p->thread;
> - next = &next_p->thread;
> -
> tifn = READ_ONCE(task_thread_info(next_p)->flags);
> tifp = READ_ONCE(task_thread_info(prev_p)->flags);
>
> --

https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?h=x86/cleanups&id=27353d5785bca61bb49cfd7c78e14f1d21e66ec5

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette