Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3342355imu; Mon, 28 Jan 2019 03:13:26 -0800 (PST) X-Google-Smtp-Source: ALg8bN6d7NliIBddQ43AEGNH+yHJXrVyym22IjNqBdDD4fafhqAZ2L/k7rShp35HdxW1gJRa2bu7 X-Received: by 2002:a17:902:b494:: with SMTP id y20mr21782495plr.178.1548674006214; Mon, 28 Jan 2019 03:13:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548674006; cv=none; d=google.com; s=arc-20160816; b=vyBYdtB18wphRBcdhC8ARP5LgPbAlsHuiUaTE3rK59uiGBCb0WcGkwThkrnVZgeonx Ypk6TuY0BQCzIyI62eHtJtw8gpK6fFx8nw6HPeFDaTQuXGgq9NFA9RlctdPk8Uh/3rYf LY6QlaeeRaq5zyIKjyaRWzueavOEXogcqSynmVyauzdHOHpcYl3Jv9W92ozEUiP4PKNN CoSNWB7ztqTzVm5N/FQMfLVfk67iAQqyyzwI+SL6qITg1/KKk5uRdfNgxU8rw5loDhyE +8Unu/5vEFiMn+HshBPp32PExRXdYnBU4QXg5osBIS3QM+XgwMC8irbVWgPL42FBxMzE q2fQ== 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=AyYBnkRz/4MvD/VSD+gQXAbGVtQY9ZhLw8i+wuSRQ50=; b=Nt69b6OD+N4Za8i2OFInZxkt9ms4/uv9caQ1uOweR1XJIqkdpu8kW4+X1fsBBcVzYt 5MylkVAvCaVcm7n2tbrpkpJRh0MZalLFCP+aCCclYhBgjIznkz+A/A6dlGw9DoR3Jbpq Qq+LbuaNEp0VSYwXYbSRxBSNGIEhsYky7IVnaAdPhUe84NPoWJKwMtE2YRwTnuxZIoT2 yrK92VIHpUKliQo64QFlV786UvRAVlfL2tccuso7Ssk+J3vxvEkv8fqEh5olzK1dTrU+ HVIx4oMqatTyvPVOJ8Xr49MX12xXUr4U2XMrMEKcOA0BPLuqRik9hdnBfW0hwo3qxK2U KvXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=jx5YFrWl; 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 a2si17594987pgm.154.2019.01.28.03.13.11; Mon, 28 Jan 2019 03:13:26 -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=jx5YFrWl; 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 S1726661AbfA1LL1 (ORCPT + 99 others); Mon, 28 Jan 2019 06:11:27 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:13960 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726974AbfA1LLZ (ORCPT ); Mon, 28 Jan 2019 06:11:25 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 43p6Px0H8xz9v1q7; Mon, 28 Jan 2019 12:11:17 +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=jx5YFrWl; 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 KIDgJJsegvyA; Mon, 28 Jan 2019 12:11:16 +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 43p6Pw6J8Mz9v1q3; Mon, 28 Jan 2019 12:11:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1548673876; bh=AyYBnkRz/4MvD/VSD+gQXAbGVtQY9ZhLw8i+wuSRQ50=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=jx5YFrWlghVceATbzJmMeolYPPvAgVf05duup3oxY7LSMUvyzlZlVAqwAk4xTmnVJ TWmSiaqF32J0x+D+uprhCJBRWdSYyIew9B50LH79L6j+4KGeC9LvR901ANopYUvGuI Kpft34pltlsYEf6KjFs9ADj0Htd8tFN7SWMJe3HM= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 45FFD8B79D; Mon, 28 Jan 2019 12:11:23 +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 HgsHI-kOFg-5; Mon, 28 Jan 2019 12:11:23 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 248BC8B796; Mon, 28 Jan 2019 12:11:23 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 1D4EE72DE6; Mon, 28 Jan 2019 11:11:23 +0000 (UTC) Message-Id: <0ae6391c8794df0526d8e3fefba5863675028d5a.1548673552.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH 06/11] powerpc/32: move LOAD_MSR_KERNEL() into head_32.h and use it To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Mon, 28 Jan 2019 11:11:23 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As preparation for using head_32.h for head_40x.S, move LOAD_MSR_KERNEL() there and use it to load r10 with MSR_KERNEL value. Signed-off-by: Christophe Leroy --- arch/powerpc/kernel/entry_32.S | 9 +-------- arch/powerpc/kernel/head_32.h | 11 ++++++++++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/arch/powerpc/kernel/entry_32.S b/arch/powerpc/kernel/entry_32.S index 3f83e71ae43f..24d93231665b 100644 --- a/arch/powerpc/kernel/entry_32.S +++ b/arch/powerpc/kernel/entry_32.S @@ -37,14 +37,7 @@ #include #include -/* - * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. - */ -#if MSR_KERNEL >= 0x10000 -#define LOAD_MSR_KERNEL(r, x) lis r,(x)@h; ori r,r,(x)@l -#else -#define LOAD_MSR_KERNEL(r, x) li r,(x) -#endif +#include "head_32.h" /* * Align to 4k in order to ensure that all functions modyfing srr0/srr1 diff --git a/arch/powerpc/kernel/head_32.h b/arch/powerpc/kernel/head_32.h index f77f13142410..e302afd40d0a 100644 --- a/arch/powerpc/kernel/head_32.h +++ b/arch/powerpc/kernel/head_32.h @@ -13,6 +13,15 @@ #endif /* + * MSR_KERNEL is > 0x10000 on 4xx/Book-E since it include MSR_CE. + */ +#if MSR_KERNEL >= 0x10000 +#define LOAD_MSR_KERNEL(r, x) lis r,(x)@h; ori r,r,(x)@l +#else +#define LOAD_MSR_KERNEL(r, x) li r,(x) +#endif + +/* * Exception entry code. This code runs with address translation * turned off, i.e. using physical addresses. * We assume sprg3 has the physical address of the current @@ -86,7 +95,7 @@ #define EXC_XFER_TEMPLATE(n, hdlr, trap, copyee, tfer, ret) \ li r10,trap; \ stw r10,_TRAP(r11); \ - li r10,MSR_KERNEL; \ + LOAD_MSR_KERNEL(r10, MSR_KERNEL); \ copyee(r10, r9); \ bl tfer; \ i##n: \ -- 2.13.3