[PATCH 2/2] arm_sdei: remove the set_fs calls in sdei_event_handler

From: Christoph Hellwig
Date: Tue Apr 14 2020 - 10:23:29 EST


There are only two callbacks that can be called, which both
eventually end up calling __ghes_sdei_callback.

__ghes_sdei_callback calls irq_work_queue which is a normal
kernel helper called from all kinds of contexts and
ghes_in_nmi_queue_one_entry. ghes_in_nmi_queue_one_entry is
also called from other code without messing with the address
limit, so it better work without it.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
drivers/firmware/arm_sdei.c | 7 -------
1 file changed, 7 deletions(-)

diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c
index bdd6461647d7..1c51b378dfca 100644
--- a/drivers/firmware/arm_sdei.c
+++ b/drivers/firmware/arm_sdei.c
@@ -1137,19 +1137,12 @@ int sdei_event_handler(struct pt_regs *regs,
struct sdei_registered_event *arg)
{
int err;
- mm_segment_t orig_addr_limit;
u32 event_num = arg->event_num;

- orig_addr_limit = get_fs();
- set_fs(USER_DS);
-
err = arg->callback(event_num, regs, arg->callback_arg);
if (err)
pr_err_ratelimited("event %u on CPU %u failed with error: %d\n",
event_num, smp_processor_id(), err);
-
- set_fs(orig_addr_limit);
-
return err;
}
NOKPROBE_SYMBOL(sdei_event_handler);
--
2.25.1