Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp245888pxb; Mon, 8 Feb 2021 22:04:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJwkReSyBaLZt4r1hfbYQ5+R7U2khxFobYaIT7qqVb0O+h9puRYA19NaCDSmhtQtXvxIKZC4 X-Received: by 2002:a17:906:86cf:: with SMTP id j15mr20312893ejy.194.1612850678526; Mon, 08 Feb 2021 22:04:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612850678; cv=none; d=google.com; s=arc-20160816; b=fwQvM2tgUZA4yKrML7PV2gAkPPJLoJTkjpmqtPUoiNhVYFI7V2reRRCEEHuEGPHzY0 DR+39u/t8d87rPQ5bE9ygEBZxpiLJqnbx4qfiDYA2tEYNN6iNuIfLJoLZq8sm+RpKU6Q esUdO1vOwzWv1GujrLj6gWPKcorLdLsaa7PujiJMnJgKdysAX7EV0Yo3ZBiounA/NwyJ mjRDSoooO9orf6xHWIbwENxDjhL+0ledjG3PZqCgeYC+SO6ctGE5A4HruVkbWQx35tm9 U5HeWXAp79cglGfTTo85ybjCj2VPfsQOO8dQBGhOQlqyRSk3E9fdBGBV/5bF9OnLoD41 Yo5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=qBR3jeAysfwakb7aA+iQee72EBbcunWohdIl7g6UUAc=; b=gbK7lWbJsCYZnjj1HRXwsQLzlvZ1ILZHP7smVYhY0x3sXHiC48MriNJwA94Pq1Sih2 nQMS6p/d7AXyLqLycZlMPyKPDbEn9KwG7C7QGpTpfmvXMy3V5Je78fwCb5fXrQ5YI3wi gs9Qt3G4niqZhkC4AOfRF+NxXO0GkHZk/i29jo5NZ00yRR7sgarqWfVJg2jEH6cJU9BY nQPxVRrQt3oXyEUtndmV4oucU5BmqQlMyf+HHrUFryQ39OmR45kaIP+kFIUY8MgXcxhN wAfGXP2hDk4BFgNmhqGANgnOrVvdKj1eTMKTe51e2Gg7nPBZD206NNQOCi7eRvvvLJRg LPew== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q16si13015372edc.229.2021.02.08.22.04.09; Mon, 08 Feb 2021 22:04:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbhBIGDV (ORCPT + 99 others); Tue, 9 Feb 2021 01:03:21 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:40732 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbhBIGDL (ORCPT ); Tue, 9 Feb 2021 01:03:11 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 4DZXNZ2YGtz9vBmJ; Tue, 9 Feb 2021 07:02:22 +0100 (CET) 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 L0tlxnlezxup; Tue, 9 Feb 2021 07:02:22 +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 4DZXNZ1dmhz9vBLv; Tue, 9 Feb 2021 07:02:22 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id B42DE8B7C9; Tue, 9 Feb 2021 07:02:22 +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 EaRDrqLwf-EG; Tue, 9 Feb 2021 07:02:22 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id F2D568B764; Tue, 9 Feb 2021 07:02:21 +0100 (CET) Subject: Re: [PATCH v5 09/22] powerpc/syscall: Make interrupt.c buildable on PPC32 To: Nicholas Piggin , Benjamin Herrenschmidt , Michael Ellerman , msuchanek@suse.de, Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <1612833796.dl9doe6njg.astroid@bobo.none> From: Christophe Leroy Message-ID: <73fd6e9b-fe99-e804-d681-c0a22b9bef38@csgroup.eu> Date: Tue, 9 Feb 2021 07:02:20 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <1612833796.dl9doe6njg.astroid@bobo.none> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 09/02/2021 à 02:27, Nicholas Piggin a écrit : > Excerpts from Christophe Leroy's message of February 9, 2021 1:10 am: >> To allow building interrupt.c on PPC32, ifdef out specific PPC64 >> code or use helpers which are available on both PP32 and PPC64 >> >> Modify Makefile to always build interrupt.o >> >> Signed-off-by: Christophe Leroy >> --- >> v5: >> - Also for interrupt exit preparation >> - Opted out kuap related code, ppc32 keeps it in ASM for the time being >> --- >> arch/powerpc/kernel/Makefile | 4 ++-- >> arch/powerpc/kernel/interrupt.c | 31 ++++++++++++++++++++++++------- >> 2 files changed, 26 insertions(+), 9 deletions(-) >> >> diff --git a/arch/powerpc/kernel/interrupt.c b/arch/powerpc/kernel/interrupt.c >> index d6be4f9a67e5..2dac4d2bb1cf 100644 >> --- a/arch/powerpc/kernel/interrupt.c >> +++ b/arch/powerpc/kernel/interrupt.c >> @@ -39,7 +39,7 @@ notrace long system_call_exception(long r3, long r4, long r5, >> BUG_ON(!(regs->msr & MSR_RI)); >> BUG_ON(!(regs->msr & MSR_PR)); >> BUG_ON(!FULL_REGS(regs)); >> - BUG_ON(regs->softe != IRQS_ENABLED); >> + BUG_ON(arch_irq_disabled_regs(regs)); >> >> #ifdef CONFIG_PPC_PKEY >> if (mmu_has_feature(MMU_FTR_PKEY)) { >> @@ -65,7 +65,9 @@ notrace long system_call_exception(long r3, long r4, long r5, >> isync(); >> } else >> #endif >> +#ifdef CONFIG_PPC64 >> kuap_check_amr(); >> +#endif > > Wouldn't mind trying to get rid of these ifdefs at some point, but > there's some kuap / keys changes going on recently so I'm happy enough > to let this settle then look at whether we can refactor. I have a follow up series that implements interrupts entries/exits in C and that removes all kuap assembly, I will likely release it as RFC later today. > >> >> account_cpu_user_entry(); >> >> @@ -318,7 +323,7 @@ notrace unsigned long syscall_exit_prepare(unsigned long r3, >> return ret; >> } >> >> -#ifdef CONFIG_PPC_BOOK3S /* BOOK3E not yet using this */ >> +#ifndef CONFIG_PPC_BOOK3E_64 /* BOOK3E not yet using this */ >> notrace unsigned long interrupt_exit_user_prepare(struct pt_regs *regs, unsigned long msr) >> { >> #ifdef CONFIG_PPC_BOOK3E > > Why are you building this for 32? I don't mind if it's just to keep > things similar and make it build for now, but you're not using it yet, > right? The series using that will follow, I thought it would be worth doing this at once. > > Reviewed-by: Nicholas Piggin >