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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E5D2C4361B for ; Tue, 15 Dec 2020 10:49:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D255422225 for ; Tue, 15 Dec 2020 10:49:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727292AbgLOKth (ORCPT ); Tue, 15 Dec 2020 05:49:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727065AbgLOKth (ORCPT ); Tue, 15 Dec 2020 05:49:37 -0500 Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E871BC06179C for ; Tue, 15 Dec 2020 02:48:56 -0800 (PST) Received: by ozlabs.org (Postfix, from userid 1034) id 4CwFP306HYz9sSn; Tue, 15 Dec 2020 21:48:54 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org In-Reply-To: <8a4ffe4798e9ea32aaaccdf85e411bb1beed3500.1605542955.git.christophe.leroy@csgroup.eu> References: <8a4ffe4798e9ea32aaaccdf85e411bb1beed3500.1605542955.git.christophe.leroy@csgroup.eu> Subject: Re: [PATCH] powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP Message-Id: <160802920749.504444.12908339583780328287.b4-ty@ellerman.id.au> Date: Tue, 15 Dec 2020 21:48:54 +1100 (AEDT) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Nov 2020 16:09:31 +0000 (UTC), Christophe Leroy wrote: > On hash 32 bits, handling minor protection faults like unsetting > dirty flag is heavy if done from the normal page_fault processing, > because it implies hash table software lookup for flushing the entry > and then a DSI is taken anyway to add the entry back. > > When KUAP was implemented, as explained in commit a68c31fc01ef > ("powerpc/32s: Implement Kernel Userspace Access Protection"), > protection faults has been diverted from hash_page() because > hash_page() was not able to identify a KUAP fault. > > [...] Applied to powerpc/next. [1/1] powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP https://git.kernel.org/powerpc/c/1b03e71ff6f2bd10b45a0128ce76e0e42014a44c cheers 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 X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE08AC4361B for ; Tue, 15 Dec 2020 10:54:42 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E36852222A for ; Tue, 15 Dec 2020 10:54:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E36852222A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CwFWf61bfzDqD0 for ; Tue, 15 Dec 2020 21:54:38 +1100 (AEDT) Received: from ozlabs.org (bilbo.ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CwFP31bwHzDqD9 for ; Tue, 15 Dec 2020 21:48:55 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Received: by ozlabs.org (Postfix, from userid 1034) id 4CwFP306HYz9sSn; Tue, 15 Dec 2020 21:48:54 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman In-Reply-To: <8a4ffe4798e9ea32aaaccdf85e411bb1beed3500.1605542955.git.christophe.leroy@csgroup.eu> References: <8a4ffe4798e9ea32aaaccdf85e411bb1beed3500.1605542955.git.christophe.leroy@csgroup.eu> Subject: Re: [PATCH] powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP Message-Id: <160802920749.504444.12908339583780328287.b4-ty@ellerman.id.au> Date: Tue, 15 Dec 2020 21:48:54 +1100 (AEDT) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Mon, 16 Nov 2020 16:09:31 +0000 (UTC), Christophe Leroy wrote: > On hash 32 bits, handling minor protection faults like unsetting > dirty flag is heavy if done from the normal page_fault processing, > because it implies hash table software lookup for flushing the entry > and then a DSI is taken anyway to add the entry back. > > When KUAP was implemented, as explained in commit a68c31fc01ef > ("powerpc/32s: Implement Kernel Userspace Access Protection"), > protection faults has been diverted from hash_page() because > hash_page() was not able to identify a KUAP fault. > > [...] Applied to powerpc/next. [1/1] powerpc/32s: Handle PROTFAULT in hash_page() also for CONFIG_PPC_KUAP https://git.kernel.org/powerpc/c/1b03e71ff6f2bd10b45a0128ce76e0e42014a44c cheers