Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4832544ybv; Wed, 26 Feb 2020 03:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxNA+WppYgNVLBcKae1uTzlbXOgucENto3zMk9Ne/M0qvSBcecI8ovCExIVGMMQBSGoy0VW X-Received: by 2002:a9d:6251:: with SMTP id i17mr2812510otk.14.1582718063506; Wed, 26 Feb 2020 03:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582718063; cv=none; d=google.com; s=arc-20160816; b=bAQY2HnWlvR0lAvau1cIe0gwSNco+zwCyyA64Hz85espnYeMBnt5THwMrzf9c2CK9J RuqhvGI7aR84lcM7CEZkN89q+11qwkDb2vnm78g5OYChQq0lmT1Lp+2kye4PIS24oV0o ZxrFPk7lPAZiC2cCGICqGHmXqyyvq422B8cqBmBY+xtiJiBxUNydCwHqaBquj/zhe6te V93qyfNpw259zQ3xvBpSgAiDUpdxyYL8d8IfvscjjiaMYVizf8OHetGhynVHrzQP72oO mUX04ptJOLkqyiePqSQRLCde3ZuDKkjqj9hsKzsT1m4ZR2SpjdvRuC7/edTQOb45/O8S ZhOw== 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=EH8N49h1WJeQsS+7BFFQiea2P+x+1AHld///Wc/4C77H23MRi9Ij0CHjixjyQ0P8nh ZCymbhFrxyXoQzaiQvI5HOAVq7uJxx7P/s06u5i3rkIMijFyrl6DgpRtgyQMVmJrfH6H qiFb4BhqoRW96kBMhQygwicHb7cHA98jxAFfEh+KE2XeOg5UBFtNT4M4FVDgbwoG5hvD 1rw1prtUEVFgbjVR2CRgSq86XCMX5Ika9GmDI3Tn23k9sN2WuSs6/ypupCuuBDsNklfz zr3yGmpmAKYfJqS9RdWsOg60xZOszbymJqC4yalhkkSG/gbbUzfbQpzLuRO6sm+AfwaJ 97CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=gdvtEUjj; 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 v26si1262252otj.0.2020.02.26.03.54.11; Wed, 26 Feb 2020 03:54: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=gdvtEUjj; 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 S1726878AbgBZLx7 (ORCPT + 99 others); Wed, 26 Feb 2020 06:53:59 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:42847 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbgBZLx4 (ORCPT ); Wed, 26 Feb 2020 06:53:56 -0500 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 48SDjD6kXfz9txVB; Wed, 26 Feb 2020 12:53:52 +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=gdvtEUjj; 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 x2Jyj7HZIqti; Wed, 26 Feb 2020 12:53:52 +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 48SDjD5kFzz9txV6; Wed, 26 Feb 2020 12:53:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1582718032; bh=L4yqb0BCFkaKadMOOwxR17ksmx4VcmckLGkRTHxYdrQ=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=gdvtEUjjGhvR16AOLc65H83gLffdN0pBTwaAOH8z6UF9CKMAnKPF/1Ud9iSvMDyh3 OQ6Lb+Xzt63+MUsc8awx2+XXwLmcYFqZNkDPcUXmWBivwOAN3xgQDVqEOZRs44dkzl GNRhzA/sp1Q0wLKcdQHkVvfBqdvginov7k3XOqq4= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 0FB248B84B; Wed, 26 Feb 2020 12:53:54 +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 w93d5vn1_3gZ; Wed, 26 Feb 2020 12:53:53 +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 AB32C8B776; Wed, 26 Feb 2020 12:53:53 +0100 (CET) Received: by pc16570vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 845B465400; Wed, 26 Feb 2020 11:53:53 +0000 (UTC) Message-Id: In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v3 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: Wed, 26 Feb 2020 11:53:53 +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