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 3F7BCECAAA3 for ; Fri, 26 Aug 2022 06:45:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245077AbiHZGo7 (ORCPT ); Fri, 26 Aug 2022 02:44:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243137AbiHZGoz (ORCPT ); Fri, 26 Aug 2022 02:44:55 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6AF061EAE5 for ; Thu, 25 Aug 2022 23:44:52 -0700 (PDT) Received: from dggemv704-chm.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4MDVZk42sGzYcpx; Fri, 26 Aug 2022 14:40:30 +0800 (CST) Received: from kwepemm600017.china.huawei.com (7.193.23.234) by dggemv704-chm.china.huawei.com (10.3.19.47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 14:44:49 +0800 Received: from [10.174.179.234] (10.174.179.234) by kwepemm600017.china.huawei.com (7.193.23.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Fri, 26 Aug 2022 14:44:48 +0800 Message-ID: <7718a9bc-e976-daeb-f490-e7b5190e50b6@huawei.com> Date: Fri, 26 Aug 2022 14:44:48 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH -next v2 2/2] riscv: extable: add new extable type EX_TYPE_KACCESS_ERR_ZERO support To: Andrew Jones CC: Paul Walmsley , Palmer Dabbelt , Palmer Dabbelt , Albert Ou , , , , , Guohanjun References: <20220815032025.2685516-1-tongtiangen@huawei.com> <20220815032025.2685516-3-tongtiangen@huawei.com> <20220825110602.bog5mjpascvikwxx@kamzik> From: Tong Tiangen In-Reply-To: <20220825110602.bog5mjpascvikwxx@kamzik> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.179.234] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600017.china.huawei.com (7.193.23.234) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/8/25 19:06, Andrew Jones 写道: > On Mon, Aug 15, 2022 at 03:20:25AM +0000, Tong Tiangen wrote: >> Currently, The extable type EX_TYPE_UACCESS_ERR_ZERO is used by >> __get/put_kernel_nofault(), but those helpers are not uaccess type, so we >> add a new extable type EX_TYPE_KACCESS_ERR_ZERO which can be used by >> __get/put_kernel_no_fault(). >> >> Only refactor code without any functional changes. > > This isn't quite true. __get/put_kernel_nofault now sets a different > extable type (as the commit message says). But, nothing special seems > to be done with that, so there's effectively no functional change. Can > you please elaborate on the motivation for this change? Where will the > KACCESS type need to be distinguished from the UACCESS type? The introduction of EX_TYPE_KACCESS_ERR_ZERO does not change any function, but makes a correct distinction in the actual type, indicating that there are indeed some kaccess entries in extable. I think this optimization is more clear and reasonable. A few weeks ago, I did something similar on arm64[1]. I think this optimization can also be used on riscv. We can do some features that are used on uaccss but not applicable on kaccess in the future[2]. [1] https://lore.kernel.org/lkml/20220621072638.1273594-2-tongtiangen@huawei.com/ [2]https://lore.kernel.org/lkml/20220812070557.1028499-4-tongtiangen@huawei.com/ Thanks, Tong. > > Thanks, > drew > .