[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9oSD-XkYaozFAiDnr1n4qBjTb8febw5mt6LS_DfzLUo7A@mail.gmail.com>
Date: Tue, 7 Dec 2021 18:35:47 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
"Theodore Ts'o" <tytso@....edu>,
Thomas Gleixner <tglx@...utronix.de>,
Peter Zijlstra <peterz@...radead.org>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Dexuan Cui <decui@...rosoft.com>,
"H . Peter Anvin" <hpa@...or.com>,
Haiyang Zhang <haiyangz@...rosoft.com>,
Ingo Molnar <mingo@...hat.com>,
"K . Y . Srinivasan" <kys@...rosoft.com>,
Stephen Hemminger <sthemmin@...rosoft.com>,
Wei Liu <wei.liu@...nel.org>, linux-hyperv@...r.kernel.org,
X86 ML <x86@...nel.org>,
Sultan Alsawaf <sultan@...neltoast.com>
Subject: Re: [PATCH 1/5] random: Remove unused irq_flags argument from add_interrupt_randomness().
On Tue, Dec 7, 2021 at 1:17 PM Sebastian Andrzej Siewior
<bigeasy@...utronix.de> wrote:
>
> Since commit
> ee3e00e9e7101 ("random: use registers from interrupted code for CPU's w/o a cycle counter")
>
> the irq_flags argument is no longer used.
>
> Remove unused irq_flags irq_flags.
>
> Cc: Borislav Petkov <bp@...en8.de>
> Cc: Dave Hansen <dave.hansen@...ux.intel.com>
> Cc: Dexuan Cui <decui@...rosoft.com>
> Cc: H. Peter Anvin <hpa@...or.com>
> Cc: Haiyang Zhang <haiyangz@...rosoft.com>
> Cc: Ingo Molnar <mingo@...hat.com>
> Cc: K. Y. Srinivasan <kys@...rosoft.com>
> Cc: Stephen Hemminger <sthemmin@...rosoft.com>
> Cc: Thomas Gleixner <tglx@...utronix.de>
> Cc: Wei Liu <wei.liu@...nel.org>
> Cc: linux-hyperv@...r.kernel.org
> Cc: x86@...nel.org
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
> ---
> arch/x86/kernel/cpu/mshyperv.c | 2 +-
> drivers/char/random.c | 4 ++--
> drivers/hv/vmbus_drv.c | 2 +-
> include/linux/random.h | 2 +-
> kernel/irq/handle.c | 2 +-
> 5 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/arch/x86/kernel/cpu/mshyperv.c b/arch/x86/kernel/cpu/mshyperv.c
> index ff55df60228f7..2a0f836789118 100644
> --- a/arch/x86/kernel/cpu/mshyperv.c
> +++ b/arch/x86/kernel/cpu/mshyperv.c
> @@ -79,7 +79,7 @@ DEFINE_IDTENTRY_SYSVEC(sysvec_hyperv_stimer0)
> inc_irq_stat(hyperv_stimer0_count);
> if (hv_stimer0_handler)
> hv_stimer0_handler();
> - add_interrupt_randomness(HYPERV_STIMER0_VECTOR, 0);
> + add_interrupt_randomness(HYPERV_STIMER0_VECTOR);
> ack_APIC_irq();
>
> set_irq_regs(old_regs);
> diff --git a/drivers/char/random.c b/drivers/char/random.c
> index 605969ed0f965..c8067c264a880 100644
> --- a/drivers/char/random.c
> +++ b/drivers/char/random.c
> @@ -200,7 +200,7 @@
> * void add_device_randomness(const void *buf, unsigned int size);
> * void add_input_randomness(unsigned int type, unsigned int code,
> * unsigned int value);
> - * void add_interrupt_randomness(int irq, int irq_flags);
> + * void add_interrupt_randomness(int irq);
> * void add_disk_randomness(struct gendisk *disk);
> *
> * add_device_randomness() is for adding data to the random pool that
> @@ -1242,7 +1242,7 @@ static __u32 get_reg(struct fast_pool *f, struct pt_regs *regs)
> return *ptr;
> }
>
> -void add_interrupt_randomness(int irq, int irq_flags)
> +void add_interrupt_randomness(int irq)
> {
> struct entropy_store *r;
> struct fast_pool *fast_pool = this_cpu_ptr(&irq_randomness);
> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
> index 392c1ac4f8193..7ae04ccb10438 100644
> --- a/drivers/hv/vmbus_drv.c
> +++ b/drivers/hv/vmbus_drv.c
> @@ -1381,7 +1381,7 @@ static void vmbus_isr(void)
> tasklet_schedule(&hv_cpu->msg_dpc);
> }
>
> - add_interrupt_randomness(vmbus_interrupt, 0);
> + add_interrupt_randomness(vmbus_interrupt);
> }
>
> static irqreturn_t vmbus_percpu_isr(int irq, void *dev_id)
> diff --git a/include/linux/random.h b/include/linux/random.h
> index f45b8be3e3c4e..c45b2693e51fb 100644
> --- a/include/linux/random.h
> +++ b/include/linux/random.h
> @@ -35,7 +35,7 @@ static inline void add_latent_entropy(void) {}
>
> extern void add_input_randomness(unsigned int type, unsigned int code,
> unsigned int value) __latent_entropy;
> -extern void add_interrupt_randomness(int irq, int irq_flags) __latent_entropy;
> +extern void add_interrupt_randomness(int irq) __latent_entropy;
>
> extern void get_random_bytes(void *buf, int nbytes);
> extern int wait_for_random_bytes(void);
> diff --git a/kernel/irq/handle.c b/kernel/irq/handle.c
> index 27182003b879c..68c76c3caaf55 100644
> --- a/kernel/irq/handle.c
> +++ b/kernel/irq/handle.c
> @@ -197,7 +197,7 @@ irqreturn_t handle_irq_event_percpu(struct irq_desc *desc)
>
> retval = __handle_irq_event_percpu(desc, &flags);
>
> - add_interrupt_randomness(desc->irq_data.irq, flags);
> + add_interrupt_randomness(desc->irq_data.irq);
>
> if (!irq_settings_no_debug(desc))
> note_interrupt(desc, retval);
> --
> 2.34.1
>
Thanks for this. Sultan noticed the same thing a while back:
https://lore.kernel.org/lkml/20180430031222.mapajgwprkkr6p36@sultan-box/
I'll apply this and the subsequent one.
Regards,
Jason
Powered by blists - more mailing lists