Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp14072imu; Mon, 19 Nov 2018 16:50:47 -0800 (PST) X-Google-Smtp-Source: AJdET5dUgks/YFulp+T7KpT4Oy3rm3UPtHYuqwF5Ba6idkFogzLKop+gvMY+H240MoaI2p0OFnpo X-Received: by 2002:a62:d148:: with SMTP id t8mr12765455pfl.52.1542675047604; Mon, 19 Nov 2018 16:50:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542675047; cv=none; d=google.com; s=arc-20160816; b=xfy0V9TJ5ufswIruQVhMmYvLcDDRGCJOWZMOWBWd9T9KLnWTAPbnScfc7a3bv3OVCQ ss+tFDCIIcAo9cEbcxEk/YBKl3HX37PyWrxYWDZdVhz1WrXg/hmJb5RN4kMpiLSD3EYG q2MqFC4dMdGyHKBxVln4TBJb9s3ill0icDtIxKWJCFoE2LbJzzQ6tjeI6CcrMZzAjA+p ZgDbFhEz2UQ+xvikhz0BIFilZjibNOr7r8rwsWQSn4Vv0foUaYX5Edxi7ZsB+stwyjCV 7sV0dN54K0c1Ju7ougGA0WiVzNhATJMJxLmkWha8FwRGQak/L/CELrOnI/ldHwOHgzKD s/hQ== 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:message-id:subject:cc:to:from:date; bh=NficpDNKoO0BFro2Qnmn4WndbtZvRFbV/xi1yiieOb4=; b=fFF5orczoynP5nKyLuGawCr9RzOJQbK1K+IO0JRkRPo7JCnS7w6kIa3JEawwvVpGXY ISHzlrAK1BI+rim1aTvIC2sDTsY3uHdPcGgr1NxNzXM0ZOfrbxs0KLrsVvu/tYhduK7k HsRPZ47kVS7sv9rQQmbOX7KnoYMGstjOMMcAvVz8JOC4qs/9eHixxC1XTQkth2e3OHqE prDWzY4Y8AtR2OLq31vrvRkFCJuT+NMVqvjYvczzzDnp3cqfUkYF6HOYnZYdrkAt4RoR TrqrE3llsr3xBWG+95g92Z/cvlZpfN6zfzWY5cKR5YxR1hIHjMDlq/wRnSuU++lxTaQO Q1Rg== 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 m15si13245546pgc.381.2018.11.19.16.50.10; Mon, 19 Nov 2018 16:50:47 -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 S1732011AbeKTKmG (ORCPT + 99 others); Tue, 20 Nov 2018 05:42:06 -0500 Received: from vmicros1.altlinux.org ([194.107.17.57]:54840 "EHLO vmicros1.altlinux.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731074AbeKTKmG (ORCPT ); Tue, 20 Nov 2018 05:42:06 -0500 Received: from mua.local.altlinux.org (mua.local.altlinux.org [192.168.1.14]) by vmicros1.altlinux.org (Postfix) with ESMTP id 9384D72CA5E; Tue, 20 Nov 2018 03:15:49 +0300 (MSK) Received: by mua.local.altlinux.org (Postfix, from userid 508) id 8692A7CD1FF; Tue, 20 Nov 2018 03:15:49 +0300 (MSK) Date: Tue, 20 Nov 2018 03:15:49 +0300 From: "Dmitry V. Levin" To: Andy Lutomirski , Vineet Gupta , Alexey Brodkin Cc: Elvira Khabirova , Paul Moore , Eric Paris , linux-snps-arc@lists.infradead.org, linux-audit@redhat.com, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/15] arc: define syscall_get_arch() Message-ID: <20181120001549.GG11387@altlinux.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181120001128.GA11300@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 in order to extend the generic ptrace API with PTRACE_GET_SYSCALL_INFO request. Signed-off-by: Dmitry V. Levin Acked-by: Vineet Gupta --- v2: added Acked-by to [PATCH 06/13 v3] arch/arc/include/asm/syscall.h | 10 ++++++++++ include/uapi/linux/audit.h | 4 ++++ 2 files changed, 14 insertions(+) diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscall.h index 29de09804306..10b2e7523bc8 100644 --- a/arch/arc/include/asm/syscall.h +++ b/arch/arc/include/asm/syscall.h @@ -9,6 +9,7 @@ #ifndef _ASM_ARC_SYSCALL_H #define _ASM_ARC_SYSCALL_H 1 +#include #include #include #include @@ -68,4 +69,13 @@ syscall_get_arguments(struct task_struct *task, struct pt_regs *regs, } } +static inline int syscall_get_arch(void) +{ + return IS_ENABLED(CONFIG_ISA_ARCOMPACT) + ? (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) + ? AUDIT_ARCH_ARCOMPACTBE : AUDIT_ARCH_ARCOMPACT) + : (IS_ENABLED(CONFIG_CPU_BIG_ENDIAN) + ? AUDIT_ARCH_ARCV2BE : AUDIT_ARCH_ARCV2); +} + #endif diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h index 818ae690ab79..bedf3bf54c3a 100644 --- a/include/uapi/linux/audit.h +++ b/include/uapi/linux/audit.h @@ -375,6 +375,10 @@ enum { #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_ARCOMPACTBE (EM_ARCOMPACT) +#define AUDIT_ARCH_ARCV2 (EM_ARCV2|__AUDIT_ARCH_LE) +#define AUDIT_ARCH_ARCV2BE (EM_ARCV2) #define AUDIT_ARCH_ARM (EM_ARM|__AUDIT_ARCH_LE) #define AUDIT_ARCH_ARMEB (EM_ARM) #define AUDIT_ARCH_CRIS (EM_CRIS|__AUDIT_ARCH_LE) -- ldv