mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hajime Tazaki <thehajime@gmail.com>
To: benjamin@sipsolutions.net
Cc: linux-um@lists.infradead.org, ricarkol@google.com,
	Liam.Howlett@oracle.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 06/13] x86/um: nommu: process/thread handling
Date: Thu, 19 Jun 2025 21:22:38 +0900	[thread overview]
Message-ID: <m2a5636hv5.wl-thehajime@gmail.com> (raw)
In-Reply-To: <55ff3fa8f19c61745933e7814029cef526271eb4.camel@sipsolutions.net>


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

  reply	other threads:[~2025-06-19 12:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19  1:04 [PATCH v9 00/13] nommu UML Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 01/13] x86/um: nommu: elf loader for fdpic Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 02/13] um: decouple MMU specific code from the common part Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 03/13] um: nommu: memory handling Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 04/13] x86/um: nommu: syscall handling Hajime Tazaki
2025-06-19 10:31   ` Benjamin Berg
2025-06-21 12:40     ` Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 05/13] um: nommu: seccomp syscalls hook Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 06/13] x86/um: nommu: process/thread handling Hajime Tazaki
2025-06-19 10:36   ` Benjamin Berg
2025-06-19 12:22     ` Hajime Tazaki [this message]
2025-06-19  1:04 ` [PATCH v9 07/13] um: nommu: configure fs register on host syscall invocation Hajime Tazaki
2025-06-19 10:40   ` Benjamin Berg
2025-06-19 12:22     ` Hajime Tazaki
2025-06-19 12:38       ` Benjamin Berg
2025-06-19 12:57         ` Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 08/13] x86/um/vdso: nommu: vdso memory update Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 09/13] x86/um: nommu: signal handling Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 10/13] um: nommu: a work around for MMU dependency to PCI driver Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 11/13] um: change machine name for uname output Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 12/13] um: nommu: add documentation of nommu UML Hajime Tazaki
2025-06-19  1:04 ` [PATCH v9 13/13] um: nommu: plug nommu code into build system Hajime Tazaki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2a5636hv5.wl-thehajime@gmail.com \
    --to=thehajime@gmail.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=benjamin@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=ricarkol@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®