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 426FDC3DA6E for ; Mon, 8 Jan 2024 16:05:54 +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:References:In-Reply-To: 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: List-Owner; bh=bQ19kwuvVV22TiJjdaZlnRvE0dC087ccBne44/7ASBc=; b=aVW3XU4NSM9t7X emFhjdr6ZgpVacYHwfrPOwPM9Ar/Oq9bc43qUPTbhsiFVRz48LXzpgaUx0qP2FcOYcN2q3xHK/Fyu e6an4tnDj04AhSQTx1lB9IQ+NY25qpTT3x7oIScvcL05mhEdFN4UjNX8SEkfBji/cWve8tRmgU3Io i8TJYVLg+oC9Ausp9vrPXEkdUumQ2GgBc3+eDNiATZMTajrXngtFVSjmoIBA5AEKx4lVyjnrGHUVk 0mTpySh9WaEOJwgyT2FMG1QoBJKowZXENjPtGmded01XePqXZxwP2mE5no1RsndyiYzs18/0nRmH0 GiP6pMbfC+n8AyxCyCYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rMs7s-005aEu-1N; Mon, 08 Jan 2024 16:05:20 +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 1rMs7p-005aES-2d for linux-arm-kernel@lists.infradead.org; Mon, 08 Jan 2024 16:05:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1704729915; 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: in-reply-to:in-reply-to:references:references; bh=Tv79to8IgCK/Eom14q4H1jU+f+w7C2emyrlOzgVlZdA=; b=bQHccEKaAwmGd9MRUok7ZmKAd82/8/AYAkXjViOc3bdtuZ+Du77HtpvWtaJVD3Z9t9nsBq SBSy0CPLtq7iK+ifA1MZpcoLaEpav/580UxzIamZL6vPdm0j7hT59UjkAmFE5zZnlU8buh 7IX0C4w9JizAI/3ddq0+U/9UFVvabck= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-137-AGOoLIl2N0KcZRpjM8q1Hw-1; Mon, 08 Jan 2024 11:05:09 -0500 X-MC-Unique: AGOoLIl2N0KcZRpjM8q1Hw-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-28b6d5de7f8so620761a91.0 for ; Mon, 08 Jan 2024 08:05:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704729908; x=1705334708; h=content-transfer-encoding:content-disposition:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Tv79to8IgCK/Eom14q4H1jU+f+w7C2emyrlOzgVlZdA=; b=VSY+izxa2tYk/BhPpAonC0TGBEpE2CE2XGf9PgW4odjXM0JT+z86R1Q0ycQoV9jNRr JTaWD8/RdFeIRhuDzABr0T/V5iY79a/MdMSlIB8dIg2EyQzoYpkca/gBmOmAv4yH/SYu P9+KVsODzqlbM1qGSY1iGnHtVVvh4+7eV2chXWSMD9GjbVsd7PVGPB8lkXydnldHaFDx 0TNByxeS/QBz8yGc/bbhFhc3AKf/w8mL19LlfCYpuQ1b2fA/IH+foNs5TBHK8ddfwZsB y9fHqFFUkXtgc56ymOOCt44kt8c2PdZNaMCpbAYURwYxF/g8tPS9c5MFQ60wLCRJoRXk nqjQ== X-Gm-Message-State: AOJu0YyeSQ1bqZVmQl0q5dC6UT7RhnZQ3ZwlUA6b+CFJgnnEKJuFneCv Lm5o0C000h+5xfbqsmxiMStrmwHeVUeoauNPzEfc4bwB3EGw7KIYE1VPZ/rIHEhE0MFbGNCMEgz 1qIfb2E3Zhmrw79QiGm3IzvhQGAIF7vhlnYzjVcp3x2g= X-Received: by 2002:a17:90a:d998:b0:28b:c10e:2f1e with SMTP id d24-20020a17090ad99800b0028bc10e2f1emr1285427pjv.23.1704729907859; Mon, 08 Jan 2024 08:05:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IFYObcTdEFCcLBxuhh9m6/RGhFaF0OMmenCn7oXy+SA1boH9CjQS70YktOx0qVV61BW+RKuxg== X-Received: by 2002:a17:90a:d998:b0:28b:c10e:2f1e with SMTP id d24-20020a17090ad99800b0028bc10e2f1emr1285414pjv.23.1704729907553; Mon, 08 Jan 2024 08:05:07 -0800 (PST) Received: from LeoBras.redhat.com ([2804:1b3:a803:26a5:3f32:e12b:5335:3c2d]) by smtp.gmail.com with ESMTPSA id p15-20020a056a000b4f00b006d9e76be7cesm44050pfo.73.2024.01.08.08.05.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jan 2024 08:05:06 -0800 (PST) From: Leonardo Bras To: Leonardo Bras Cc: Arnd Bergmann , Mark Rutland , Oleg Nesterov , Catalin Marinas , Will Deacon , Mark Brown , Steven Rostedt , Guo Hui , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] arm64: remove unnecessary ifdefs around is_compat_task() Date: Mon, 8 Jan 2024 13:04:58 -0300 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20240105041458.126602-3-leobras@redhat.com> <112ae7d5-61b2-4887-a56f-35ea7c3b1bfa@app.fastmail.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240108_080517_926172_E5679745 X-CRM114-Status: GOOD ( 28.49 ) 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 On Mon, Jan 08, 2024 at 12:07:48PM -0300, Leonardo Bras wrote: > On Fri, Jan 05, 2024 at 03:38:05PM +0100, Arnd Bergmann wrote: > > On Fri, Jan 5, 2024, at 14:14, Mark Rutland wrote: > > > On Fri, Jan 05, 2024 at 01:15:00AM -0300, Leonardo Bras wrote: > > > arch/arm64/kernel/ptrace.c:2121:25: note: each undeclared identifier is > > > reported only once for each function it appears in > > > arch/arm64/kernel/ptrace.c:2123:25: error: 'user_aarch32_ptrace_view' > > > undeclared (first use in this function) > > > 2123 | return &user_aarch32_ptrace_view; > > > | ^~~~~~~~~~~~~~~~~~~~~~~~ > > > make[4]: *** [scripts/Makefile.build:243: arch/arm64/kernel/ptrace.o] > > > Error 1 > > > make[3]: *** [scripts/Makefile.build:480: arch/arm64/kernel] Error 2 > > > make[2]: *** [scripts/Makefile.build:480: arch/arm64] Error 2 > > > make[1]: *** [/home/mark/src/linux/Makefile:1911: .] Error 2 > > > make: *** [Makefile:234: __sub-make] Error 2 > > > > > > ... and looking at the code, user_aarch32_view and user_aarch32_ptrace_view are > > > both defined under ifdeffery for CONFIG_COMPAT, so that's obviously not going > > > to work... > > Thanks for noticing, Mark! > > > > > I suspect it's enough to remove all of the other > > "#ifdef CONFIG_COMPAT" checks in this file and rely on > > dead code elimination to remove the rest, but there might > > be additional problems if some extern declarations are > > hidden in an #ifdef as well. I could remove all CONFIG_COMPAT ifdefs from this file, and for compiling it required a few extra defines (in other files) to be moved outside of their #ifdef CONFIG_COMPAT. Those being: #define VFP_STATE_SIZE ((32 * 8) + 4) #define VFP_FPSCR_STAT_MASK 0xf800009f #define VFP_FPSCR_CTRL_MASK 0x07f79f00 #define COMPAT_ELF_NGREG 18 typedef unsigned int compat_elf_greg_t; typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; OTOH, the size of the final arch/arm64/kernel/ptrace.o went from 44768 to 56328 bytes, which I understand to be undesired. A different (and simpler) solution is to have an empty struct in case of !CONFIG_COMPAT, that will be optimized out in compile-time: diff --git a/arch/arm64/kernel/ptrace.c b/arch/arm64/kernel/ptrace.c index 9f8781f1fdfda..d2f275d8a3e6e 100644 --- a/arch/arm64/kernel/ptrace.c +++ b/arch/arm64/kernel/ptrace.c @@ -2107,6 +2107,9 @@ long compat_arch_ptrace(struct task_struct *child, compat_long_t request, return ret; } +#else +static const struct user_regset_view user_aarch32_view = {}; +static const struct user_regset_view user_aarch32_ptrace_view = {}; #endif /* CONFIG_COMPAT */ const struct user_regset_view *task_user_regset_view(struct task_struct *task) With this the patch will build successfully and arch/arm64/kernel/ptrace.o will be able to keep it's original size. Arnd, is that ok? Thanks! Leo > > > > Arnd > > Sure, I sill send a v2 soon. > > Thanks! > Leo > > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel