From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 102EBC3DA6E for ; Fri, 5 Jan 2024 04:18:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=gujwq2m98YPu8YUa/+Kj90rYacauqV9+jxXHMHk50v8=; b=3Egbd5bSsdoQ0M 2kMpBSpqrttI5T4B645pmSgUsPGAUZYi86ibV1/I6RCFnY/mi/c5E3K98ZgMsORrOTvRzn44xnAnh S2DZzBv6qEX+3uJ1f7cWZ+FzwCEiMK+o1IeAKXJExom+GX4rcQPAsrflkAcwGD4oTu2JspiMQcd4R YK0/C6fD8EMQzuPZfGqoBsuxlcjnCtghj0SHHpvbJG7IiOSanXk/6bKE8gudHeLja/x4fp2iNkW8U J19xO0+DZ5vP0HKIZzg9IMYkTHpiu1Q6DKYUPvDHiCAeY8gnN0mOuQ++EisCYJIn1RzOleiKBIo9I CviKnRTP4jU+X8gOEFAQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rLbek-00FtfD-0e; Fri, 05 Jan 2024 04:18:02 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rLbeh-00Ftes-0g for linux-arm-kernel@lists.infradead.org; Fri, 05 Jan 2024 04:18:00 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704428275; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3wBtvd8AcUa+3WyzFrFiVlLy0PPCAnv0pduZK21JO48=; b=QSzXVTax93uLPZ1hBXLkbmcrEFFse5x/G3dYojE1c4CIbjAHqlr7NtGa2jXIEAKudNWD/G gG/ya0jD0UNK6vp7Uo5U56RqmYF8J/+o/TdWIqNQDcAPPmKyg/tWCJlHT7BJtA4vX9rIeT GmKaET+2/meXCEE9Ogmo7zKcm+9G0vg= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-139-Gd1BD8PWNhiUkkMBILUPjw-1; Thu, 04 Jan 2024 23:17:54 -0500 X-MC-Unique: Gd1BD8PWNhiUkkMBILUPjw-1 Received: by mail-pf1-f198.google.com with SMTP id d2e1a72fcca58-6d9c07b2372so195731b3a.1 for ; Thu, 04 Jan 2024 20:17:53 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704428273; x=1705033073; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3wBtvd8AcUa+3WyzFrFiVlLy0PPCAnv0pduZK21JO48=; b=j3ztjAg9z9hQf/3uPw/y+2yHIcd2m60y0oHlw6vHHGqPPhJNBY89zojgWiUXBSEqR4 QF7qePYaBE2NRGTc2GYEplCFhbAh8YkpgdwRMVh0evd+rxb/9soKirqcusESs9tbKoWf pA1+W/Hs/Y9QnOh+WxhQb6ehOYodT0TQZbEsGiHORzVcZmO5FksxXbSSf5S4eBTeqrNm pQsQvf7/wmVZPAsdB3Co+I6/nDZZXqWLMUTcsWeeMhCHGXhQqf4c/pvvaDkdXpgf1rA8 he6qPGcgqiypcOyvnZ6kTHBkPGAofWtzRdtApKbKhKsQNoHkDwn1B3yskjYQCFReen+f oyPw== X-Gm-Message-State: AOJu0YyNMFN6YJm+Nt+G/Gu5ePUn3pyQufBioaXnR9tMbJCgklqa16Nb 1yrianD9Xe/gpb90VJfyAnpyFFx4epl/oHzFxEmosw1omxTclyeyNoadx9+1RL748lCvFNXHmoU CF5e6guzNlKiJCXBYxojsNnv11wNDwXm1eXNOrRc6rcQ= X-Received: by 2002:a05:6a20:e104:b0:197:78be:b5f6 with SMTP id kr4-20020a056a20e10400b0019778beb5f6mr1830567pzb.30.1704428272961; Thu, 04 Jan 2024 20:17:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IEokiFCVyap5KJ89I1Q0gN7ZI5vIsHsS7JOPAzDv9bI+X0Kz7fuEisChZiKFaACtFiEjxUVXg== X-Received: by 2002:a05:6a20:e104:b0:197:78be:b5f6 with SMTP id kr4-20020a056a20e10400b0019778beb5f6mr1830559pzb.30.1704428272620; Thu, 04 Jan 2024 20:17:52 -0800 (PST) Received: from localhost.localdomain ([2804:431:c7ec:3efd:1dbc:859f:ecb4:d775]) by smtp.gmail.com with ESMTPSA id s11-20020a63f04b000000b005cdad153d84sm443222pgj.90.2024.01.04.20.17.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Jan 2024 20:17:51 -0800 (PST) From: Leonardo Bras To: Oleg Nesterov , Catalin Marinas , Will Deacon , Mark Brown , Mark Rutland , "Steven Rostedt (Google)" , Arnd Bergmann , Leonardo Bras , Guo Hui Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v1 1/1] arm64: remove unnecessary ifdefs around is_compat_task() Date: Fri, 5 Jan 2024 01:15:00 -0300 Message-ID: <20240105041458.126602-3-leobras@redhat.com> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240104_201759_348746_49BD37C7 X-CRM114-Status: GOOD ( 15.10 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently some parts of the codebase will test for CONFIG_COMPAT before testing is_compat_task(). is_compat_task() is a inlined function only present on CONFIG_COMPAT. On the other hand, for !CONFIG_COMPAT, we have in linux/compat.h: #define is_compat_task() (0) Since we have this define available in every usage of is_compat_task() for !CONFIG_COMPAT, it's unnecessary to keep the ifdefs, since the compiler is smart enough to optimize-out those snippets on CONFIG_COMPAT=n Signed-off-by: Leonardo Bras --- Changes since RFCv1: - Removed unnecessary new inlined is_compat_task() for arm64 - Adjusted commit text and title Link: https://lore.kernel.org/all/20240104192433.109983-2-leobras@redhat.com/ arch/arm64/kernel/ptrace.c | 6 ++---- arch/arm64/kernel/syscall.c | 5 +---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 20d7ef82de90a..9f8781f1fdfda 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -173,7 +173,6 @@ static void ptrace_hbptriggered(struct perf_event *bp, struct arch_hw_breakpoint *bkpt = counter_arch_bp(bp); const char *desc = "Hardware breakpoint trap (ptrace)"; -#ifdef CONFIG_COMPAT if (is_compat_task()) { int si_errno = 0; int i; @@ -195,7 +194,7 @@ static void ptrace_hbptriggered(struct perf_event *bp, desc); return; } -#endif + arm64_force_sig_fault(SIGTRAP, TRAP_HWBKPT, bkpt->trigger, desc); } @@ -2112,7 +2111,6 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, const struct user_regset_view *task_user_regset_view(struct task_struct *task) { -#ifdef CONFIG_COMPAT /* * Core dumping of 32-bit tasks or compat ptrace requests must use the * user_aarch32_view compatible with arm32. Native ptrace requests on @@ -2123,7 +2121,7 @@ const struct user_regset_view *task_user_regset_view(struct task_struct *task) return &user_aarch32_view; else if (is_compat_thread(task_thread_info(task))) return &user_aarch32_ptrace_view; -#endif + return &user_aarch64_view; } diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c index 9a70d9746b661..ad198262b9817 100644 --- a/arch/arm64/kernel/syscall.c +++ b/arch/arm64/kernel/syscall.c @@ -20,14 +20,11 @@ long sys_ni_syscall(void); static long do_ni_syscall(struct pt_regs *regs, int scno) { -#ifdef CONFIG_COMPAT - long ret; if (is_compat_task()) { - ret = compat_arm_syscall(regs, scno); + long ret = compat_arm_syscall(regs, scno); if (ret != -ENOSYS) return ret; } -#endif return sys_ni_syscall(); } -- 2.43.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel