Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp4163797ybc; Tue, 26 Nov 2019 04:58:03 -0800 (PST) X-Google-Smtp-Source: APXvYqxmIrfpVD4AL8S41K4x08yus/OZVU6AW+QbJQP6qfoJPXHGoYt0ssPrkU5P3j2nMy9MU2Fd X-Received: by 2002:a17:907:38e:: with SMTP id ss14mr42038342ejb.319.1574773083759; Tue, 26 Nov 2019 04:58:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574773083; cv=none; d=google.com; s=arc-20160816; b=r/eyEWp8VrIC3vfo5YmrjdYK6aXNhKOxSK6tU85L/2e9q2izIlT0bJALrw1ikSo2ZR miljuXsPCsOYSAGw319mFt47tO6WAkbhONMpog0/VH+ET+UIH2BXNUMIjA/fpBVFTwul mfS1AtYxqJSelaTKL97PQ2dZjk8ATkkWo3X8sIKzJTy+O9SyJa9gl9vYW+EKPvrOkSmR o7id4FZww3vxBb77FN7WIZES0Sv4e44ioa6mCs3Zz7KgwsNAoCh+FsOp7TrW3gFRhg/e 6fAL4jFUhk5J8GtxXM02xDpdOX2Li7nJ/xFb56iqkoNDM8vX8H+0ZSgSEN0G0nXrB8g0 hz5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=s9tlncPBPF5ltYj2UYw1kqY6LrypIxcWu7hdOtJZAuk=; b=FVjr5DXBihVju26Sc1k6avpE3C5MLViSzRPIeU+D6lxwsdpCvbebPnmWBRpB8/30+8 c9kD0BkJcAYCkWCz6sq57etWSyMtrzwIKi/2oZdRXgqKUwILdEtDFi5FOMT7d8kZZMmg 8coaxseXtdBECQ/A8GctgPO2Ln3YP3gPE9nPIGcM599Ak2eVFq0unV3ZC9kjC7JFQqiM 2WlNji22XOqnZ35uizMQ19SUqmrUMaKfUR35OgOrItDC0lQMNm2xSSwk9i8UXSPgKv7E PYpFQzzGsnByEotvqLF8iVmFHoghIB/+3IxEHpNWpFLk/sihalzmBzIU6DJzf4K/ZY4K DvSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=vKnVWwi1; 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 q7si6783730ejn.26.2019.11.26.04.57.40; Tue, 26 Nov 2019 04:58:03 -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=vKnVWwi1; 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 S1727882AbfKZMgq (ORCPT + 99 others); Tue, 26 Nov 2019 07:36:46 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:25835 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728503AbfKZMgU (ORCPT ); Tue, 26 Nov 2019 07:36:20 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47Mk0f4kSJz9v0GG; Tue, 26 Nov 2019 13:36:18 +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=vKnVWwi1; 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 j7cYA0H7ljob; Tue, 26 Nov 2019 13:36:18 +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 47Mk0f3dZ2z9v0G3; Tue, 26 Nov 2019 13:36:18 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1574771778; bh=s9tlncPBPF5ltYj2UYw1kqY6LrypIxcWu7hdOtJZAuk=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=vKnVWwi1CrMDc8/rLU1b2ZgDialXDeZSsBw8fiQ2N6GB0pNMhFx1AXe4EE1t9VJXi X737itTGvdYlBTb0kVaTZfjBoIgo2i8wWzQdELUJLaRqN+USUz8E7I1d8uCdo5OIj6 wBSmoDmVo9D4OClqOZR8uadiXOPuN65ygCZZtyRc= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id CF7B08B7FC; Tue, 26 Nov 2019 13:36:19 +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 tuGdE3dHxdTA; Tue, 26 Nov 2019 13:36:19 +0100 (CET) Received: from po16098vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9C3C48B771; Tue, 26 Nov 2019 13:36:19 +0100 (CET) Received: by po16098vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 673AB6B76A; Tue, 26 Nov 2019 12:36:19 +0000 (UTC) Message-Id: <5bd5ce84265711f7611b028edbca7f0fe9565499.1574771541.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 15/16] powerpc/32s: avoid crossing page boundary while changing SRR0/1. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Date: Tue, 26 Nov 2019 12:36:19 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Trying VMAP_STACK with KVM, vmlinux was not starting. This was due to SRR0 and SRR1 clobbered by an ISI due to the rfi being in a different page than the mtsrr0/1: c0003fe0 : c0003fe0: 38 83 00 54 addi r4,r3,84 c0003fe4: 7c 60 00 a6 mfmsr r3 c0003fe8: 70 60 00 30 andi. r0,r3,48 c0003fec: 4d 82 00 20 beqlr c0003ff0: 7c 63 00 78 andc r3,r3,r0 c0003ff4: 7c 9a 03 a6 mtsrr0 r4 c0003ff8: 7c 7b 03 a6 mtsrr1 r3 c0003ffc: 7c 00 04 ac hwsync c0004000: 4c 00 00 64 rfi Align the 4 instruction block used to deactivate MMU to order 4, so that the block never crosses a page boundary. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/head_32.S | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 7ec780858299..90ef355e958b 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S @@ -917,6 +917,8 @@ END_MMU_FTR_SECTION_IFSET(MMU_FTR_HPTE_TABLE) ori r4,r4,2f@l tophys(r4,r4) li r3,MSR_KERNEL & ~(MSR_IR|MSR_DR) + + .align 4 mtspr SPRN_SRR0,r4 mtspr SPRN_SRR1,r3 SYNC @@ -1058,6 +1060,8 @@ _ENTRY(update_bats) rlwinm r0, r6, 0, ~MSR_RI rlwinm r0, r0, 0, ~MSR_EE mtmsr r0 + + .align 4 mtspr SPRN_SRR0, r4 mtspr SPRN_SRR1, r3 SYNC @@ -1097,6 +1101,8 @@ mmu_off: andi. r0,r3,MSR_DR|MSR_IR /* MMU enabled? */ beqlr andc r3,r3,r0 + + .align 4 mtspr SPRN_SRR0,r4 mtspr SPRN_SRR1,r3 sync -- 2.13.3