Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp486793pxj; Thu, 20 May 2021 14:10:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzOLRyN7uJ4xOP6gOhpwor+u+QZ4DrX/Isyo0prRWwG4WrfnXgZn9rgKKxExVOutA46N68 X-Received: by 2002:a5d:8c89:: with SMTP id g9mr7589758ion.27.1621545058528; Thu, 20 May 2021 14:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621545058; cv=none; d=google.com; s=arc-20160816; b=oEGuu7y8TGjbi5ZRsL0h8N+mPhT58gLzopW+v6AGYHawyjm0IXszq5+lss+/pKANQA jKaY9m+Dwog/DIG3bMrkDuZy+dqAFxuafXNsl0DhKdmsmeOVV0/fvrY4Crjyz6bm+pnZ UeKsn1iJ2C1U+JjctAmuLv0Oej4gyE8zHHsdoKigLdNfZuKfKYNu6zgpFHWPsFHLXlTb rIPaeDgCXABzR2zdemdsY9dPrCMSv2OLj8yeOGleVHBE27Laxq882jDU9qLQh27b9lW/ QE1RwgArTgTPFJxvbWa2i0U3U52cCwulGQbOvpc+AnUFrcD1u4aZm2SxCHdO9VIhUC1x 1Oaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:cc:to:subject:from:references:in-reply-to :message-id; bh=AT3Z9SpVEdxPbB2P6zmIjTh8770NvJj+EHNvUpkRxQg=; b=SOWdpZmSWlA1bbq6uTPYcWbSrAdp2SY7b4ec8JBmg10VX694T8nIyDjQZ2pE9OCcWx mUv+6nt2M6VumiGQdh/fJ8GeIrjthD6r0hwieKOCgKqmjdYWsVKFR2nRVVQaAzRLUV1G q+BUBUQYuPAEtf7rxtPFKLBtG8zleNy1rhoUHH7hounBYf1vb8QkLRnQhSm6jegtvZYD UxQrk89wWSipWCDfgFrZxaK1HSqk0jzF/QLGMUtyVKoG8MTFGPZLp9bWEcss35Dqz316 ieNsRDxoHxScmR30/p3yZdU03cNVdY4RthX5UzVzEGnEsvhjcHlzufI7zNmFv4iJ6oxa XsMA== 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 g10si3183667iow.86.2021.05.20.14.10.45; Thu, 20 May 2021 14:10:58 -0700 (PDT) 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 S239134AbhETLB7 (ORCPT + 99 others); Thu, 20 May 2021 07:01:59 -0400 Received: from pegase2.c-s.fr ([93.17.235.10]:47541 "EHLO pegase2.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237837AbhETKnq (ORCPT ); Thu, 20 May 2021 06:43:46 -0400 Received: from localhost (mailhub3.si.c-s.fr [172.26.127.67]) by localhost (Postfix) with ESMTP id 4Fm5RP0yJGz9sVM; Thu, 20 May 2021 12:23:13 +0200 (CEST) X-Virus-Scanned: amavisd-new at c-s.fr Received: from pegase2.c-s.fr ([172.26.127.65]) by localhost (pegase2.c-s.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lyORN56gO6fB; Thu, 20 May 2021 12:23:13 +0200 (CEST) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase2.c-s.fr (Postfix) with ESMTP id 4Fm5RL6F4Hz9sVm; Thu, 20 May 2021 12:23:10 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id C488C8B811; Thu, 20 May 2021 12:23:10 +0200 (CEST) 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 nd7usmZ46FH0; Thu, 20 May 2021 12:23:10 +0200 (CEST) Received: from po15610vm.idsi0.si.c-s.fr (po15451.idsi0.si.c-s.fr [172.25.230.105]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 92A6C8B80D; Thu, 20 May 2021 12:23:10 +0200 (CEST) Received: by po15610vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7B6C164C44; Thu, 20 May 2021 10:23:10 +0000 (UTC) Message-Id: <0945c155d6cb113431185fc1296ac127359fe29b.1621506159.git.christophe.leroy@csgroup.eu> In-Reply-To: <5d146b31b943e7ad674894421db4feef54804b9b.1621506159.git.christophe.leroy@csgroup.eu> References: <5d146b31b943e7ad674894421db4feef54804b9b.1621506159.git.christophe.leroy@csgroup.eu> From: Christophe Leroy Subject: [PATCH v1 11/12] powerpc/traps: Start using PPC_RAW_xx() macros To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , naveen.n.rao@linux.vnet.ibm.com, jniethe5@gmail.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Thu, 20 May 2021 10:23:10 +0000 (UTC) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Start using PPC_RAW_xx() macros where relevant. PPC_INST_SYNC is used to both represent the 'sync' instruction and the family of synchronisation instructions. Keep it for the later, maybe we'll change the name in the future to avoid confusion. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ppc-opcode.h | 1 - arch/powerpc/kernel/traps.c | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/powerpc/include/asm/ppc-opcode.h b/arch/powerpc/include/asm/ppc-opcode.h index 027af76db4bd..2e428ed7511a 100644 --- a/arch/powerpc/include/asm/ppc-opcode.h +++ b/arch/powerpc/include/asm/ppc-opcode.h @@ -256,7 +256,6 @@ #define PPC_INST_LWSYNC 0x7c2004ac #define PPC_INST_SYNC 0x7c0004ac #define PPC_INST_SYNC_MASK 0xfc0007fe -#define PPC_INST_ISYNC 0x4c00012c #define PPC_INST_MCRXR 0x7c000400 #define PPC_INST_MCRXR_MASK 0xfc0007fe #define PPC_INST_MFSPR_PVR 0x7c1f42a6 diff --git a/arch/powerpc/kernel/traps.c b/arch/powerpc/kernel/traps.c index b4ab95c9e94a..c929d93c35d0 100644 --- a/arch/powerpc/kernel/traps.c +++ b/arch/powerpc/kernel/traps.c @@ -67,6 +67,7 @@ #include #include #include +#include #if defined(CONFIG_DEBUGGER) || defined(CONFIG_KEXEC_CORE) int (*__debugger)(struct pt_regs *regs) __read_mostly; @@ -537,11 +538,11 @@ static inline int check_io_access(struct pt_regs *regs) * For the debug message, we look at the preceding * load or store. */ - if (*nip == PPC_INST_NOP) + if (*nip == PPC_RAW_NOP()) nip -= 2; - else if (*nip == PPC_INST_ISYNC) + else if (*nip == PPC_RAW_ISYNC()) --nip; - if (*nip == PPC_INST_SYNC || (*nip >> 26) == OP_TRAP) { + if (*nip == PPC_RAW_SYNC() || get_op(*nip) == OP_TRAP) { unsigned int rb; --nip; -- 2.25.0