Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1027045ybf; Thu, 27 Feb 2020 03:49:24 -0800 (PST) X-Google-Smtp-Source: APXvYqyRfLlkz+Ptg6ZLM2VgS3pW8MY41K7PWzN/pAZVuxAHpBzDlDvyqnd501FhR1LvxQLza9un X-Received: by 2002:a05:6830:9a:: with SMTP id a26mr2984031oto.273.1582804164008; Thu, 27 Feb 2020 03:49:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582804164; cv=none; d=google.com; s=arc-20160816; b=Q9AosqIN7mwk1+8CDETYK4Lkpa3wZm4vmRkaw6QLqVp8lcXyag81KIpG7nNVIPn4d6 3xs3bIXV567NyVSo0H6fGa1zBGx5Gb5jLOskDkehY42gRtFBWusoJX5Q9RRCRBYg27pd Z/cMFubtS+e+Ka7tZE0iQH30VMiKGT40Zh40MrdVOu9f5pTemAnf/aMNTD+vrw80Ie2O pBvmP3BJFLQNkK6Yh3vXkKxxUq2HaBYBz2nynNGu1mPymLRzTfuOAfiwG4pwg8qIVfbK W6heuFVUtAyUvhAcf7vJ7mbKRd52V7GMpO0qlNnRyjW7H6kybuBKtaP9G5RkIwrezaZx Mqyw== 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=yOdlbPN3Ui1b8Nb86j0vFXNhIpBgskRbhLb+yCw09KkEGJsa/W9W+TKl9/mkzIw2yv hq1+Wt2dh9bFapD2fMqQKEuE4ugvAzEyn5J1QJ9wgrGliPLpZXR0Zoz6amug+zJL3PsW Lq+Z8lQxUc4zKBA8+F5ka9oqqUJR0Gp81xQGmopjSwIZqFH3NUjPkWJYkf8plxWN0kIu Bo3CAhnQ0vBSiXb6Wty5rh8g5xcn5Q1zQYmA0yrWlLg/hz/xEDvQEyYD4fvbBcEc2+7H kwDlrKCmsZp6Jn0CJdjaudyAU6iqnj6Ndbfey8ZB294Tju2vBPlyWnvXV/f4QLzTVt1R QK3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=Apiz0zKp; 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 o20si1327614ota.17.2020.02.27.03.49.12; Thu, 27 Feb 2020 03:49:23 -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=Apiz0zKp; 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 S1728973AbgB0LtD (ORCPT + 99 others); Thu, 27 Feb 2020 06:49:03 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:64995 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728958AbgB0LtC (ORCPT ); Thu, 27 Feb 2020 06:49:02 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48SrY66zFlz9tyj4; Thu, 27 Feb 2020 12:48:58 +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=Apiz0zKp; 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 qSBArqc1uHq3; Thu, 27 Feb 2020 12:48:58 +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 48SrY65ngmz9tyhM; Thu, 27 Feb 2020 12:48:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582804138; bh=L4yqb0BCFkaKadMOOwxR17ksmx4VcmckLGkRTHxYdrQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=Apiz0zKp0f/FX6OsDYh8rIOpNJCYWq5fNH8+7vPej20WKvaJ5CkAUgV3YswGPqkHT U1QX3RJt3+dbUBCTB1BBzK993tku1PFOB7eEQ0sDRjJP6cnjn3X4etkbgI2NmSRPir 3eLiyYbRUfUz8mmmeYcR67Nmw1PHl9yOxyKFF0rw= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0F8028B872; Thu, 27 Feb 2020 12:49:00 +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 oq2c8moz3D3v; Thu, 27 Feb 2020 12:48:59 +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 A35AB8B799; Thu, 27 Feb 2020 12:48:59 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 6C1DC65402; Thu, 27 Feb 2020 11:48:59 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v4 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: Thu, 27 Feb 2020 11:48:59 +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