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

Re: [PATCH] x86/cet: Fix build on newer versions of GCC


  • To: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 17 Aug 2021 12:17:31 +0100
  • 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-SenderADCheck; bh=ncX/Df3r66yg/lXVk/jzVAADHcM2C9LCOTQdDGWr9vY=; b=ocaFGj5xb8Teb+gi4KIpa6YsvnYQbq7Iq4toae3UykQZmG6km4+AcVKHy/VOWhuXW3Sh5dAGKxmBTctJZrXw8sVA8Ctj5sUZyRw9djw6dNS8o5eEbwLgUC7xSkXdjjaxpyPQ5QaaaNkP/fmoV5vb8I4nAobO05xoZvF2WEEwfKe9x1uu02tWdpxhpiCtbiCZ7y6VQhUTbpFraOfzjGVbfGYI3riccQbBbQu7HH0tRJkHb97HBot8pYqo0qqosa8Isf3Iaua8mqzJ03DL6Mv+uSG3V32/cWWMlLJirEPQYPcZB46k73IIeqhYTGN56BsX5mCjlIDNuXIkeffRZpEtVg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hzp5ONv9GYiJ5TUD/ZptpqY0786c46HSsgHVDtCZ3qdUtJA1137yUQqwgUiAzHvvyMIP28lMHa33MZoe24NS4TCG/titlsy3NZxB2c1QdpfgS6u7P/m7eErpcCz1w783DH2m+ZCyAb7QKiy4gTpNUCKctwC5wzPEsAVa+NVoT6bKtC6bkIpvOTtWqt93kxzH99NmQuXfuQo2b/2n9Z1dmjP24Rgpvq7IiQN3yahEK2xfvC/4/OuGP9RuRNyWsyh4B1FFXq6AwEi80SALj0NLytnMfVnoqbeE7f31HYIzVedoJZPHJmmlUpUivaaJQrEmHCtyXxt0FWyA8Ji5ccQKkQ==
  • Authentication-results: esa2.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>
  • Delivery-date: Tue, 17 Aug 2021 11:17:44 +0000
  • Ironport-hdrordr: A9a23:2HVSFql5j/1OcDG88P60XEAZJhLpDfOiimdD5ihNYBxZY6Wkfp +V88jzhCWZtN9OYhwdcLC7WZVpQRvnhPpICPoqTMiftW7dyReVxeBZnPbfKljbdREWmdQtrZ uIH5IObuEYSGIK9/oSgzPIY+rIouP3iZxA7N22pxwGLXAIGtNdBkVCe2Gm+yVNNXh77PECZf ihD6R81l+dkDgsH7+G7i5vZZm8mzSHruOoXTc2QzocrCWehzKh77D3VzCewxclSjtKhZMv63 LMnQDV7riq96jT8G6c60bjq7Bt3PfxwNpKA8KBzuATNzXXkw6tIKBsQaeLsjwZqPymrHwqjN 7PiRE9ONkb0QKeQkiF5T/WnyXw2jcn7HHvjXeenHvYuMT8AAk3DsJQ7LgpOCfx2g4FhpVRwa hL12WWu958FhXbhhnw4NDOSlVDile0iWBKq59Qs1VvFa8lLJNBp40W+01YVL0aGjjh1YwhGO 5ySOnB+fdtd0+AZXyxhBgt/DWVZAV2Iv66eDlEhiTMuAIm2kyRjnFohPD3p01wsa7UEPJ/lr 352s0CrsA8cicUBZgNT9vpD/HHUlAk7Hr3QRSvyG/cZdU60kT22tbKCYUOlZSXkaMzvewPcb T6IR5lXD0JCg7T4fPn5uwDzvmKehTnYQjQ
  • Ironport-sdr: R3sk5vOF8BpqSUrlCvHcCwk7fJcUNX+HAM5uLrrV/xaBK3oOO+m74pkg4XJ31RZ7dmVFC/F6tZ 9fOEDtLfKyK04kejg0RBWgyzi4HJXcoa2eI5dHytRcry3m9Pegt3s6jEpZ+TquUK//UaISKdrw Vj9tMGCFlODhgL/sKYnAp2X/uwDptnpblYZoWt9tPB9YeCTdb/1uKDsstJHfF02wHHVhWUhiSV mSZnJ5KzAhmswAKD0i9Lsz+LI4hxLo8OLQk/iFpQv/3BJT9KwjsFXiT8FKWT0F55Ob6BWy0rlX Ix5KnzGhbCbpxsWGKhgOMQ1D
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 17/08/2021 12:14, Marek Marczykowski-Górecki wrote:
> On Tue, Aug 17, 2021 at 11:56:56AM +0100, Andrew Cooper wrote:
>> Some versions of GCC complain with:
>>
>>   traps.c:405:22: error: 'get_shstk_bottom' defined but not used 
>> [-Werror=unused-function]
>>    static unsigned long get_shstk_bottom(unsigned long sp)
>>                         ^~~~~~~~~~~~~~~~
>>   cc1: all warnings being treated as errors
>>
>> Change #ifdef to if ( IS_ENABLED(...) ) to make the sole user of
>> get_shstk_bottom() visible to the compiler.
>>
>> Fixes: 35727551c070 ("x86/cet: Fix shskt manipulation error with 
>> BUGFRAME_{warn,run_fn}")
>> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
>> ---
>> CC: Jan Beulich <JBeulich@xxxxxxxx>
>> CC: Roger Pau Monné <roger.pau@xxxxxxxxxx>
>> CC: Wei Liu <wl@xxxxxxx>
>> CC: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
>>
>> Not actually tested.  I don't seem to have a new enough GCC to hand.
> I have just compile-tested it and it seems to fix the issue (indeed it
> failed before with CONFIG_XEN_SHSTK disabled).

Oh, thanks!

>
>> Most of the delta here is indentation.  This diff is more easily reviewed 
>> with
>> `git show --ignore-all-space`
> Wouldn't this make the compiler include the code even if
> CONFIG_XEN_SHSTK is disabled (not a huge issue...)? Or is it smart
> enough to optimize it out in that case?

Its a trivial dead-code elimination example, and yes - the compiler is
smart enough.

~Andrew



 


Rackspace

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