[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <m2a5636hv5.wl-thehajime@gmail.com>
Date: Thu, 19 Jun 2025 21:22:38 +0900
From: Hajime Tazaki <thehajime@...il.com>
To: benjamin@...solutions.net
Cc: linux-um@...ts.infradead.org,
ricarkol@...gle.com,
Liam.Howlett@...cle.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v9 06/13] x86/um: nommu: process/thread handling
Hello,
On Thu, 19 Jun 2025 19:36:04 +0900,
Benjamin Berg wrote:
> > +void arch_switch_to(struct task_struct *to)
> > +{
> > + /*
> > + * In !CONFIG_MMU, it doesn't ptrace thus,
> > + * The FS_BASE/GS_BASE registers are saved here.
> > + */
> > + current_top_of_stack = task_top_of_stack(to);
> > + current_ptregs = (long)task_pt_regs(to);
> > +
> > + if ((to->thread.regs.regs.gp[FS_BASE / sizeof(unsigned long)] == 0) ||
> > + (to->mm == NULL))
> > + return;
> > +
> > + /* this changes the FS on every context switch */
> > + arch_prctl(to, ARCH_SET_FS,
> > + (void __user *) to->thread.regs.regs.gp[FS_BASE / sizeof(unsigned long)]);
>
> Hmm, the comment mentions FS_BASE/GS_BASE, but here you only handle
> FS_BASE? Is that intentional?
thanks for the comment.
my intention is only specific to fs_base as I saw the register needs
to restore during this switch while with gs_base I didn't. I can
update it if I see a real issue without it.
The comment needs to be updated (I guess this is copied/pasted from
the original arch_switch_to comment).
-- Hajime
Powered by blists - more mailing lists