[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: objtool warning for next-20221118


  • To: Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Josh Poimboeuf <jpoimboe@xxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Wed, 23 Nov 2022 10:52:09 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=IGXRa8X25n4XL4b0elOIM5eE8xWKepBBYafXDXSc+bE=; b=i4EdGBPzFKWdho6FqLe8gY+JC+wz7vtuA312zmJZ3v1BpKuwDpoUPrWg9A4dqEU+prr5hlXRT7gEPPf5V5VmCKOsyK54t/Jklkwz2knSz2p4nR+8iYtMYhJ36nPgfw8KfDlmKTWVi72VP0HYFeXIiWMujx9SKpKpxH9RvnyA1ad8cIFOm96fBqqYKHKnXk779s3JnHWwqyy0+Nqart+VR21/qz9YTw8202qSINSMxkk6AnsOwvO7TLlXC9PKHHNb0H88yhlrubxgIMtxvFM6i+qICr0ksZH1+mvcBLdNGu4kmypMb+4m4q8HnLUbGCkZa29DoeuPwzIHLXcD945y5g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IiR8x7jtux8s5yTJhIdE69sC+31LaR+XIAtEfYod+c0ChD1rNQGb2Y6WX/kLWARIE7sHRLDeuHyNaevec+xLkcGiHkN8eR5YK+7F4ySuSM8ccVVUUNWMh1dyAQADByUiAs+1f5jczHkg045Op86DgSescAUROTau8XV6KHcvwlFqdnQVJ73PWGcNEyK0k38Ulemx5Uev07XkrXsSBv7WkYlVrzcrhRwd/uoNNdAiJ8edX90G57A5S+eucz7WUt2TkPwwpxI2I7sYohEfmgMz2VD8DP5DdOGwfK4IqLUx4MGpP67a1DGSFI1E9NF9g9GcLHPH6Se+epVy6UKI84k7zA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxx>, "sfr@xxxxxxxxxxxxxxxx" <sfr@xxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "jgross@xxxxxxxx" <jgross@xxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>, "boris.ostrovsky@xxxxxxxxxx" <boris.ostrovsky@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 23 Nov 2022 10:52:24 +0000
  • Ironport-data: A9a23:IibV3KtNRpwUFe2BevLldCvWf+fnVBNeMUV32f8akzHdYApBsoF/q tZmKWrUbPjYZWf9f9okO47koE8EvJPTztVgHAI/r380FyMa+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg0HVU/IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj5lv0gnRkPaoR5QaEzCFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMwKzNXSBy9nuyP5I3jRONDuetkCdS1FdZK0p1g5Wmx4fcOZ7nmGvyPz/kImTA6i4ZJAOrUY NcfZ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mE5DRituDHJy4fB9mAIm4UyRh3FouPD32E1wtK7VAqM0md gteM5T5c5zZ95TYqRnCOgbR8yrTmTLXBLXKWqXZU/qDacdJhv22tfKCZgOlZaXkaYzve0PsY WEVEkduX85ekroB8HL1JpX8grVSGH4WTj20MlR65Vwp7W5HdPQQGa+YUFrl9Hlr+QUA8XdVf r2MJVKA+X7JW+rHYpSxQXxV5RbNHFbWswIvdQwXU6Iv6vwW8XXn/2edOyWKKvmED4iVG+6Cn wfXCLrLMEF9UyvUm+QummkZ5osQD2LwXtdKtmowwFI8vl9CmRliHlktX2poseWNDZFrqs6OE NjPbKPqNLImVWL
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHY/xmtDBdsZRBv3UKvUqFDgKSI5K5MVQ6A
  • Thread-topic: objtool warning for next-20221118

On 23/11/2022 08:55, Peter Zijlstra wrote:
> On Tue, Nov 22, 2022 at 05:23:50PM -0800, Josh Poimboeuf wrote:
>> On Tue, Nov 22, 2022 at 09:35:17AM +0100, Peter Zijlstra wrote:
>>> On Mon, Nov 21, 2022 at 09:16:05PM -0800, Josh Poimboeuf wrote:
>>>
>>>> It's complaining about an unreachable instruction after a call to
>>>> arch_cpu_idle_dead().  In this case objtool detects the fact
>>>> arch_cpu_idle_dead() doesn't return due to its call to the
>>>> non-CONFIG_SMP version of play_dead().  But GCC has no way of detecting
>>>> that because the caller is in another translation unit.
>>>>
>>>> As far as I can tell, that function should never return.  Though it
>>>> seems to have some dubious semantics (see xen_pv_play_dead() for
>>>> example, which *does* seem to return?).  I'm thinking it would be an
>>>> improvement to enforce that noreturn behavior across all arches and
>>>> platforms, sprinkling __noreturn and BUG() on arch_cpu_idle_dead() and
>>>> maybe some of it callees, where needed.
>>>>
>>>> Peter, what do you think?  I could attempt a patch.
>>> I'm thinking the Xen case makes all this really rather difficult :/
>>>
>>> While normally a CPU is brought up through a trampoline, Xen seems to
>>> have implemented it by simply returning from play_dead(), and afaict
>>> that is actually a valid way to go about doing it.
>> o_O
>>
>> How the @#$% is that a valid way of doing it?  Why not just do it the
>> normal way?
> Well, if you return from arch_cpu_idle_dead() you're back in the idle
> loop -- exactly where you would be if you were to bootstrap the whole
> CPU -- provided you have it remember the whole state (easier with a
> vCPU).
>
> But maybe I'm missing something, lets add Xen folks on.

Calling VCPUOP_down on oneself always succeeds, but all it does is
deschedule the vCPU.

It can be undone at a later point by a different vcpu issuing VCPUOP_up
against the previously-downed CPU, at which point the vCPU gets rescheduled.

This is why the VCPUOP_down hypercall returns normally.  All state
really is intact.

As for what Linux does, this is how xen_pv_cpu_up() currently behaves. 
If you want to make Xen behave more everything else, then bug a BUG()
after VCPUOP_down, and adjust xen_pv_cpu_up() to skip its initialised
check and always use VCPUOP_initialise to bring the vCPU back online.

~Andrew

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.