Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2318009ybh; Sun, 4 Aug 2019 22:41:30 -0700 (PDT) X-Google-Smtp-Source: APXvYqw1GXX0rUKxIVG/52HiD64xH/aOatThZ4lQkEJ2NoHvBsg3LoQ1vWij3lOMDxtlkpd5p7Ve X-Received: by 2002:a17:902:704c:: with SMTP id h12mr136205179plt.318.1564983689910; Sun, 04 Aug 2019 22:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564983689; cv=none; d=google.com; s=arc-20160816; b=O9Negb205bDddYyAsNwPAPeRaQMYDbypKVG4onf75b+WoJdNdHdDdq6uP2+txmov10 rPFlaKbpg+FvgFV80146t4AJXofynVHE4jk9Pb3rD7pvclSiAyAH7ZiQbcT9/xlh9XQN ugzCafdw/qYMc1pptNIh3GgY5xNYciKRiObx5GcuSTIy7UFWhgI/b8bBZWpACMlU+Evl Pujx5FxHu4vjdsZDop9xkrWC6aVZbtlJ5hqO8kbRb1jrs3CqS+ojkdrHU9pmPXXCxbb0 gJA2S3ktVZ6BQsEHlU8TeF2sgjt76koAiFkHCOrSCsIJUmuEYStG5T1comiupC8O5yAZ xd6g== 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=8y/Au1l3hJFQYQXzvdXX34QoiiVElGUjGn3I8J3Bz6E=; b=TlSTd+1/GhULHTryd6VF7lrrVdq79hNibdMVIrghhTWCInCck7vPY/e2q96Ed+sdQ/ fN8ps9IMH6yBixIS7MI3FfFkGdYg14Z1Si0xA4uXBIj7mTiKq6ilNHQZm5eRFNQ2lCDT pb1NYqTE0Z+GYyXld2hxadlYB6N8oAwikb2Q3ztIS70r1L9ZIgVHOsYHWTnmXvepDvsh NSK+GdKfJm2gol71urZGpaCyTNqpimQzzcXvE8/ZkejfKONDrZiKeA94RxaUqVjt4dgF 0f8Hva4JKn55sQDsWdko+JrMn6B5rCyevvzHAuxth9ZVdXl36vEcfxOYpWyML9GmDw0X LRNA== 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 p186si30703240pgp.373.2019.08.04.22.41.13; Sun, 04 Aug 2019 22:41:29 -0700 (PDT) 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 S1727193AbfHEFkj (ORCPT + 99 others); Mon, 5 Aug 2019 01:40:39 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:4168 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725951AbfHEFki (ORCPT ); Mon, 5 Aug 2019 01:40:38 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id E8C9ECD7BFBC6A7A222D; Mon, 5 Aug 2019 13:40:36 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.439.0; Mon, 5 Aug 2019 13:40:28 +0800 Subject: Re: [PATCH v3 06/10] powerpc/fsl_booke/32: implement KASLR infrastructure To: Diana Madalina Craciun , "mpe@ellerman.id.au" , "linuxppc-dev@lists.ozlabs.org" , "christophe.leroy@c-s.fr" , "benh@kernel.crashing.org" , "paulus@samba.org" , "npiggin@gmail.com" , "keescook@chromium.org" , "kernel-hardening@lists.openwall.com" CC: "linux-kernel@vger.kernel.org" , "wangkefeng.wang@huawei.com" , "yebin10@huawei.com" , "thunder.leizhen@huawei.com" , "jingxiangfeng@huawei.com" , "fanchengyang@huawei.com" , "zhaohongjiang@huawei.com" References: <20190731094318.26538-1-yanaijie@huawei.com> <20190731094318.26538-7-yanaijie@huawei.com> From: Jason Yan Message-ID: <356a9697-8208-3a63-8358-77422be482b2@huawei.com> Date: Mon, 5 Aug 2019 13:40:27 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.203] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Diana, On 2019/8/2 16:41, Diana Madalina Craciun wrote: >> diff --git a/arch/powerpc/kernel/fsl_booke_entry_mapping.S b/arch/powerpc/kernel/fsl_booke_entry_mapping.S >> index de0980945510..6d2967673ac7 100644 >> --- a/arch/powerpc/kernel/fsl_booke_entry_mapping.S >> +++ b/arch/powerpc/kernel/fsl_booke_entry_mapping.S >> @@ -161,17 +161,16 @@ skpinv: addi r6,r6,1 /* Increment */ >> lis r6,(MAS1_VALID|MAS1_IPROT)@h >> ori r6,r6,(MAS1_TSIZE(BOOK3E_PAGESZ_64M))@l >> mtspr SPRN_MAS1,r6 >> - lis r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_NEEDED)@h >> - ori r6,r6,MAS2_VAL(PAGE_OFFSET, BOOK3E_PAGESZ_64M, M_IF_NEEDED)@l >> - mtspr SPRN_MAS2,r6 >> + lis r6,MAS2_EPN_MASK(BOOK3E_PAGESZ_64M)@h >> + ori r6,r6,MAS2_EPN_MASK(BOOK3E_PAGESZ_64M)@l >> + and r6,r6,r20 >> + ori r6,r6,M_IF_NEEDED@l >> + mtspr SPRN_MAS2,r6 >> mtspr SPRN_MAS3,r8 >> tlbwe >> >> /* 7. Jump to KERNELBASE mapping */ > The code has changed, but the comment reflects the old code (it no > longer jumps to KERNELBASE, but to kimage_vaddr). This is true for step > 6 as well. > Good catch, I will update the comment. Thanks, Jason