Linux-RISC-V Archive on lore.kernel.org
 help / color / Atom feed
WARNING: multiple messages refer to this Message-ID
From: mpe@ellerman.id.au (Michael Ellerman)
To: linux-riscv@lists.infradead.org
Subject: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument
Date: Tue, 27 Nov 2018 21:34:29 +1100
Message-ID: <87in0ihkqy.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20181121004422.GA29053@altlinux.org>

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index ab9f3f0a8637..d88b34179118 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -100,9 +100,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
>  		regs->orig_gpr3 = args[0];
>  }
>  
> -static inline int syscall_get_arch(void)
> +static inline int syscall_get_arch(struct task_struct *task)
>  {
> -	int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> +	int arch;
> +
> +	if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
> +		arch = AUDIT_ARCH_PPC64;
> +	else
> +		arch = AUDIT_ARCH_PPC;
> +
>  #ifdef __LITTLE_ENDIAN__
>  	arch |= __AUDIT_ARCH_LE;
>  #endif

LGTM.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers

From: Michael Ellerman <mpe@ellerman.id.au>
To: "Dmitry V. Levin" <ldv@altlinux.org>,
	Andy Lutomirski <luto@kernel.org>, Eric Paris <eparis@redhat.com>,
	Paul Moore <paul@paul-moore.com>
Cc: linux-mips@linux-mips.org, linux-ia64@vger.kernel.org,
	linux-sh@vger.kernel.org, sparclinux@vger.kernel.org,
	linux-riscv@lists.infradead.org, linux-arch@vger.kernel.org,
	linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org,
	linux-hexagon@vger.kernel.org, x86@kernel.org,
	Eugene Syromyatnikov <esyr@redhat.com>,
	Elvira Khabirova <lineprinter@altlinux.org>,
	linux-snps-arc@lists.infradead.org,
	uclinux-h8-devel@lists.sourceforge.jp,
	linux-xtensa@linux-xtensa.org, linux-um@lists.infradead.org,
	linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org,
	linux-arm-kernel@lists.infradead.org,
	linux-parisc@vger.kernel.org, Oleg Nesterov <oleg@redhat.com>,
	linux-audit@redhat.com, linux-alpha@vger.kernel.org,
	nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument
Date: Tue, 27 Nov 2018 21:34:29 +1100
Message-ID: <87in0ihkqy.fsf@concordia.ellerman.id.au> (raw)
Message-ID: <20181127103429.fsPSlzSvgWOhARD-LziglIKOpxgljXu05a9Y0hJ686A@z> (raw)
In-Reply-To: <20181121004422.GA29053@altlinux.org>

"Dmitry V. Levin" <ldv@altlinux.org> writes:

> diff --git a/arch/powerpc/include/asm/syscall.h b/arch/powerpc/include/asm/syscall.h
> index ab9f3f0a8637..d88b34179118 100644
> --- a/arch/powerpc/include/asm/syscall.h
> +++ b/arch/powerpc/include/asm/syscall.h
> @@ -100,9 +100,15 @@ static inline void syscall_set_arguments(struct task_struct *task,
>  		regs->orig_gpr3 = args[0];
>  }
>  
> -static inline int syscall_get_arch(void)
> +static inline int syscall_get_arch(struct task_struct *task)
>  {
> -	int arch = is_32bit_task() ? AUDIT_ARCH_PPC : AUDIT_ARCH_PPC64;
> +	int arch;
> +
> +	if (IS_ENABLED(CONFIG_PPC64) && !test_tsk_thread_flag(task, TIF_32BIT))
> +		arch = AUDIT_ARCH_PPC64;
> +	else
> +		arch = AUDIT_ARCH_PPC;
> +
>  #ifdef __LITTLE_ENDIAN__
>  	arch |= __AUDIT_ARCH_LE;
>  #endif

LGTM.

Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)

cheers


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

  parent reply index

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20181107042751.3b519062@akathisia>
     [not found] ` <CALCETrV1v-DPRfDRwiH=xn29bxWxiHdZtAH1nw=dsmDtnT0YGQ@mail.gmail.com>
2018-11-09  3:13   ` [PATCH 00/13] Prepare for PTRACE_GET_SYSCALL_INFO ldv
2018-11-09  3:13     ` Dmitry V. Levin
2018-11-09  3:17     ` [PATCH 12/13] riscv: define syscall_get_arch() ldv
2018-11-09  3:17       ` Dmitry V. Levin
2018-11-09  6:59       ` david.abdurachmanov
2018-11-09  6:59         ` David Abdurachmanov
2018-11-09 22:28         ` ldv
2018-11-09 22:28           ` Dmitry V. Levin
2018-11-10  5:12           ` david.abdurachmanov
2018-11-10  5:12             ` David Abdurachmanov
2018-11-10  9:27           ` schwab
2018-11-10  9:27             ` Andreas Schwab
2018-11-09 18:45       ` palmer
2018-11-09 18:45         ` Palmer Dabbelt
2018-11-09 21:31         ` ldv
2018-11-09 21:31           ` Dmitry V. Levin
2018-11-09 22:48           ` [PATCH 12/13 v2] " ldv
2018-11-09 22:48             ` Dmitry V. Levin
2018-11-11 21:21             ` palmer
2018-11-11 21:21               ` Palmer Dabbelt
2018-11-09  6:06     ` [PATCH 00/13] Prepare for PTRACE_GET_SYSCALL_INFO luto
2018-11-09  6:06       ` Andy Lutomirski
2018-11-20  0:11   ` [PATCH v2 00/15] " ldv
2018-11-20  0:11     ` Dmitry V. Levin
2018-11-20  0:16     ` [PATCH v2 13/15] riscv: define syscall_get_arch() ldv
2018-11-20  0:16       ` Dmitry V. Levin
2018-11-20 20:26     ` [PATCH v2 00/15] Prepare for PTRACE_GET_SYSCALL_INFO paul
2018-11-20 20:26       ` Paul Moore
2018-11-21  0:44     ` [PATCH v2 16/15] syscall_get_arch: add "struct task_struct *" argument ldv
2018-11-21  0:44       ` Dmitry V. Levin
2018-11-21 15:15       ` luto
2018-11-21 15:15         ` Andy Lutomirski
2018-11-21 15:47       ` palmer
2018-11-21 15:47         ` Palmer Dabbelt
2018-11-21 18:40       ` paul.burton
2018-11-21 18:40         ` Paul Burton
2018-11-21 19:00         ` ldv
2018-11-21 19:00           ` Dmitry V. Levin
2018-11-21 19:35           ` [PATCH v2 16/15 v2] " ldv
2018-11-21 19:35             ` Dmitry V. Levin
2018-11-21 19:45             ` paul.burton
2018-11-21 19:45               ` Paul Burton
2018-11-27 10:34       ` mpe [this message]
2018-11-27 10:34         ` [PATCH v2 16/15] " Michael Ellerman

Reply instructions:

You may reply publically 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=87in0ihkqy.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=linux-riscv@lists.infradead.org \
    /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

Linux-RISC-V Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-riscv/0 linux-riscv/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-riscv linux-riscv/ https://lore.kernel.org/linux-riscv \
		linux-riscv@lists.infradead.org infradead-linux-riscv@archiver.kernel.org
	public-inbox-index linux-riscv


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.infradead.lists.linux-riscv


AGPL code for this site: git clone https://public-inbox.org/ public-inbox