Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp39849pxb; Fri, 15 Jan 2021 07:11:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJxTnSHlHWQnIhCqYl12OFLoBsbJXmwQzzk/NDSES4HfURhx8BOiO5K20iygBFf+lCn5WYnU X-Received: by 2002:a05:6402:1714:: with SMTP id y20mr9882640edu.2.1610723466777; Fri, 15 Jan 2021 07:11:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610723466; cv=none; d=google.com; s=arc-20160816; b=oBf/zcihICc59bxrkcZWCiyErOQixGB3+Mn1rddj25+5CY94YkJA8gDZ+htYyFMXSp QUdcOaqKnsWWV7hG3Bw1KwndLw+65pU/1iV1nCaL4X9zC6Gy98EZgXUpORhLLSvpX86F Vsn6x5fZEDFynSN5p3//gR1dqhbB6wHYjXBIMsGr3G2eizKn4EMB4Uo2sKxjJ9QDQIyz dyIWqvLdj+M61unWIonCum2yrOWdEl7Cu29lXVsBZwn+jj+37cBugi3ShaS5tLhux0dF 2izKCIc+m8rPy2LpuC4wFa093fNXZAipkXfiyUFwmDd3zoV24QJWqxhaTrAmicnNaQPJ usrA== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=NJb6ukKVIDGK20PzckBJC7srAf03mNvPdQ0z7RPLWw8=; b=X7OfFwS1dnmpCVPs8bCCgEewmKVuvawLq/vjWijipYfc5mICdeEdr96RF928nY/J+l StxP+81l16L7PUX4W780QGe7fjB4t2yJTFvfexohX6VbBJt42gRcvVfsfZKidw8v1mL1 tw5XaccsTFknrAzG4/PAmiAUfRWWO1pFiC2xO8HAWqTiVm3uF8/607U5A2D4l1Xc4c2z jJU9SH8+t9fsZpp6oOboimopUXqCklodf0chFKJL9sfVzu+xtb5j1/zp1BQTpOsHyNOT pX1WaUQffXWNzGSax6qbnIctMn4Ja+KufFKdf1CMr0NY8xC4LNhLBn8cQcNOr+u5cl1j y6/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LyGfAwQi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y9si4789274edm.482.2021.01.15.07.10.42; Fri, 15 Jan 2021 07:11:06 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=LyGfAwQi; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731502AbhAOPJq (ORCPT + 99 others); Fri, 15 Jan 2021 10:09:46 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:39913 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbhAOPJq (ORCPT ); Fri, 15 Jan 2021 10:09:46 -0500 X-Greylist: delayed 70072 seconds by postgrey-1.27 at vger.kernel.org; Fri, 15 Jan 2021 10:09:45 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1610723299; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NJb6ukKVIDGK20PzckBJC7srAf03mNvPdQ0z7RPLWw8=; b=LyGfAwQiJ0frKOHsMR4tLA48DYTpEK+1hEx0bvq2AvEmqUS63JoN2XDcgO/08I9y6yc7kt dY8tGaCYnd+czOIIiIhfD+ttc5J6Ib4mMA+8rNUPbQUj3ohDb2fQWhzO8zQ/g8P6eL4TOt BisY5V2HnhYHoK3Jcdh9p4mYTWViCJQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-iMfeSiUpMzKE07biV3KWzQ-1; Fri, 15 Jan 2021 10:08:15 -0500 X-MC-Unique: iMfeSiUpMzKE07biV3KWzQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0C759CE650; Fri, 15 Jan 2021 15:08:14 +0000 (UTC) Received: from treble (ovpn-116-102.rdu2.redhat.com [10.10.116.102]) by smtp.corp.redhat.com (Postfix) with ESMTPS id EE9DD60BF3; Fri, 15 Jan 2021 15:08:12 +0000 (UTC) Date: Fri, 15 Jan 2021 09:08:11 -0600 From: Josh Poimboeuf To: =?utf-8?B?SsO8cmdlbiBHcm/Dnw==?= Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Peter Zijlstra , Sami Tolvanen , Sedat Dilek , Kees Cook , Nick Desaulniers , clang-built-linux@googlegroups.com, Miroslav Benes , Boris Ostrovsky Subject: Re: [PATCH 15/21] x86/xen/pvh: Convert indirect jump to retpoline Message-ID: <20210115150811.abom3lkutyrwetpi@treble> References: <12afb52c-f555-656e-d544-c2965a616bdc@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <12afb52c-f555-656e-d544-c2965a616bdc@suse.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021 at 06:24:10AM +0100, Jürgen Groß wrote: > On 14.01.21 20:40, Josh Poimboeuf wrote: > > It's kernel policy to not have (unannotated) indirect jumps because of > > Spectre v2. This one's probably harmless, but better safe than sorry. > > Convert it to a retpoline. > > > > Cc: Boris Ostrovsky > > Cc: Juergen Gross > > Signed-off-by: Josh Poimboeuf > > --- > > arch/x86/platform/pvh/head.S | 3 ++- > > 1 file changed, 2 insertions(+), 1 deletion(-) > > > > diff --git a/arch/x86/platform/pvh/head.S b/arch/x86/platform/pvh/head.S > > index 43b4d864817e..d87cebd08d32 100644 > > --- a/arch/x86/platform/pvh/head.S > > +++ b/arch/x86/platform/pvh/head.S > > @@ -16,6 +16,7 @@ > > #include > > #include > > #include > > +#include > > #include > > __HEAD > > @@ -105,7 +106,7 @@ SYM_CODE_START_LOCAL(pvh_start_xen) > > /* startup_64 expects boot_params in %rsi. */ > > mov $_pa(pvh_bootparams), %rsi > > mov $_pa(startup_64), %rax > > - jmp *%rax > > + JMP_NOSPEC rax > > I'd rather have it annotated only. > > Using ALTERNATIVE in very early boot code is just adding needless > clutter, as the retpoline variant won't ever be active. Yeah, Andy pointed out something similar. I'll be changing this to an annotation. -- Josh