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

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


  • To: Roger Pau Monne <roger.pau@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <Andrew.Cooper3@xxxxxxxxxx>
  • Date: Fri, 18 Feb 2022 13:58:31 +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=Jwxj837jYM/s1nhFzcMdZIK5ZKiAfGjY1tKn+bil6io=; b=GKgplaZwGhBKwUA0LhWExnUGVIGpzwqT14AFhuaN1uDA6OU1Yp1FH33JcfqzCfHtFvcWUn1uj7QWbJm7imIqRbJdNoKWG8NTw9iiQJV/ULvEptUUSrX7tEf82r5vX84FU3iTmsf+Vpvvgl80sdzk5e3+rriNcapyc8Eby4z1WTB9henq6SaYxF8103t8ofagEEURmnLXXvIo/6mzi/y81+exyqAG0hL1DsniKow7KyLLAc1y2X2QsVrpemqV1W23gd98oFxveFqvGMoNXvqrWCUK751835JDI3xAlsuXgwbwstavwq3xU3217qeS4IPDNmQMCS8qA4Cx0KRXMxf4lQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lBQK5MWhIDsyT+FdN8rdLYEIDPtUfiw8bdFu+MjclnDlDkeVIbcMn5auOeij7TnYSQPflNduJLEC3/GB39L7971ZEOFHZgnzlJMAEdVqZP4yXG/UyXoDALkOqVeGfcDNpvODZJLujC2F3PQWNgMAzrvlU7bEfszz+Jrgt9BB0/lk1ORxLGjn8mQWFQU0tledhlmZLoYnfDlxaUB4ZYJDCtqbvpqFZFhm4dwSu1goqafprnqY0pRaOQm/r93datFl/Kyclk5zi2QqvS5eP12miJ4SviviTrxEvC16oR7+NJFIYRAYC9P5H2zzCfykeTeU50DC6xiV7L4XpR3N9zCllQ==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: 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 13:58:48 +0000
  • Ironport-data: A9a23:PCkb3qNsyPglBZ7vrR2fl8FynXyQoLVcMsEvi/4bfWQNrUol12QOn TYcCG6DOP7cZmP8fI0ib9uw9k8Av5/RxoVqHQto+SlhQUwRpJueD7x1DKtR0wB+jCHnZBg6h ynLQoCYdKjYdleF+lH1dOKJQUBUjclkfJKlYAL/En03FV8MpBsJ00o5wbZj294w2LBVPivW0 T/Mi5yHULOa82Yc3lI8s8pvfzs24ZweEBtB1rAPTagjUG32zhH5P7pGTU2FFFPqQ5E8IwKPb 72rIIdVXI/u10xF5tuNyt4Xe6CRK1LYFVDmZnF+A8BOjvXez8CbP2lS2Pc0MC9qZzu1c99Z+ PBMs7ybFggVO4aVgd0BTTZCFiJ+MvgTkFPHCSDXXc27ykTHdz3nwul0DVFwNoodkgp1KTgQr 7pCcmlLN03dwbLtqF64YrAEasALBc/nJo4A/FpnyinUF60OSpHfWaTao9Rf2V/cg+gQQ6mAP ZRHNFKDajyYUyFoMHoQCqh5hbn3wVLQfDAGqE+s8P9fD2/7k1UqjemF3MDuUt6XQcRYmG6Iq 2SA+H72ajkBL8CWwzeB9nOqh8fMkDn9VYZUE6e3ntZ1hHWDy2pVDwcZ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ooWA6mepWlHBHV5ACAYUh57D30XklWKvoJhiKo7zP0d MeeP309bJTaxeXfnrZtm5gzJilWWkyBA6PRgwHttaO2zZbkXhlxw9ArfZv0kso5dY4Ud1J9u 7EOqNnmPVHSdIXd7t0AKMETdGsAmLATBrQOCaZIEjhFqsAJ3XRwqSHrYkd9aWvYtgF3ZEykJ POXBdRsnMzYVvnDYmU0JhC4nn2MSyAtPTWu7djDrRCy8/BrYvQQFq+oQoV4ridSt0kc7jmZ8 o=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHYI1FM/431BUtYuEy2GtPXIcEIC6yZWJaA
  • Thread-topic: [PATCH v2 0/3] retpoline: add clang support + Kconfig selectable

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?

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.

~Andrew

 


Rackspace

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