Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1482898imu; Fri, 9 Nov 2018 18:02:07 -0800 (PST) X-Google-Smtp-Source: AJdET5ca0xM8tEuZSveGHCoHR1X7Ov+LH85PrqeWa9H9LM4W6Vh8a+tO8jJT6GKL8oByYwePrhHS X-Received: by 2002:a62:be18:: with SMTP id l24-v6mr11028900pff.51.1541815327256; Fri, 09 Nov 2018 18:02:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541815327; cv=none; d=google.com; s=arc-20160816; b=F8aL575v+PO3OIljbMAPG7AiujVswThWmtC8I7/JeSZNWK7eUhBntam8gLijweVBQn ri2KJLnXg8MazThfMJ6U++ANPWMSzZlKD5c/lsXQ5T703RHnggJYkWpyeLPO/hQDp1yB o/tDc25yD1+nD1AMUz0nvlJ6WrPW235sQ1ot9bxTLrI+VKwBKyvLfSeWDJAA+g7RXHeV 9yqdaH+wAitdn7l/fDhdMJodd/7uTycDfF8Nwp6+MCdqpAFjERXUQ3NRvkXLDampiazU Yb+NeU26VJFncEOWBhKHlVbOfW0j326tzo+wzUTEyLRO/7UoGWf19qsKkpYUNKHNP3ig jL0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date; bh=JMH6pob9yU9PmYJO9cKpUZdPsABpEBaMpDCSNNwTY9M=; b=SpPfvFS3sVtufRjHoUZRs47/gLohiSdLR8BeJFkmh15Etf+Vw6ZqFCl1AZDUqUf0Lu 6CPhwaQGPsc6/mkB5Qfl+0zsVkefSZKr5as3LndcALPcmj0aXLJM9rnKD2ooCAhkdIZO bl+ET/AmJa764bJINOq6a2MLo8xaZtY+HVm7MP6IcaCMI4rz2D/JRYoznyMPwKf2F6LU rieZxu1ztc1C0rW21hl2JpwStAPocDG+Yyy65crxUivceR2kbqNKrS3LBt/44aY/JuvX k4ORJwugImHMfncAmRKEG184yfiB7ffrRd31Ji6bwEfGZ6kcjkStHtmMLX6fHDWevxcp e9CA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c2-v6si7942296pgm.467.2018.11.09.18.01.48; Fri, 09 Nov 2018 18:02:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728567AbeKJLok (ORCPT + 99 others); Sat, 10 Nov 2018 06:44:40 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:40686 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728130AbeKJLok (ORCPT ); Sat, 10 Nov 2018 06:44:40 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 50A5072CBF9; Sat, 10 Nov 2018 05:01:21 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 44ACF7CD1FF; Sat, 10 Nov 2018 05:01:21 +0300 (MSK) Date: Sat, 10 Nov 2018 05:01:21 +0300 From: "Dmitry V. Levin" To: Andy Lutomirski , Mark Salter , Aurelien Jacquiot , Paul Moore , Eric Paris Cc: Elvira Khabirova , linux-c6x-dev@linux-c6x.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH 07/13 v2] c6x: define syscall_get_arch() Message-ID: <20181110020121.GA4908@altlinux.org> Mail-Followup-To: Andy Lutomirski , Mark Salter , Aurelien Jacquiot , Paul Moore , Eric Paris , Elvira Khabirova , linux-c6x-dev@linux-c6x.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org References: <20181109031303.GA20906@altlinux.org> <20181109031613.GG21511@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181109031613.GG21511@altlinux.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org syscall_get_arch() is required to be implemented on all architectures that use tracehook_report_syscall_entry() in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin --- v2: apparently, this architecture can be configured as big-endian, so changed AUDIT_ARCH_C6X to be little-endian, and added AUDIT_ARCH_C6XBE. arch/c6x/include/asm/syscall.h | 7 +++++++ include/uapi/linux/audit.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/arch/c6x/include/asm/syscall.h b/arch/c6x/include/asm/syscall.h index ae2be315ee9c..39dbd1ef994c 100644 --- a/arch/c6x/include/asm/syscall.h +++ b/arch/c6x/include/asm/syscall.h @@ -11,6 +11,7 @@ #ifndef __ASM_C6X_SYSCALL_H #define __ASM_C6X_SYSCALL_H +#include #include #include @@ -120,4 +121,10 @@ static inline void syscall_set_arguments(struct task_struct *task, } } +static inline int syscall_get_arch(void) +{ + return IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) + ? AUDIT_ARCH_C6XBE : AUDIT_ARCH_C6X; +} + #endif /* __ASM_C6X_SYSCALLS_H */ diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index bedf3bf54c3a..72aeea0a740d 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -381,6 +381,8 @@ enum { #define AUDIT_ARCH_ARCV2BE (EM_ARCV2) #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARMEB (EM_ARM) +#define AUDIT_ARCH_C6X (EM_TI_C6000|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_C6XBE (EM_TI_C6000) #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) #define AUDIT_ARCH_FRV (EM_FRV) #define AUDIT_ARCH_I386 (EM_386|__AUDIT_ARCH_LE) -- ldv