Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp72220ybf; Thu, 27 Feb 2020 16:18:31 -0800 (PST) X-Google-Smtp-Source: APXvYqxz7MoIbqA78zqUU/4BI+GSP5VFpzRkJw+KvuF0e0BM6BPoBPZEFyRF6LDceqifXcdTGAGF X-Received: by 2002:a9d:6289:: with SMTP id x9mr1256702otk.8.1582849110928; Thu, 27 Feb 2020 16:18:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582849110; cv=none; d=google.com; s=arc-20160816; b=hm2TyD5bpOMRk+XLdgSboTf9y2u+mcgKTS5xQDNTt6bsxp90DGreg7neFvkFgfCpuT JBvrE4BidRSNdm57L8xe2AFk1bmnHjY1mH7WXUYrx5zfGUZTLHWT6mISG6QFBJsTgYf0 vtXAOeuNyHiqAkUz9I2EXD+D93ByrtNovDr7rdfvye7iF0wcLhUqYCxNuO44TPpsyNiy SCMQUwLtZdB/ehGbdXvplIesJ8pcs/n41LwTNwWFLwR5JbSROSdg0z2780/frCI8WRVX ekdfes6HGb6kilRYH2Vca/UN6v4TKREiIORrGu1Mnl7waWR7lfHipo6fYqzYkHL4TlYd z1rA== 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=L4yqb0BCFkaKadMOOwxR17ksmx4VcmckLGkRTHxYdrQ=; b=Ke9YepSe8Z/BIIdhtT8N1sMd4DRli2ls6uKfajArg1zSXSOPZcluO7hXbcbpWzlufe b/F6n5zU71czEVU3z0NRawanJy3Q+7HYHm9hjhJWeUEQpUg8C6aFBVtWCKefwqEclHQr hpeVreVRxjf0c3xaassCfmjHdHz6vBg0GNCFdlB7OfPBFGG92hsaicerFIrC2sfWXpao 5vGrltVy3tM1pG24S/1HUdRvoLyTGIStWdNwubs+CjIcEzCpHvrDKcidefysZ1D3I8si RlUvPdSIGttD2gsjytw6J4KF1tnHb8hjupCHszUYJSfSJw3iQzkWfjmaWL19gGZ6KRCw C0sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b="K/ZPyzaT"; 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 n15si286222otr.262.2020.02.27.16.18.18; Thu, 27 Feb 2020 16:18:30 -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="K/ZPyzaT"; 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 S1730214AbgB1AQv (ORCPT + 99 others); Thu, 27 Feb 2020 19:16:51 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:39692 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729855AbgB1AQv (ORCPT ); Thu, 27 Feb 2020 19:16:51 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48T9801fmZz9tyJf; Fri, 28 Feb 2020 01:16:48 +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=K/ZPyzaT; 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 w6D3tJRWXJyK; Fri, 28 Feb 2020 01:16:48 +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 48T9800XPdz9tyJd; Fri, 28 Feb 2020 01:16:48 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582849008; bh=L4yqb0BCFkaKadMOOwxR17ksmx4VcmckLGkRTHxYdrQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=K/ZPyzaTMDBPHBfQu/88XKG7QIUOpcZjukoyDDtiRjI5FBC+2ujtjzhiA3mPEXuCU ZCwoINYEeJJqp9nrksiybnaaVGcJLMS9jQKMNZt+/r79NKwHB6R1Sw8Nh6i5RiA6ol iajrhvjElbyDmbLxK56ow3bZ0Qt6l3flzY7vJyBo= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 565A68B883; Fri, 28 Feb 2020 01:16:48 +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 jcyXChJ3LKVG; Fri, 28 Feb 2020 01:16:48 +0100 (CET) Received: from pc16570vm.idsi0.si.c-s.fr (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 419028B884; Fri, 28 Feb 2020 01:14:45 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 962DC65410; Fri, 28 Feb 2020 00:14:39 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v5 03/13] powerpc/ptrace: drop unnecessary #ifdefs CONFIG_PPC64 To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , mikey@neuling.org Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Fri, 28 Feb 2020 00:14:39 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop a bunch of #ifdefs CONFIG_PPC64 that are not vital. Signed-off-by: Christophe Leroy --- arch/powerpc/include/asm/ptrace.h | 2 ++ arch/powerpc/kernel/ptrace/ptrace.c | 18 +++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/arch/powerpc/include/asm/ptrace.h b/arch/powerpc/include/asm/ptrace.h index ee3ada66deb5..8e1953d99353 100644 --- a/arch/powerpc/include/asm/ptrace.h +++ b/arch/powerpc/include/asm/ptrace.h @@ -276,6 +276,8 @@ static inline unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, #endif /* __ASSEMBLY__ */ #ifndef __powerpc64__ +/* We need PT_SOFTE defined at all time to avoid #ifdefs */ +#define PT_SOFTE PT_MQ #else /* __powerpc64__ */ #define PT_FPSCR32 (PT_FPR0 + 2*32 + 1) /* each FP reg occupies 2 32-bit userspace slots */ #define PT_VR0_32 164 /* each Vector reg occupies 4 slots in 32-bit */ diff --git a/arch/powerpc/kernel/ptrace/ptrace.c b/arch/powerpc/kernel/ptrace/ptrace.c index 7ed54dbb2d7e..3dd94c296ac7 100644 --- a/arch/powerpc/kernel/ptrace/ptrace.c +++ b/arch/powerpc/kernel/ptrace/ptrace.c @@ -274,17 +274,15 @@ int ptrace_get_reg(struct task_struct *task, int regno, unsigned long *data) if (regno == PT_DSCR) return get_user_dscr(task, data); -#ifdef CONFIG_PPC64 /* * softe copies paca->irq_soft_mask variable state. Since irq_soft_mask is * no more used as a flag, lets force usr to alway see the softe value as 1 * which means interrupts are not soft disabled. */ - if (regno == PT_SOFTE) { + if (IS_ENABLED(CONFIG_PPC64) && regno == PT_SOFTE) { *data = 1; return 0; } -#endif regs_max = sizeof(struct user_pt_regs) / sizeof(unsigned long); if (regno < regs_max) { @@ -1998,7 +1996,6 @@ static const struct user_regset_view user_ppc_native_view = { .regsets = native_regsets, .n = ARRAY_SIZE(native_regsets) }; -#ifdef CONFIG_PPC64 #include static int gpr32_get_common(struct task_struct *target, @@ -2272,14 +2269,11 @@ static const struct user_regset_view user_ppc_compat_view = { .name = "ppc", .e_machine = EM_PPC, .ei_osabi = ELF_OSABI, .regsets = compat_regsets, .n = ARRAY_SIZE(compat_regsets) }; -#endif /* CONFIG_PPC64 */ const struct user_regset_view *task_user_regset_view(struct task_struct *task) { -#ifdef CONFIG_PPC64 - if (test_tsk_thread_flag(task, TIF_32BIT)) + if (IS_ENABLED(CONFIG_PPC64) && test_tsk_thread_flag(task, TIF_32BIT)) return &user_ppc_compat_view; -#endif return &user_ppc_native_view; } @@ -3063,11 +3057,7 @@ long arch_ptrace(struct task_struct *child, long request, else dbginfo.num_data_bps = 0; dbginfo.num_condition_regs = 0; -#ifdef CONFIG_PPC64 - dbginfo.data_bp_alignment = 8; -#else - dbginfo.data_bp_alignment = 4; -#endif + dbginfo.data_bp_alignment = sizeof(long); dbginfo.sizeof_condition = 0; #ifdef CONFIG_HAVE_HW_BREAKPOINT dbginfo.features = PPC_DEBUG_FEATURE_DATA_BP_RANGE; @@ -3304,12 +3294,10 @@ long do_syscall_trace_enter(struct pt_regs *regs) if (unlikely(test_thread_flag(TIF_SYSCALL_TRACEPOINT))) trace_sys_enter(regs, regs->gpr[0]); -#ifdef CONFIG_PPC64 if (!is_32bit_task()) audit_syscall_entry(regs->gpr[0], regs->gpr[3], regs->gpr[4], regs->gpr[5], regs->gpr[6]); else -#endif audit_syscall_entry(regs->gpr[0], regs->gpr[3] & 0xffffffff, regs->gpr[4] & 0xffffffff, -- 2.25.0