Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp619582iob; Wed, 18 May 2022 09:16:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz+bElw01a5bteM9thDWtwbfw8kVGTR/x4vqrM31fexzHu70nTdbx3HrvBkkREl4FfwTn3h X-Received: by 2002:a17:90b:4b48:b0:1de:af4f:7e13 with SMTP id mi8-20020a17090b4b4800b001deaf4f7e13mr202579pjb.146.1652890597187; Wed, 18 May 2022 09:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652890597; cv=none; d=google.com; s=arc-20160816; b=RtT7Z0amsvVVTbg9GIttW5NsD8pkw2nGQZmnFfkhDBs+QUGIMNompfS9i4Z4AIDAV3 hAzIutCrw5IZIee/hg2zFtcRheiQ5hSnuaSK7TAtK0oVv8CjLFxXTcmcQzrR5top4O8d u/Imc+5O3zxtbeF28wxg0bE8JiNqsBEwoNv72S9Mzzh/47ZnnUMxhTqky8rYT3tYQgbk pFfaaU1V+/Xi1M4JmC09xzBlGo/Om0krQUq+PF2745+TDWvcb5FJyJxi93diz0mV5cXj WsIL9VDcTJ3/OVRlyvXXtygrUeI4LVgV1bYpRzxG3uK6hhj2Y5XT0Xzweq8f0PBYU5Oj usXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=L7Rqa9cE/QKKQ5t2unakKULnt47oZnmEpkj0RkgMTec=; b=jjwbz+LtIhlbn4bHarHG81UyRmVOmmooMpINdhRl6U/q6wTYutZ9SBQe77p2on909A wyp+Wmuaf91bSfUi/jy0MkUzDMz785qQYoAJ/mO891XmO+zu+JrSHiP8CeOWCc6QEaOH GEqdeIzGxPNNA5BzV5kacE7YzeOlR6PjafmjdpC5G8mwNrwmOvV5ebwZ67lHSQVXorZa GuEjCvzbzmd4bacofO+0asLePmiUJavlxFqGCzgDoIT1LiPKN/u2Cve68SY54Rq1SFCK BvdtDYzL6Iq7wy8ZB/kpAllOi+OeOWxOtf7bQkLKLOm4QDHCjjEjCzsYpAknaaQSKR6c qh2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=dnSn784K; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x15-20020a63b34f000000b003f5d4d38d59si3007671pgt.203.2022.05.18.09.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 09:16:37 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@xen0n.name header.s=mail header.b=dnSn784K; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 63C881E15C4; Wed, 18 May 2022 09:13:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239981AbiERQNn (ORCPT + 99 others); Wed, 18 May 2022 12:13:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48624 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239961AbiERQNg (ORCPT ); Wed, 18 May 2022 12:13:36 -0400 Received: from mailbox.box.xen0n.name (mail.xen0n.name [115.28.160.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 52D191E011D; Wed, 18 May 2022 09:13:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xen0n.name; s=mail; t=1652890408; bh=JZ/umXW1BGSt1/z+uE4svncYRr0FcuqSnCI25i7a5Ho=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=dnSn784KVjHWto1/GJceQf4qHrnCdSxrLcdinanIGqOVulpmfmIGWzChrJ+jhhzgC 2FyM6lSRIVz1QqfWF3s5pi3gz5rd3fyALs0WoFCHOHqS3jEv3IC4l47Wx1lGBPHSrY ZtQPX/XQhhDBfEhTXFEac0caIXRkuU6b/qbP0O+k= Received: from [192.168.9.172] (unknown [101.88.28.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by mailbox.box.xen0n.name (Postfix) with ESMTPSA id 2914A60691; Thu, 19 May 2022 00:13:28 +0800 (CST) Message-ID: <739ba6e4-d11b-44a0-c5fc-6fb430d10d5a@xen0n.name> Date: Thu, 19 May 2022 00:13:27 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0a1 Subject: Re: [PATCH V11 14/22] LoongArch: Add signal handling support Content-Language: en-US To: Huacai Chen , Arnd Bergmann , Andy Lutomirski , Thomas Gleixner , Peter Zijlstra , Andrew Morton , David Airlie , Jonathan Corbet , Linus Torvalds Cc: 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 , Eric Biederman , Al Viro References: <20220518092619.1269111-1-chenhuacai@loongson.cn> <20220518092619.1269111-15-chenhuacai@loongson.cn> From: WANG Xuerui In-Reply-To: <20220518092619.1269111-15-chenhuacai@loongson.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/18/22 17:26, Huacai Chen wrote: > 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) Looks nice. BTW: following some communication it appears that the SC_ADDRERR_* constants are not tightly coupled to BUS_ADRERR after all, so the spelling is "fixed". I don't have anything more to comment, because the rest are either reviewed or non-userspace-ABI that don't exactly require getting right from the beginning. (Not to say they're flawed.) Reviewed-by: WANG Xuerui