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 E12D7C43334 for ; Tue, 14 Jun 2022 07:26:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1354369AbiFNH0M (ORCPT ); Tue, 14 Jun 2022 03:26:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351788AbiFNH0J (ORCPT ); Tue, 14 Jun 2022 03:26:09 -0400 Received: from pegase2.c-s.fr (pegase2.c-s.fr [93.17.235.10]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0D4DB3DA77 for ; Tue, 14 Jun 2022 00:26:07 -0700 (PDT) Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4LMg320zS8z9tBr; Tue, 14 Jun 2022 09:26:06 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tydUD9wXKsef; Tue, 14 Jun 2022 09:26:06 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4LMg32020vz9tBX; Tue, 14 Jun 2022 09:26:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id E1A868B766; Tue, 14 Jun 2022 09:26:05 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id Co_muVH59YpW; Tue, 14 Jun 2022 09:26:05 +0200 (CEST) Received: from [192.168.204.246] (unknown [192.168.204.246]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 735208B763; Tue, 14 Jun 2022 09:26:05 +0200 (CEST) Message-ID: Date: Tue, 14 Jun 2022 09:26:04 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.10.0 Subject: =?UTF-8?B?UmU6IOWbnuWkjTogW1BBVENIIDIvMl0gdWlvOnBvd2VycGM6bXBjODV4?= =?UTF-8?Q?x=3a_l2-cache-sram_uio_driver_implementation?= Content-Language: fr-FR From: Christophe Leroy To: Wenhu Wang , Greg KH Cc: "mpe@ellerman.id.au" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <20220609102855.272270-1-wenhu.wang@hotmail.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 14/06/2022 à 09:18, Christophe Leroy a écrit : > > > Le 14/06/2022 à 08:09, Wenhu Wang a écrit : >>>> +static const struct vm_operations_struct uio_cache_sram_vm_ops = { >>>> +#ifdef CONFIG_HAVE_IOREMAP_PROT >>> >>> Same here. >>> >> >> I tried to eliminate it in mainline >> See: [PATCH v2] mm: eliminate ifdef of HAVE_IOREMAP_PROT in .c files >> https://lkml.org/lkml/2022/6/10/695 >> > > I looked at that patch. > > I don't think you can just drop the #ifdef in function > __access_remote_vm() in mm/memory.c > > You have to replace it with something like: > >     if (!IS_ENABLED(CONFIG_HAVE_IOREMAP_PROT)) >         break; > Another thing in that patch: By making generic_access_phys() a static inline, it means that everytime you refer to the address of that function in a vm_operations_struct struct, the compiler has to provide an outlined instance of the function. It means you'll likely have several instances of a generic_access_phys(). What you could do instead is to add the following at the start of generic_access_phys() in mm/memory.c : if (!IS_ENABLED(CONFIG_HAVE_IOREMAP_PROT)) return 0;