Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1373341imu; Fri, 9 Nov 2018 15:39:47 -0800 (PST) X-Google-Smtp-Source: AJdET5eLeTHSexAmEmRu35YKJWErCW6wsz6BKxXjRY0IQeSe1eigqinoJiZUqd+cNCND+uqv+xcg X-Received: by 2002:a17:902:c5:: with SMTP id a63-v6mr10903739pla.201.1541806787765; Fri, 09 Nov 2018 15:39:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541806787; cv=none; d=google.com; s=arc-20160816; b=tRidTeUiRH4LN62/x7bPqfJW+8KYD0paTWV+8t9b3WN9ypdB31CaVm6w0+1aPr9vVs eIAKqVdxKqApqv+EKFGrr9mIZ3R2AdxEzvTmqWJ6ixC1AFP90QZRk9uYxTbHiaemLCr+ BoieAXrNZz/Y8bAuCzJLp0yIRa+UqilsmxaP/p/up/YmUP2j7YD95cxjWyERgjX4esl0 Js2ixjgyYGx5tsCJIhjeoglFJueyl86uEfuSTt4ohYtD1u059vqzYJjsXw3+SL5pGfTh tx7HWHKpsS1onTAKmPz9FN3IH+/pYw6sLKNPPxGEtAOp31gs7+JFQQ6q1X4G+wtOS/r3 hTow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-language:accept-language:references:message-id:date :thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=1obEq/vIwRQ5pU/jrsRwxY8UTySIaTUdn17/SLSmrFQ=; b=oRwkBBIvkOWkGP8h/nlhZI5wEBwZ8wvVI7Pnd+3jNBeZVI9ayJovLDSE5xos1nbBtg tbcyNP4Wyp47X6lD90Sh3GX4HwMKaE1oE7Yh5lhEPpwJFfv+Maid1sauw5Z0MTAk4Qwb OeMGhc8SItV50qE9vdqurrQfXPnkoE82UclYfBoaS27VcLHQzyQphSfqP4BJYHCJzdo6 UknSziO8T4d4EkCzDTnK3jVNX534mvFSy2queoyN9zkXoESyaHsUJvqvsz+ZaaLBVhZf wuA2cIid30XEVdNoxzkDVABfgMmC1qhru9MD3t8SH2vhNlCgA+Igc7egrilDY35ALgsN X+hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=C7pODv2E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k25-v6si9462636pfe.36.2018.11.09.15.39.32; Fri, 09 Nov 2018 15:39: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; dkim=pass header.i=@synopsys.com header.s=mail header.b=C7pODv2E; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728283AbeKJJV6 (ORCPT + 99 others); Sat, 10 Nov 2018 04:21:58 -0500 Received: from smtprelay.synopsys.com ([198.182.60.111]:36442 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726688AbeKJJV6 (ORCPT ); Sat, 10 Nov 2018 04:21:58 -0500 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id F0CD210C1025; Fri, 9 Nov 2018 15:39:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1541806748; bh=Ew1Ngv4Ms5KG5ilq6aKZ7ogzGfOSePvWuDpgphPRQTk=; h=From:To:CC:Subject:Date:References:From; b=C7pODv2EB/bFo0byPs/m1ZwVyqzxtOd3ffrP70Bi1EIpTRWLjAnltuu5Pq/ZuI9XN FY9SxHgz7SUsRHPA5UStTzR69YqDImUBw10qxYAQvpZFTW9X/7nWIMm+rIigdFAHkG EwnwmB5x6tGx9DydgbZVJ3y716gIdg/P6dQ855rm/roCks3lXje7s63O5Fk+AjiKH5 P76TKHyvixHqg1DnyoAdAUjjd9UeaOiV+fiCVeU0Dp0KJxMFEqIH8nh9NH9mV+BHAx luXEUoLc/httHwgtbGeQSiyK5uPiq3BqUNrsBaNXTVjegMBZ9iCfMpJkBXWVZVi5zc x9htPxCwnQziQ== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id A7B9D5FC6; Fri, 9 Nov 2018 15:39:07 -0800 (PST) Received: from us01wembx1.internal.synopsys.com ([169.254.1.228]) by US01WXQAHTC1.internal.synopsys.com ([::1]) with mapi id 14.03.0415.000; Fri, 9 Nov 2018 15:39:07 -0800 From: Vineet Gupta To: "Dmitry V. Levin" , Andrew Lutomirski , Alexey Brodkin , Vineet Gupta CC: Elvira Khabirova , Paul Moore , Eric Paris , "linux-snps-arc@lists.infradead.org" , "linux-audit@redhat.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 06/13 v2] arc: define syscall_get_arch() Thread-Topic: [PATCH 06/13 v2] arc: define syscall_get_arch() Thread-Index: AQHUeISowsnA4GsWFEWQpGdc0LUZ4A== Date: Fri, 9 Nov 2018 23:39:07 +0000 Message-ID: References: <20181109031605.GF21511@altlinux.org> <456a69c6e01a6ab5b1af6d459a249388f8b4c1f5.camel@synopsys.com> <215d66fd9a197b631973c9ff75943b4c1216b899.camel@synopsys.com> <20181109233342.GC2710@altlinux.org> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.144.199.104] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/9/18 3:33 PM, Dmitry V. Levin wrote:=0A= > syscall_get_arch() is required to be implemented on all architectures=0A= > that use tracehook_report_syscall_entry() in order to extend=0A= > the generic ptrace API with PTRACE_GET_SYSCALL_INFO request.=0A= >=0A= > Signed-off-by: Dmitry V. Levin =0A= > ---=0A= > v2: define AUDIT_ARCH_ARCOMPACT, AUDIT_ARCH_ARCOMPACTLE, AUDIT_ARCH_ARCV2= ,=0A= > and AUDIT_ARCH_ARCV2LE instead of AUDIT_ARCH_ARC, update=0A= > syscall_get_arch() implementation accordingly.=0A= >=0A= > arch/arc/include/asm/syscall.h | 18 ++++++++++++++++++=0A= > include/uapi/linux/audit.h | 4 ++++=0A= > 2 files changed, 22 insertions(+)=0A= >=0A= > diff --git a/arch/arc/include/asm/syscall.h b/arch/arc/include/asm/syscal= l.h=0A= > index 29de09804306..a1b698290778 100644=0A= > --- a/arch/arc/include/asm/syscall.h=0A= > +++ b/arch/arc/include/asm/syscall.h=0A= > @@ -9,6 +9,7 @@=0A= > #ifndef _ASM_ARC_SYSCALL_H=0A= > #define _ASM_ARC_SYSCALL_H 1=0A= > =0A= > +#include =0A= > #include =0A= > #include =0A= > #include =0A= > @@ -68,4 +69,21 @@ syscall_get_arguments(struct task_struct *task, struct= pt_regs *regs,=0A= > }=0A= > }=0A= > =0A= > +static inline int syscall_get_arch(void)=0A= > +{=0A= > +#ifdef CONFIG_ISA_ARCOMPACT=0A= > +# ifdef CONFIG_CPU_BIG_ENDIAN=0A= > + return AUDIT_ARCH_ARCOMPACT;=0A= > +# else=0A= > + return AUDIT_ARCH_ARCOMPACTLE;=0A= > +# endif=0A= > +#else /* CONFIG_ISA_ARCV2 */=0A= > +# ifdef CONFIG_CPU_BIG_ENDIAN=0A= > + return AUDIT_ARCH_ARCV2;=0A= > +# else=0A= > + return AUDIT_ARCH_ARCV2LE;=0A= > +# endif=0A= > +#endif=0A= > +}=0A= =0A= Bike shedding, but will using IS_ENABLED make the code any better.=0A= =0A= =0A= > +=0A= > #endif=0A= > diff --git a/include/uapi/linux/audit.h b/include/uapi/linux/audit.h=0A= > index 818ae690ab79..8e70fb70b8f8 100644=0A= > --- a/include/uapi/linux/audit.h=0A= > +++ b/include/uapi/linux/audit.h=0A= > @@ -375,6 +375,10 @@ enum {=0A= > =0A= > #define AUDIT_ARCH_AARCH64 (EM_AARCH64|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_L= E)=0A= > #define AUDIT_ARCH_ALPHA (EM_ALPHA|__AUDIT_ARCH_64BIT|__AUDIT_ARCH_LE)= =0A= > +#define AUDIT_ARCH_ARCOMPACT (EM_ARCOMPACT)=0A= > +#define AUDIT_ARCH_ARCOMPACTLE (EM_ARCOMPACT|__AUDIT_ARCH_LE)=0A= > +#define AUDIT_ARCH_ARCV2 (EM_ARCV2)=0A= > +#define AUDIT_ARCH_ARCV2LE (EM_ARCV2|__AUDIT_ARCH_LE)=0A= =0A= More Bike shedding, can we make LE as default and add BE suffixes variants = please.=0A=