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

Re: [PATCH v2 0/3] retpoline: add clang support + Kconfig selectable


  • To: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Fri, 18 Feb 2022 15:17:35 +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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=RnMNqMDAPNB8sN0Ba8vr6XnL4/lcdqLqp9Dc7DfcPas=; b=K23UPVNyRniCS/MMYOMufifUvEDzd2IG0BAFj27R0zSrQ/iNc9rko1UOvV0TAeJrNM++Qal6f7UrP5MKk6dRDLImEcP5xQOs6IhHAtZNF4m/2uCArIO0zGZaCgppnYQfTqnQR/NZBMQto09CvE/ym79EmyNBbKouFQWnkYPBiQ3iNhmIecGbwE9Sl+jbAcreZk2nJA8nW25xuYjQnBUxiJyemn3OOjfeGDEEr54ZsKsX8SDUS4Q6q8lB0y3Ksd0Y45I80IZNUmgEm6agoR65VO6P3f6F3kwO8tixg5C4rG0hWXKTNfA3a60k20YpEJ74UKyoaFk3/DZuHpSAWaVNzQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=k9gC1hLe9Six56e/TFc0tylQEWGND03py2QBjBe36x5hCQ/5mnbzvrKyK37TAd25u7C6yS1onSXXhoeMTDc88d/ob4KvyYuIh/kSHyqUTEmqFrGUA8ZSmjoR1jU+cPntTfEDUOhUe00Pr1DTJzbWE+C2osisEwlJNcemUV4JFX8Tv1yn5bdCbf8jxYbAvgw+kicGLDfO1RqHs9d6Xkkdvr8GgkiXqEXvpz5py8D++a78KQwHVT/aBIJid5yxo64kZd918c/Y0DIM3jNcVitIM10kCa65xqubFZPxSSzKdxFKWfmPjEb3SPtuUwWqNlYSG3L0LcOWxUTbz2tEiCA7ug==
  • Authentication-results: esa6.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "Jan Beulich" <jbeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>
  • Delivery-date: Fri, 18 Feb 2022 14:17:57 +0000
  • Ironport-data: A9a23:SgBY5qsZ2mN8yvbSo6f4PhyO+OfnVGleMUV32f8akzHdYApBsoF/q tZmKW3UP/mOMzahftgnb4S+8koHucTRmNRqTQduqS4yRSJB+JbJXdiXEBz9bniYRiHhoOOLz Cm8hv3odp1coqr0/0/1WlTZhSAgk/nOHNIQMcacUsxLbVYMpBwJ1FQzy4bVvqYy2YLjW1nU6 YuryyHiEATNNwBcYzp8B52r8HuDjNyq0N/PlgVjDRzjlAa2e0g9VPrzF4noR5fLatA88tqBb /TC1NmEElbxpH/BPD8HfoHTKSXmSpaKVeSHZ+E/t6KK2nCurQRquko32WZ1he66RFxlkvgoo Oihu6BcRi8kO6Dzuco0YiNeGhFmZ7x6oaDaLFig5Jn7I03uKxMAwt1rBUAye4YZ5vx2ESdF8 vlwxDIlN07ZwbjsmfTiF7cq1p9LwMrDZevzvll6yj7UF7A+SI3rSKTW/95Imjw3g6iiGN6AO 5ZAN2UyNXwsZTVia0gNGKwRv9uG2Emidjh4lHabm6A4tj27IAtZj+G2bYu9lsaxbcdImkeVo ErW8mK/BQsVXPSE0iaM+H+ogu7JnAv4VZgUGbn+8eRl6HWMwkQDBRtQUkG0ydG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EiZLhYqpFa1F9JEa0HADnx5OkcYa dT5fnnlbVrmG6hHjLkVjEF+q3oYp1zJGbIfqE6gL3U79AM90oJi3fxx6Qk7wE9HdwGOt55Dt //Q9ZVfYd1P7grhJJGdZQ8qPSMexnwqDL3QSqvyAfcZeo600ykke+C3Fxy3pDtRKA1
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Fri, Feb 18, 2022 at 01:58:31PM +0000, Andrew Cooper wrote:
> On 16/02/2022 16:21, Roger Pau Monne wrote:
> > Hello,
> >
> > The following series adds retpoline support for clang builds, and also
> > allows the user to select whether to enable retpoline support at build
> > time via a new Kconfig option.
> >
> > I've tried adding a suitable description to the Kconfig option, but I'm
> > sure there's room for improvement.
> >
> > Thanks, Roger.
> >
> > Roger Pau Monne (3):
> >   x86/retpoline: rename retpoline Kconfig check to include GCC prefix
> >   x86/clang: add retpoline support
> >   x86/Kconfig: introduce option to select retpoline usage
> 
> I don't particularly want to nitpick, but IMO this would be a lot easier
> to follow if we ended up with
> 
> config CC_HAS_RETPOLINE
>     def_bool $(cc-option,-mindirect-branch-register) ||
> $(cc-option,-mretpoline-external-thunk)
> 
> config INDIRECT_THUNK
>     depends on CC_HAS_RETPOLINE
> 
> and
> 
> ifeq ($(CONFIG_INDIRECT_THUNK),y)
> CFLAGS-$(CONFIG_CC_IS_GCC) += ...
> CFLAGS-$(CONFIG_CC_IS_CLANG) += ...
> endif
> 
> because this reduces the number of CONFIG_* options involved.
> 
> Thoughts?

That would reduce one hidden Kconfig option. I don't mind
implementing it that way.

> On substantially more minor points, INDIRECT_THUNK wants to be first in
> the speculative hardening list, seeing as it is by far and away the most
> important one, and I think we should stop writing things like "If
> unsure, ..." in the help because it's just parroting the default which
> is also rendered to people reading this message.  Our audience here are
> developers, and I think we can depend on them to intuit the stated default.

OK, so let me put that one first on the list then, and drop the "If
unsure, "

Thanks, Roger.



 


Rackspace

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