Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4480310ybv; Tue, 25 Feb 2020 21:12:14 -0800 (PST) X-Google-Smtp-Source: APXvYqzc4PGJk6wxKoPySu6FWbluh6BcTNN4Crw2lck/4oF25IPcu6SKgIShms921xMpJGBlDbTt X-Received: by 2002:a9d:48d:: with SMTP id 13mr1491646otm.249.1582693933941; Tue, 25 Feb 2020 21:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582693933; cv=none; d=google.com; s=arc-20160816; b=bimlvmASdfuZYHerEAttRhJMy/Jwyw5SBuiiOSbYHUi1+NUCI7xgGB64bHl68zgc92 JwMDNsRflAL5lo9C8L1HIlLMVeqC0ItPyds8KfcC7ikmpPTaYNQ6oS+692t9TUwpDlJr PMbd+0yzIh3pdIsMWmei54d6Sd/PgVRFn1eM17Fop/9oBnhCFRuMW/go/HDUiOGUlENn /ijYR15c6lxlUvzuLpq5xyugAvepV+WRvEaP2KRpRFw1u9/q4kw0uWLsEEb5ajOTWfYq 8hcBUlszJCDwTA2DWj8x4+sxZFFA1/Gl47Gsji7CVzDV1dNwh9LjCmA5RCWNnoYjEWNQ gueQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=V9G92WeV7I0zyA8d4SzL2Zeetat6pnJ2RUGjU6q3uIg=; b=WUo1hnSNlHwhRh1A61qceNBxzF8hWGZaIj9rcql2Tuh2wtAgaSvSzElazr7EeGwE5h Wpkkyxn1I1WWJ5tc2p9vrpzVKGKrqZb6i8yn7ohBJK0IKiAMlU3P2PL8smg3e+AIA2xP eyR/aE6iK+zW5DZi/WklsZLHBR+4XqdvnORZ1+mqps0VGbPvQXwyOueNASIq3eVKHNbU oK0AXeJlJyR6S0aYNUikgf/Rl/MUDbHJ4Q8/ZbA3IyVgrhcekk6gMUKPGQT0xR1Tgtv4 KLiBXi2PnmewqruwaoBR6WZqZV6ryHZTAf0f5q2tQ9ZmfDVMmQKO71c78gGXtSesxqzw jKVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=FpYzmR5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r5si541531oic.19.2020.02.25.21.12.01; Tue, 25 Feb 2020 21:12:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=FpYzmR5Q; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726561AbgBZFKc (ORCPT + 99 others); Wed, 26 Feb 2020 00:10:32 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:25435 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725789AbgBZFKb (ORCPT ); Wed, 26 Feb 2020 00:10:31 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48S3lm3jPMz9tyKl; Wed, 26 Feb 2020 06:10:28 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=FpYzmR5Q; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id UQj1s__H51dG; Wed, 26 Feb 2020 06:10:28 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 48S3lm2H2nz9ty2Q; Wed, 26 Feb 2020 06:10:28 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582693828; bh=V9G92WeV7I0zyA8d4SzL2Zeetat6pnJ2RUGjU6q3uIg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=FpYzmR5QNKHUaBBVDRQjMn4m/pOdgoFNEP5tSJGRbUNRZBjex2jvHKjGm8eDBIFBf wnPRdyxZXUFGgKULHnBXKV7iqLyAsW//hePYYh3TciLnTMP9L2FVuHIIo+zvj2DvVw 1OgN0jnJw11ZcZaByVat8IoCcG26DQ9EYye4GeBs= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F26F88B776; Wed, 26 Feb 2020 06:10:28 +0100 (CET) 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 l0A6C3cu4_sn; Wed, 26 Feb 2020 06:10:28 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0EABE8B784; Wed, 26 Feb 2020 06:10:28 +0100 (CET) Subject: Re: [PATCH v3 3/6] powerpc/fsl_booke/64: implement KASLR for fsl_booke64 To: Jason Yan , mpe@ellerman.id.au, linuxppc-dev@lists.ozlabs.org, diana.craciun@nxp.com, benh@kernel.crashing.org, paulus@samba.org, npiggin@gmail.com, keescook@chromium.org, kernel-hardening@lists.openwall.com, oss@buserror.net Cc: linux-kernel@vger.kernel.org, zhaohongjiang@huawei.com References: <20200206025825.22934-1-yanaijie@huawei.com> <20200206025825.22934-4-yanaijie@huawei.com> <41b9f1ca-c6fd-291a-2c96-2a0e8a754ec4@c-s.fr> From: Christophe Leroy Message-ID: Date: Wed, 26 Feb 2020 06:10:22 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 26/02/2020 à 04:33, Jason Yan a écrit : > > > 在 2020/2/26 10:40, Jason Yan 写道: >> >> >> 在 2020/2/20 21:48, Christophe Leroy 写道: >>> >>> >>> Le 06/02/2020 à 03:58, Jason Yan a écrit : > Hi Christophe, > > When using a standard C if/else, all code compiled for PPC32 and PPC64, > but this will bring some build error because not all variables both > defined for PPC32 and PPC64. > > [yanaijie@138 linux]$ sh ppc64build.sh >   CALL    scripts/atomic/check-atomics.sh >   CALL    scripts/checksyscalls.sh >   CHK     include/generated/compile.h >   CC      arch/powerpc/mm/nohash/kaslr_booke.o > arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_choose_location': > arch/powerpc/mm/nohash/kaslr_booke.c:341:30: error: > 'CONFIG_LOWMEM_CAM_NUM' undeclared (first use in this function); did you > mean 'CONFIG_FLATMEM_MANUAL'? >    ram = map_mem_in_cams(ram, CONFIG_LOWMEM_CAM_NUM, true); >                               ^~~~~~~~~~~~~~~~~~~~~ >                               CONFIG_FLATMEM_MANUAL This one has to remain inside an #ifdef. That's the only one that has to remain. > arch/powerpc/mm/nohash/kaslr_booke.c:341:30: note: each undeclared > identifier is reported only once for each function it appears in > arch/powerpc/mm/nohash/kaslr_booke.c: In function 'kaslr_early_init': > arch/powerpc/mm/nohash/kaslr_booke.c:404:3: error: 'is_second_reloc' In mmu_decl.h, put the declaration outside the #ifdef CONFIG_PPC32 > undeclared (first use in this function); did you mean '__cond_lock'? >    is_second_reloc = 1; >    ^~~~~~~~~~~~~~~ >    __cond_lock > arch/powerpc/mm/nohash/kaslr_booke.c:411:4: error: implicit declaration > of function 'create_kaslr_tlb_entry'; did you mean 'reloc_kernel_entry'? Same, put the declaration outside of the #ifdef > [-Werror=implicit-function-declaration] >     create_kaslr_tlb_entry(1, tlb_virt, tlb_phys); >     ^~~~~~~~~~~~~~~~~~~~~~ >     reloc_kernel_entry > cc1: all warnings being treated as errors > make[3]: *** [scripts/Makefile.build:268: > arch/powerpc/mm/nohash/kaslr_booke.o] Error 1 > make[2]: *** [scripts/Makefile.build:505: arch/powerpc/mm/nohash] Error 2 > make[1]: *** [scripts/Makefile.build:505: arch/powerpc/mm] Error 2 > make: *** [Makefile:1681: arch/powerpc] Error 2 See the patch I sent you. It builds ok for me. Christophe