All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: Nicolas Iooss <nicolas.iooss_linux@m4x.org>,
	Jeff Dike <jdike@addtoit.com>,
	user-mode-linux-devel@lists.sourceforge.net,
	user-mode-linux-user@lists.sourceforge.net
Cc: linux-kernel@vger.kernel.org, Thomas Meyer <thomas@m3y3r.de>
Subject: Re: [PATCH 3/3] um/os-Linux: Use char[] for syscall_stub declarations
Date: Sun, 31 May 2015 21:50:19 +0200	[thread overview]
Message-ID: <556B65FB.8040404@nod.at> (raw)
In-Reply-To: <1413111733-10763-3-git-send-email-nicolas.iooss_linux@m4x.org>

Am 12.10.2014 um 13:02 schrieb Nicolas Iooss:
> When declaring __syscall_stub_start, use the same type in UML userspace
> code as in arch/um/include/asm/sections.h.
> 
> While at it, also declare batch_syscall_stub as char[].
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org>
> ---
>  arch/um/os-Linux/skas/mem.c     |  6 +++---
>  arch/um/os-Linux/skas/process.c | 11 +++++------
>  2 files changed, 8 insertions(+), 9 deletions(-)
> 
> diff --git a/arch/um/os-Linux/skas/mem.c b/arch/um/os-Linux/skas/mem.c
> index 689b18db798f..abb02becca80 100644
> --- a/arch/um/os-Linux/skas/mem.c
> +++ b/arch/um/os-Linux/skas/mem.c
> @@ -19,7 +19,7 @@
>  #include <sysdep/ptrace.h>
>  #include <sysdep/stub.h>
>  
> -extern unsigned long batch_syscall_stub, __syscall_stub_start;
> +extern char batch_syscall_stub[], __syscall_stub_start[];
>  
>  extern void wait_stub_done(int pid);
>  
> @@ -39,8 +39,8 @@ static int __init init_syscall_regs(void)
>  {
>  	get_safe_registers(syscall_regs, NULL);
>  	syscall_regs[REGS_IP_INDEX] = STUB_CODE +
> -		((unsigned long) &batch_syscall_stub -
> -		 (unsigned long) &__syscall_stub_start);
> +		((unsigned long) batch_syscall_stub -
> +		 (unsigned long) __syscall_stub_start);
>  	return 0;
>  }
>  
> diff --git a/arch/um/os-Linux/skas/process.c b/arch/um/os-Linux/skas/process.c
> index 908579f2b0ab..fa934d0c8932 100644
> --- a/arch/um/os-Linux/skas/process.c
> +++ b/arch/um/os-Linux/skas/process.c
> @@ -193,7 +193,7 @@ static void handle_trap(int pid, struct uml_pt_regs *regs,
>  	handle_syscall(regs);
>  }
>  
> -extern int __syscall_stub_start;
> +extern char __syscall_stub_start[];
>  
>  static int userspace_tramp(void *stack)
>  {
> @@ -218,7 +218,7 @@ static int userspace_tramp(void *stack)
>  		 */
>  		int fd;
>  		unsigned long long offset;
> -		fd = phys_mapping(to_phys(&__syscall_stub_start), &offset);
> +		fd = phys_mapping(to_phys(__syscall_stub_start), &offset);
>  		addr = mmap64((void *) STUB_CODE, UM_KERN_PAGE_SIZE,
>  			      PROT_EXEC, MAP_FIXED | MAP_PRIVATE, fd, offset);
>  		if (addr == MAP_FAILED) {
> @@ -245,7 +245,7 @@ static int userspace_tramp(void *stack)
>  
>  		unsigned long v = STUB_CODE +
>  				  (unsigned long) stub_segv_handler -
> -				  (unsigned long) &__syscall_stub_start;
> +				  (unsigned long) __syscall_stub_start;
>  
>  		set_sigstack((void *) STUB_DATA, UM_KERN_PAGE_SIZE);
>  		sigemptyset(&sa.sa_mask);
> @@ -474,7 +474,7 @@ static int __init init_thread_regs(void)
>  	/* Set parent's instruction pointer to start of clone-stub */
>  	thread_regs[REGS_IP_INDEX] = STUB_CODE +
>  				(unsigned long) stub_clone_handler -
> -				(unsigned long) &__syscall_stub_start;
> +				(unsigned long) __syscall_stub_start;
>  	thread_regs[REGS_SP_INDEX] = STUB_DATA + UM_KERN_PAGE_SIZE -
>  		sizeof(void *);
>  #ifdef __SIGNAL_FRAMESIZE
> @@ -582,8 +582,7 @@ int map_stub_pages(int fd, unsigned long code, unsigned long data,
>  	struct proc_mm_op mmop;
>  	int n;
>  	unsigned long long code_offset;
> -	int code_fd = phys_mapping(to_phys((void *) &__syscall_stub_start),
> -				   &code_offset);
> +	int code_fd = phys_mapping(to_phys(__syscall_stub_start), &code_offset);
>  
>  	mmop = ((struct proc_mm_op) { .op        = MM_MMAP,
>  				      .u         =

Thank you Nicoals, all three patches are now in my 4.2 queue!
Special thanks to Thomas Meyer for exhuming this patches. :-)

Thanks,
//richard

      reply	other threads:[~2015-05-31 19:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-12 11:02 [uml-devel] [PATCH 1/3] um: Create asm/sections.h Nicolas Iooss
2014-10-12 11:02 ` Nicolas Iooss
2014-10-12 11:02 ` [uml-devel] [PATCH 2/3] um: Use char[] for linker script address declarations Nicolas Iooss
2014-10-12 11:02   ` Nicolas Iooss
2014-10-12 11:02 ` [uml-devel] [PATCH 3/3] um/os-Linux: Use char[] for syscall_stub declarations Nicolas Iooss
2014-10-12 11:02   ` Nicolas Iooss
2015-05-31 19:50   ` Richard Weinberger [this message]

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=556B65FB.8040404@nod.at \
    --to=richard@nod.at \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nicolas.iooss_linux@m4x.org \
    --cc=thomas@m3y3r.de \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.