From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1E5B2C433F5 for ; Wed, 18 May 2022 16:40:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240340AbiERQkO (ORCPT ); Wed, 18 May 2022 12:40:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53466 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240398AbiERQkK (ORCPT ); Wed, 18 May 2022 12:40:10 -0400 Received: from out01.mta.xmission.com (out01.mta.xmission.com [166.70.13.231]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E2B51FB574; Wed, 18 May 2022 09:40:03 -0700 (PDT) Received: from in01.mta.xmission.com ([166.70.13.51]:40784) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nrMiN-000aXg-N2; Wed, 18 May 2022 10:39:59 -0600 Received: from ip68-227-174-4.om.om.cox.net ([68.227.174.4]:38670 helo=email.froward.int.ebiederm.org.xmission.com) by in01.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1nrMiM-000int-IO; Wed, 18 May 2022 10:39:59 -0600 From: "Eric W. Biederman" To: Huacai Chen Cc: Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds , linux-arch@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Xuefeng Li , Yanteng Si , Huacai Chen , Guo Ren , Xuerui Wang , Jiaxun Yang , Stephen Rothwell , Al Viro References: <20220518092619.1269111-1-chenhuacai@loongson.cn> <20220518092619.1269111-15-chenhuacai@loongson.cn> Date: Wed, 18 May 2022 11:39:51 -0500 In-Reply-To: <20220518092619.1269111-15-chenhuacai@loongson.cn> (Huacai Chen's message of "Wed, 18 May 2022 17:26:11 +0800") Message-ID: <87ilq294mg.fsf@email.froward.int.ebiederm.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1nrMiM-000int-IO;;;mid=<87ilq294mg.fsf@email.froward.int.ebiederm.org>;;;hst=in01.mta.xmission.com;;;ip=68.227.174.4;;;frm=ebiederm@xmission.com;;;spf=softfail X-XM-AID: U2FsdGVkX1/loKgiIQkjiUDPfvi+iuLWDLAFJas94Fw= X-SA-Exim-Connect-IP: 68.227.174.4 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: Re: [PATCH V11 14/22] LoongArch: Add signal handling support X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Huacai Chen writes: > Add ucontext/sigcontext definition and signal handling support for > LoongArch. > > Cc: Eric Biederman > Cc: Al Viro > Signed-off-by: Huacai Chen > --- > arch/loongarch/include/uapi/asm/sigcontext.h | 44 ++ > arch/loongarch/include/uapi/asm/signal.h | 13 + > arch/loongarch/include/uapi/asm/ucontext.h | 35 ++ > arch/loongarch/kernel/signal.c | 566 +++++++++++++++++++ > 4 files changed, 658 insertions(+) > create mode 100644 arch/loongarch/include/uapi/asm/sigcontext.h > create mode 100644 arch/loongarch/include/uapi/asm/signal.h > create mode 100644 arch/loongarch/include/uapi/asm/ucontext.h > create mode 100644 arch/loongarch/kernel/signal.c > > diff --git a/arch/loongarch/include/uapi/asm/sigcontext.h b/arch/loongarch/include/uapi/asm/sigcontext.h > new file mode 100644 > index 000000000000..be3d3c6ac83e > --- /dev/null > +++ b/arch/loongarch/include/uapi/asm/sigcontext.h > @@ -0,0 +1,44 @@ > +/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ > +/* > + * Author: Hanlu Li > + * Huacai Chen > + * > + * Copyright (C) 2020-2022 Loongson Technology Corporation Limited > + */ > +#ifndef _UAPI_ASM_SIGCONTEXT_H > +#define _UAPI_ASM_SIGCONTEXT_H > + > +#include > +#include > + > +/* FP context was used */ > +#define SC_USED_FP (1 << 0) > +/* Address error was due to memory load */ > +#define SC_ADDRERR_RD (1 << 30) > +/* Address error was due to memory store */ > +#define SC_ADDRERR_WR (1 << 31) > + > +struct sigcontext { > + __u64 sc_pc; > + __u64 sc_regs[32]; > + __u32 sc_flags; > + __u64 sc_extcontext[0] __attribute__((__aligned__(16))); > +}; > + > +#define CONTEXT_INFO_ALIGN 16 > +struct _ctxinfo { > + __u32 magic; > + __u32 size; > + __u64 padding; /* padding to 16 bytes */ > +}; This is probably something I a missing but what is struct _ctxinfo and why is it in a uapi header? I don't see anything else in the uapi implementation using it. Symbols that start with an underscore "_" are reserved and should not be used in general, and especially not in uapi header files. Eric