Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4144714ybl; Sat, 21 Dec 2019 00:34:01 -0800 (PST) X-Google-Smtp-Source: APXvYqy8XBSsg8cm9a9rdysEe4EoA70uNvMG94ZeVFSHKISe960DOVPvkOspOKBzpRIazSNUgl56 X-Received: by 2002:a9d:7e8c:: with SMTP id m12mr20441270otp.346.1576917241692; Sat, 21 Dec 2019 00:34:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576917241; cv=none; d=google.com; s=arc-20160816; b=sMbo5XKkJ9+4ep2rInV7UqT0EuqMLC3X36Wym88twUBD47Vgj+if0dazCfJu3s42Jx yL68KwPa9AH4NuhbnbHtEZlhlCiC3KN1knXR4h4IvvQMMXuUJQtSKUUVRUswHcR2f3ii vGG/Pgd5cr9c63y2LYGEHVQ230zqwdb6Wu6ey9EO/+zdLVDvpgx2lC+sbJNu/QwG6DgT ecWuFiR7SBXRLrHWvGqbh+Kt+49+V7xX8+oy/zIKhG+YeBolaLCg6jUFt5TNndGmwoko 86EPH1D+FKI3WLCxazAnuX2sjz1nT05/1gTryRWwtWsQCes5I1kuekXyADP5EnVoTQuw olMw== 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=SC36APZwmLeWSOKofYlYV8g+quAl6QWkw2eZCdRfb02RbdnWmBsNNraySN7gAEu2yR iPuyOBPHkCTNSh+GMr+MEUwaLqKYBCaiVD9Y+twC4WVvAGVWRBNYx300R80fWdehK0Ue 2V01nj6UEHLTPGuxPuC3ZWINDjlLnRGiYP2t/qP9W6758DbSE79KGTwCd5GkGIt/1j1P /8e201rcThvhkvE5HXIkw/n7tXQIYVKXj78/h09oHS4BCgOJFbfSe3/cy27syueftJD6 goWWjM/uw7ud3oI5/AOnkrdZSQN7Tw59yz5PmXlb03vUSXbrjulSn3bmU7lAC1s4u2XJ LIkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=qTms3eIk; 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 w196si1927834oia.135.2019.12.21.00.33.50; Sat, 21 Dec 2019 00:34:01 -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=qTms3eIk; 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 S1727014AbfLUIcu (ORCPT + 99 others); Sat, 21 Dec 2019 03:32:50 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:19172 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726885AbfLUIck (ORCPT ); Sat, 21 Dec 2019 03:32:40 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47fzPx461nz9txh9; Sat, 21 Dec 2019 09:32:37 +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=qTms3eIk; 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 teNqOt-k_Vr5; Sat, 21 Dec 2019 09:32:37 +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 47fzPx33Gvz9txh8; Sat, 21 Dec 2019 09:32:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1576917157; bh=s9tlncPBPF5ltYj2UYw1kqY6LrypIxcWu7hdOtJZAuk=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=qTms3eIk2zKkMN/kwQc1BnM/S7KR4OnLEdLMCb4yf03SSme6S5LkKlrAUuX1wiDlK 9Scyfud9umGbrASJBaEzLlXZTRfeEZg08j/qP5eZfwrr73IARVTNbhgG2mj1FF9g9/ BzTRFv4lRtu2XEqwgwaybdGe1QWVB/jRiEIgudFY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 4E21B8B77C; Sat, 21 Dec 2019 09:32:38 +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 kNRebGGzUM1g; Sat, 21 Dec 2019 09:32:38 +0100 (CET) Received: from localhost.localdomain (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1762D8B752; Sat, 21 Dec 2019 09:32:38 +0100 (CET) Received: by localhost.localdomain (Postfix, from userid 0) id D4AED637B6; Sat, 21 Dec 2019 08:32:37 +0000 (UTC) Message-Id: <30d2cda111b7977227fff067fa7e358440e2b3a4.1576916812.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 16/17] powerpc/32s: avoid crossing page boundary while changing SRR0/1. To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , dja@axtens.net Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Date: Sat, 21 Dec 2019 08:32:37 +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