Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp102151pxb; Thu, 21 Jan 2021 02:21:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJyDqlyXXEFB/F4hffrWzBNPLPtdbhI+K7BMOorg9lS53cEvQvXIOw7DAW53UMtvqNzjYWib X-Received: by 2002:a17:906:2c4e:: with SMTP id f14mr8961108ejh.432.1611224480268; Thu, 21 Jan 2021 02:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611224480; cv=none; d=google.com; s=arc-20160816; b=lrE1OhG3xU3ogJuPy/E0t1mmSilGsStAgoXhQ0UJbLUcRiUWDGcBC3SJOEIjpbV2D4 lRCEsg09VLR3IB8cLoHaUJJDSZlr/ux9a11WwKBA9OZHS2UPeseQbabniq22+8z3/5J4 Z4CrIVbnPy2GlGpXINroUGObuktulDLEIQH7iyVz4EvOkCqygXUaHSe/H0YWAlAQ/lPK JamvIMQGJjwwHc9gFEyykF81sRBIU/et/VjXsj9QTo+mn2e6eCE4UWi3+z9DyUnz659j yAwcqMULU9nNy0vi+6XVnrCn3O32Ah4tjNltRWsmHaCL9Zh+lkHSuFcfBgUYJGg2p+PT KHxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=nUFfyvUlJANPl5QUFEVLx1yTXROv8TYtpca6Xw1vx/o=; b=xpFOoLSqFi7TBBKHzWTJZoCi7P9QThGDKVtQIaq3IjXU37RZkkST+3nUF3BEUhF0eL N6L3xWx0TQA7M2EaGSWB1NLGn96FypoOmWlVs4hr1YeOwESCz6lAfSQGwFLapaBZ4WX3 u+jiGjeYWzUQUZHAsOE7EKtdkeT4Nkq1+LrRO4celi81G1Jr99LGDDhgsVmAYtnV4mfy id34eIVSZ6KFmNWWqy9ygUlj75r+C3NpR0RRz7WW33+O0f2/q+3cCj8OeQ/zECnNFfli We/fF8L1NH1tVE2XXHcqekvhrg9nix9znESosbcKasyCTKgLEt4wbBDBt4oPa0wFBDtm djPQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m19si1934884edp.417.2021.01.21.02.20.56; Thu, 21 Jan 2021 02:21:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729075AbhAUKSM (ORCPT + 99 others); Thu, 21 Jan 2021 05:18:12 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:48727 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729014AbhAUKQt (ORCPT ); Thu, 21 Jan 2021 05:16:49 -0500 Received: from mail-ej1-f71.google.com ([209.85.218.71]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1l2X0E-00005A-SL for linux-kernel@vger.kernel.org; Thu, 21 Jan 2021 10:15:46 +0000 Received: by mail-ej1-f71.google.com with SMTP id dc21so550818ejb.19 for ; Thu, 21 Jan 2021 02:15:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=nUFfyvUlJANPl5QUFEVLx1yTXROv8TYtpca6Xw1vx/o=; b=SYAwZeWcsV+fz+1J9uNeo4rsC1+ksO9SlJ+NwBT8Ojag81o0IYHnAOzodKMzrq4C/4 k3Tw6HxyjPJivXlHd2rB14MBuKCK0SFGrSvhQsMhNYA7UGEOU6S11AdO0gYaP+EtUeeW cAmVZKjpejr5wttOcDnZ1qhCr6VcVO7O03Kklw8oTyX1fZI4zOVWUkAiskIx1URWEbEH ABvHsv6UpaSkg68b7Kcbw02pU95vWpRMjFamgd2dS+TDT3DiQOgwzLxXcfiWmlI316Rm QUOoBDLHg3pOZ8k3YWNHnmmyH+KlUGti47nTWrL9bbNDoHYtk3osdYO14DfQRLv81ecF akTA== X-Gm-Message-State: AOAM532Qsd/IZcQXifiIDw5bkoY1eTNFx1qMHSXHKwWqPcfyjyv9USek zXKzFIipL3LM3dRpmzJDB0GqYqU4eyS0rh9VIJa6Cm3DQhQmOJF7tTBwijuRtPvr/wssMJODMPZ nLjWowTUcRLawjDr/Gw4jEq5A0Yn4bP2CMGWJUevMbg== X-Received: by 2002:a05:6402:22ba:: with SMTP id cx26mr10620065edb.350.1611224146480; Thu, 21 Jan 2021 02:15:46 -0800 (PST) X-Received: by 2002:a05:6402:22ba:: with SMTP id cx26mr10620055edb.350.1611224146269; Thu, 21 Jan 2021 02:15:46 -0800 (PST) Received: from localhost (host-79-52-126-228.retail.telecomitalia.it. [79.52.126.228]) by smtp.gmail.com with ESMTPSA id bl13sm2053785ejb.64.2021.01.21.02.15.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Jan 2021 02:15:45 -0800 (PST) Date: Thu, 21 Jan 2021 11:15:44 +0100 From: Andrea Righi To: Ingo Molnar Cc: linux-kernel@vger.kernel.org, linux-tip-commits@vger.kernel.org, Borislav Petkov , x86@kernel.org Subject: Re: [tip: x86/entry] x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y Message-ID: References: <161121327995.414.14890124942899525500.tip-bot2@tip-bot2> <20210121074928.GA1346795@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 21, 2021 at 09:52:01AM +0100, Andrea Righi wrote: > On Thu, Jan 21, 2021 at 08:49:28AM +0100, Ingo Molnar wrote: > > > > * tip-bot2 for Andrea Righi wrote: > > > > > The following commit has been merged into the x86/entry branch of tip: > > > > > > Commit-ID: e6d92b6680371ae1aeeb6c5eb2387fdc5d9a2c89 > > > Gitweb: https://git.kernel.org/tip/e6d92b6680371ae1aeeb6c5eb2387fdc5d9a2c89 > > > Author: Andrea Righi > > > AuthorDate: Thu, 14 Jan 2021 12:48:35 +01:00 > > > Committer: Ingo Molnar > > > CommitterDate: Thu, 21 Jan 2021 08:11:52 +01:00 > > > > > > x86/entry: Build thunk_$(BITS) only if CONFIG_PREEMPTION=y > > > > > > With CONFIG_PREEMPTION disabled, arch/x86/entry/thunk_64.o is just an > > > empty object file. > > > > > > With the newer binutils (tested with 2.35.90.20210113-1ubuntu1) the GNU > > > assembler doesn't generate a symbol table for empty object files and > > > objtool fails with the following error when a valid symbol table cannot > > > be found: > > > > > > arch/x86/entry/thunk_64.o: warning: objtool: missing symbol table > > > > > > To prevent this from happening, build thunk_$(BITS).o only if > > > CONFIG_PREEMPTION is enabled. > > > > > > BugLink: https://bugs.launchpad.net/bugs/1911359 > > > > > > Fixes: 320100a5ffe5 ("x86/entry: Remove the TRACE_IRQS cruft") > > > Signed-off-by: Andrea Righi > > > Signed-off-by: Ingo Molnar > > > Cc: Borislav Petkov > > > Link: https://lore.kernel.org/r/YAAvk0UQelq0Ae7+@xps-13-7390 > > > > Hm, this fails to build on UML defconfig: > > > > /home/mingo/gcc/cross/lib/gcc/x86_64-linux/9.3.1/../../../../x86_64-linux/bin/ld: arch/x86/um/../entry/thunk_64.o: in function `preempt_schedule_thunk': > > /home/mingo/tip.cross/arch/x86/um/../entry/thunk_64.S:34: undefined reference to `preempt_schedule' > > /home/mingo/gcc/cross/lib/gcc/x86_64-linux/9.3.1/../../../../x86_64-linux/bin/ld: arch/x86/um/../entry/thunk_64.o: in function `preempt_schedule_notrace_thunk': > > /home/mingo/tip.cross/arch/x86/um/../entry/thunk_64.S:35: undefined reference to `preempt_schedule_notrace' > > > > Thanks, > > > > Ingo > > I've been able to reproduce it, I'm looking at this right now. Thanks! I see, basically UML selects ARCH_NO_PREEMPT, but in arch/x86/um/Makefile it explicitly includes thunk_$(BITS).o regardless. Considering that thunk_$(BITS) only contains preemption code now, we can probably drop it from the Makefile, or, to be more consistent with the x86 change, we could include it only if CONFIG_PREEMPTION is enabled (even if it would never be, because UML has ARCH_NO_PREEMPT). If it's unlikely that preemption will be enabled in UML one day I'd probably go with the former, otherwise I'd go with the latter, because it looks more consistent. Opinions? Thanks, -Andrea