Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1648687ybl; Sat, 25 Jan 2020 05:29:11 -0800 (PST) X-Google-Smtp-Source: APXvYqwUc3KSgXwoN/MAWEii6cNiGBUaAqzHJIp+MdpYyL2/P6jd9R0uDs2gVgqM0FH9FhU4QBZ8 X-Received: by 2002:aca:f354:: with SMTP id r81mr2306567oih.90.1579958951197; Sat, 25 Jan 2020 05:29:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579958951; cv=none; d=google.com; s=arc-20160816; b=c7T8k/x7VtmeETIrLztmfsHfzlzomXCMSqkZbIYlX2mztXUxuz3Yv/G5qfTj5tnVXs GvZ2U7R5RyQk51xN41Of62pORYmww8qnLo4UkyTdvlIfo1owocL26truqk+lpmjCVR4H qDnu9EFKnrL4Ec/7jQVxBruFuyhvpDZjjiZc8k86zwXMBUq7vRcLSWyQK4bdogg1hI+9 K4zSBXI8P3B+GqkbcjVRRl9Pxp8eiTnhqPu19mnEL5DVKF+dhK5IS0a0pEMaXhG723UI rUg7wZt4kPgjfgh6dzmvj+X/Tlic817qUQlSxbOvaIqUX/4EQj7K4ABBOtddkyHlJAEs ZapQ== 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:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=cwCinD9sLdrcghfNzTxTQyNszSm2DPWAnyZNhTKPXIs=; b=vT0rzA79e3asA4r/1wJs70zrhtvBppyEUhH6JlBbiv4exfZ1Bk3ZkzwiRSuBP456LE V/ETvF8rDJNXWGiJwodcy/cfEmGcw+W1cs29VEvg1yH9CjYcFfepTCfQMqvtqkB82voJ calXzqApPhR6s8TQFf1nigaDTZViXrzL7QndCmOVs0YDfc0UidR0ea1j3M4wgdSbImGR now2q93h59OAdfuBZRWgp4lu446E3Xw+RlEbKsai52zwbHUjFj9nO4u51SjJlK/vfubV xU0wkr991277ZJHWGUffXuQif1DhYRZDsjVU/Rmbb/3s8p6RtDXXAzCeOZ0LsW+j/LdK 6KiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=fBmBza3p; 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 8si3996373ota.266.2020.01.25.05.28.58; Sat, 25 Jan 2020 05:29:11 -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=@ellerman.id.au header.s=201909 header.b=fBmBza3p; 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 S1726690AbgAYN2I (ORCPT + 99 others); Sat, 25 Jan 2020 08:28:08 -0500 Received: from ozlabs.org ([203.11.71.1]:51217 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725710AbgAYN2I (ORCPT ); Sat, 25 Jan 2020 08:28:08 -0500 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 484cJj1cFFz9sP6; Sun, 26 Jan 2020 00:28:05 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ellerman.id.au; s=201909; t=1579958885; bh=hrN2cDvQml3IWViJQOWK0NfFHm1QM+DSycnJ6yh5o6Y=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=fBmBza3pY8IaqQVQIQIr1Goqw77sYg4IV8ExncGYSuzAr1Jic6QrQA8DuNBGNSXpB fWZL96GDOtZXsC1dk2UZ76lURFiub+FFmIgPzlyI3disq2/i6gt6kGGik6bhpTJeQH +51Ahks4PUegxHmwZ5rsfmfCEfsQ68xPZwK62rD6hCs6hdh5sgUW9FVYoefH6vM1Yt EOftKAyiYji9KgchHK7X5neeoIwsjoIB7rpLQFHXpEUyiO5EUKD1y3nx5H3UPqv3Ma HKqDFmkON+DPvdAuIwRrH/iY1h1CxWup6TIbsvfwWZbq9ZOE9yBkZKKQg4xbis3i2u WymMNmxiRQT2g== From: Michael Ellerman To: Christophe Leroy Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Paul Mackerras , Benjamin Herrenschmidt Subject: Re: [PATCH] powerpc/32: Add missing context synchronisation with CONFIG_VMAP_STACK In-Reply-To: <20200125140052.Horde.0-n2_EcIdGahTxfDVj913w1@messagerie.si.c-s.fr> References: <872477f7c7552d3bb7baf0b302398fcd42c5fcfd.1579885334.git.christophe.leroy@c-s.fr> <87r1znhgvi.fsf@mpe.ellerman.id.au> <20200125140052.Horde.0-n2_EcIdGahTxfDVj913w1@messagerie.si.c-s.fr> Date: Sun, 26 Jan 2020 00:28:04 +1100 Message-ID: <87o8urhdi3.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Michael Ellerman a =C3=A9crit=C2=A0: >> Christophe Leroy writes: ... >>> diff --git a/arch/powerpc/kernel/head_32.h b/arch/powerpc/kernel/head_3= 2.h >>> index 73a035b40dbf..a6a5fbbf8504 100644 >>> --- a/arch/powerpc/kernel/head_32.h >>> +++ b/arch/powerpc/kernel/head_32.h >>> @@ -43,6 +43,7 @@ >>> .ifeq \for_rtas >>> li r11, MSR_KERNEL & ~(MSR_IR | MSR_RI) /* can take DTLB miss */ >>> mtmsr r11 >>> + isync >> >> Actually this one leads to: >> >> /home/michael/linux/arch/powerpc/kernel/head_8xx.S: Assembler messages: >> /home/michael/linux/arch/powerpc/kernel/head_8xx.S:151: Error:=20=20 >> attempt to move .org backwards >> make[3]: *** [/home/michael/linux/scripts/Makefile.build:348:=20=20 >> arch/powerpc/kernel/head_8xx.o] Error 1 >> >> For mpc885_ads_defconfig. >> >> That's the alignment exception overflowing into the program check >> handler: >> >> /* Alignment exception */ >> . =3D 0x600 >> Alignment: >> EXCEPTION_PROLOG handle_dar_dsisr=3D1 >> save_dar_dsisr_on_stack r4, r5, r11 >> li r6, RPN_PATTERN >> mtspr SPRN_DAR, r6 /* Tag DAR, to be used in DTLB Error */ >> addi r3,r1,STACK_FRAME_OVERHEAD >> EXC_XFER_STD(0x600, alignment_exception) >> >> /* Program check exception */ >> EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD) >> >> >> Can't see an obvious/easy way to fix it. > > Argh ! > > I think the easiest is to move the EXC_XFER_STD(0x600,=20=20 > alignment_exception) somewhere else and branch to it. There is some=20=20 > space at .0xa00 That works, or builds at least. I'm not setup to boot test it. Does this look OK? cheers From 40e7d671aa27cf4411188f978b2cd06b30a9cb6c Mon Sep 17 00:00:00 2001 From: Michael Ellerman Date: Sun, 26 Jan 2020 00:20:16 +1100 Subject: [PATCH] powerpc/8xx: Move tail of alignment exception out of line When we enable VMAP_STACK there will not be enough room for the alignment handler at 0x600 in head_8xx.S. For now move the tail of the alignment handler out of line, and branch to it. Suggested-by: Christophe Leroy Signed-off-by: Michael Ellerman --- arch/powerpc/kernel/head_8xx.S | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S index 477933b36bde..9922306ae512 100644 --- a/arch/powerpc/kernel/head_8xx.S +++ b/arch/powerpc/kernel/head_8xx.S @@ -145,7 +145,7 @@ _ENTRY(_start); li r6, RPN_PATTERN mtspr SPRN_DAR, r6 /* Tag DAR, to be used in DTLB Error */ addi r3,r1,STACK_FRAME_OVERHEAD - EXC_XFER_STD(0x600, alignment_exception) + b .Lalignment_exception_ool =20 /* Program check exception */ EXCEPTION(0x700, ProgramCheck, program_check_exception, EXC_XFER_STD) @@ -153,6 +153,11 @@ _ENTRY(_start); /* Decrementer */ EXCEPTION(0x900, Decrementer, timer_interrupt, EXC_XFER_LITE) =20 + /* With VMAP_STACK there's not enough room for this at 0x600 */ + . =3D 0xa00 +.Lalignment_exception_ool: + EXC_XFER_STD(0x600, alignment_exception) + /* System call */ . =3D 0xc00 SystemCall: --=20 2.21.1