Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3968845imu; Tue, 18 Dec 2018 07:07:10 -0800 (PST) X-Google-Smtp-Source: AFSGD/WmpMOHEGZbFyRMrtO/Ujo+13SqPZap3wBlTsx6sV2zXd9ywYr1FqzkBBURckzeR1dxhnn+ X-Received: by 2002:a63:f901:: with SMTP id h1mr16045616pgi.154.1545145630640; Tue, 18 Dec 2018 07:07:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545145630; cv=none; d=google.com; s=arc-20160816; b=hM9uxGND2Mq4YhvX2/G5m0elxqo8xbW1O7QAtn80ee8UGzTxGVEPRw9HltPXLDMfkv MaoGWK0e94yT+BUheS6iXMMttjoBnbt2leryTvXFUYfCZOeeEvZBGLFqTR0Aj9bxiqcZ KrHB1heCX9oJKGds9ejUqNR/PEFA+7DwnzeQsPwnLU4OhCZMPCqKVybAkPXM+GFXRulZ Flumi1uv2/C9rcn8bYPRBttBFnON+ghKtB7mo5QrAuaqGjV0nzFHa+8I9Qe4iKpPxDop I/X7A4IohofFI2QCit9lTVGqRj6LNmXwnj0yup3CIv7lGhcJKZPcePI4e+sNHQFz38pf V9jw== 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; bh=womXiqn7J/2R8+AiaTk+pEAmXYAgd3+5kkqJVk9KnRk=; b=chSE9BT0iH8m1aDNbqRoyvo3ggfF/gn3s73JtkmHgF27zkR+EY0/x/5cV2G+76NaH5 jnXUbPeHf2FMv1ppRs2lUDHjI1j5JkJjrzihjelNfsDD7IsvO43+jTHPRf3a+d47j0kR VsM89/NSq3A15mVrDWOCuzEgVLGZagcoAcnzGkHxiYCrjnmZmLsAXhBmm1KhdmFYbgha MmzOO0TI7JKAG9umQJJoz/37DSTbkuvn3hgi4+vLhRpXkMydsYIh8n/TibmNL2eAmGjp PMVdAc2uhP29i5Q88+XftK6BVTAeCsDHajABHoRzzxtBvYy6Z6pHrN2DGeZWRgebJk2A Igtw== ARC-Authentication-Results: i=1; mx.google.com; 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 s13si13713071pgc.509.2018.12.18.07.06.27; Tue, 18 Dec 2018 07:07:10 -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; 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 S1727030AbeLRPEp (ORCPT + 99 others); Tue, 18 Dec 2018 10:04:45 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:15741 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726814AbeLRPEo (ORCPT ); Tue, 18 Dec 2018 10:04:44 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43K1X93cMnz9v13J; Tue, 18 Dec 2018 16:04:41 +0100 (CET) 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 0BvmFGjwrw8m; Tue, 18 Dec 2018 16:04:41 +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 43K1X92vb5z9v136; Tue, 18 Dec 2018 16:04:41 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id D95F78B852; Tue, 18 Dec 2018 16:04:42 +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 9Db4sQfaWZbV; Tue, 18 Dec 2018 16:04:42 +0100 (CET) Received: from PO15451 (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 669108B754; Tue, 18 Dec 2018 16:04:42 +0100 (CET) Subject: Re: [PATCH v1 03/13] powerpc/mm/32s: rework mmu_mapin_ram() To: =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= Cc: linuxppc-dev@lists.ozlabs.org, Paul Mackerras , linux-kernel@vger.kernel.org References: <8835330baa77d88e0267b0b1215b78c991e6d17a.1543517818.git.christophe.leroy@c-s.fr> <20181203215558.GK15324@latitude> <84624899-bbda-9f08-2527-151fddbd1b01@c-s.fr> <20181217012837.GT15324@latitude> <18ba3a7c-ebfa-66aa-e231-b56985d0e89a@c-s.fr> <20181218030538.GA24278@latitude> <9a39d910-2a05-3ce7-c949-296db2d458b9@c-s.fr> <20181218140714.GC24278@latitude> <96539c09-ea57-43d6-bae9-7371235b175f@c-s.fr> From: Christophe Leroy Message-ID: Date: Tue, 18 Dec 2018 16:04:42 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; 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 18/12/2018 ? 15:55, Christophe Leroy a ?crit?: > > > Le 18/12/2018 ? 15:15, Christophe Leroy a ?crit?: >> >> >> Le 18/12/2018 ? 15:07, Jonathan Neusch?fer a ?crit?: >>> On Tue, Dec 18, 2018 at 09:18:42AM +0000, Christophe Leroy wrote: >>>> The only difference I see then are the flags. Everything else is seems >>>> identical. >>>> >>>> I know you tried already, but would you mind trying once more with the >>>> following change ? >>>> >>> [...] >>>> -??????? setbat(idx, PAGE_OFFSET + base, base, size, PAGE_KERNEL_TEXT); >>>> +??????? setbat(idx, PAGE_OFFSET + base, base, size, PAGE_KERNEL_X); >>> >>> Good call, with this workaround on top of patches 1-3, it boots again: >>> >>> ????# mount -t debugfs d /sys/kernel/debug >>> ????# cat /sys/kernel/debug/powerpc/block_address_translation >>> ????---[ Instruction Block Address Translation ]--- >>> ????0: 0xc0000000-0xc0ffffff 0x00000000 Kernel EXEC >>> ????1:???????? - >>> ????2: 0xc1000000-0xc17fffff 0x01000000 Kernel EXEC >>> ????3:???????? - >>> ????4: 0xd0000000-0xd1ffffff 0x10000000 Kernel EXEC >>> ????5:???????? - >>> ????6:???????? - >>> ????7:???????? - >>> >>> ????---[ Data Block Address Translation ]--- >>> ????0: 0xc0000000-0xc0ffffff 0x00000000 Kernel RW >>> ????1: 0xfffe0000-0xffffffff 0x0d000000 Kernel RW no cache guarded >>> ????2: 0xc1000000-0xc17fffff 0x01000000 Kernel RW >>> ????3:???????? - >>> ????4: 0xd0000000-0xd1ffffff 0x10000000 Kernel RW >>> ????5:???????? - >>> ????6:???????? - >>> ????7:???????? - >>> >>>> I think we may have some code trying to modify the kernel text >>>> without using >>>> code patching functions. >>> >>> Is there any faster way than to sprinkle some printks in setup_kernel >>> and try to find the guilty piece of code this way? >> >> Can you start with the serie >> https://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=75072 ? > > Ok, the thing I was thinking about was the MMU_init_hw() but it is > called before mapin_ram() so it should not be a problem. Not sure that > serie improves anything at all here. > > So there must be something else, pretty early (before the system is able > to properly handle and display an Oops for write to RO area.) > > Does anybody have an idea of what it can be ? Stupid of me. In fact at the time being, BATS cover both RO and RW data areas, so it can definitly not be mapped with PAGE_KERNEL_ROX. In fact, as I have CONFIG_BDI_SWITCH in my setup, PAGE_KERNEL_TEXT is PAGE_KERNEL_X on my side. That's the reason why I missed it. With this change being done to patch 3, does the overall serie works for you ? Thanks Christophe > > Christophe > >> >> Christophe >> >>> >>> >>> Jonathan >>>