Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp637193ybb; Fri, 3 Apr 2020 09:06:48 -0700 (PDT) X-Google-Smtp-Source: APiQypIn61ZnFXUzuQIsiTy6i/OMnA6raSbwuzhc4AYCkUK8L/be4fKWI0oHIzUOqeqXzJ7gJXJi X-Received: by 2002:a05:6830:23b6:: with SMTP id m22mr6884903ots.225.1585930008726; Fri, 03 Apr 2020 09:06:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585930008; cv=none; d=google.com; s=arc-20160816; b=i6GJeE+pPkp+967pfgVQZvVqR9Ahlr+1Lw10ouCM9dqI8zY8FehtwYGlo6qcBKJ4Rg daDj3MC6itIL6jRTjwONxva/o6dmpUIxcKOq18jAlybQ9UOTGjvrt6ccCGXCkAdFY4bc 6FTgWKeWT7ONYXVX3IWtCmWSkTBsU5RxVVs1pFL79bRijgzzcOqjUJMSLT/BZMnWYs5E GA1veEWQVkLwXALFDRd0ZzIYZHYsI+cvRZKJreE9fbHg2WLGaBg46Ha9XkBTHvp6yaGW O8xOepUWLhci1p59bLgmDCgCe0RPBQ82R+GNSpiN9GP0moc81E5mY9751sJfseuJd0B/ sUVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=YHwQSmbMG4HnMxZ26bWvjSGCnlTSFj1c/dJ6cczgSfA=; b=fyemKsV+YuGMMTBeaURvRy7qSOGIqU6d66oz2ld8wIzUTE3bBbxMuBdh4MQazDuRyR XVANj2XaQRyQf31RqIlOOEfu/m9IukkD2lJROspcD0lMkPl/9Ztt+LWLUk7yh8f5l5V6 9Sketlw6FOAfcRGTSmNTgXrIriE9mIVLGqZrBQxsjc0Rh5ZYx0riJkNW3kvTyNOwpJ8D GQuVomLBrPmfrvsVPUmToE63nykw/9xDiSUel/O+7WDxbnzxM9lNKLIT7vKISayKxh8W RDwfULoSEbXC8WGvhNkQjFYehdV6uYSNoacxoItyWUDH0XGF+OUykpnmhJkgZq48WSyk objw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dzXheBP2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id f9si4569177otc.162.2020.04.03.09.06.33; Fri, 03 Apr 2020 09:06:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dzXheBP2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2403870AbgDCQFs (ORCPT + 99 others); Fri, 3 Apr 2020 12:05:48 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:29711 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728126AbgDCQFr (ORCPT ); Fri, 3 Apr 2020 12:05:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1585929946; 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: in-reply-to:in-reply-to:references:references; bh=YHwQSmbMG4HnMxZ26bWvjSGCnlTSFj1c/dJ6cczgSfA=; b=dzXheBP2y1RTzsYkoZaecDgFajM1ArWmmN3nGa20Fpij78FfW94btEM6M3xCkJgmhzf3Da l7JQ3HxfjZY6e5egQRw1ywWUGQdoD8h69bCYZTUKn4yrtj34zFAyEiEOfr45l0Dll8kGcn lVHKwqz2aMei3/lyuybGe9y4PYmimAM= 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-447-MXOCZQ6nPuKZKcSD2KNjWA-1; Fri, 03 Apr 2020 12:05:44 -0400 X-MC-Unique: MXOCZQ6nPuKZKcSD2KNjWA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C525F8017CE; Fri, 3 Apr 2020 16:05:42 +0000 (UTC) Received: from treble (ovpn-118-100.rdu2.redhat.com [10.10.118.100]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8772F96B9B; Fri, 3 Apr 2020 16:05:41 +0000 (UTC) Date: Fri, 3 Apr 2020 11:05:38 -0500 From: Josh Poimboeuf To: Alexandre Chartre Cc: x86@kernel.org, linux-kernel@vger.kernel.org, peterz@infradead.org, jthierry@redhat.com, tglx@linutronix.de Subject: Re: [PATCH 5/7] x86/speculation: Annotate intra-function calls Message-ID: <20200403160538.qwu237amhanr6pyi@treble> References: <20200402082220.808-1-alexandre.chartre@oracle.com> <20200402082220.808-6-alexandre.chartre@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200402082220.808-6-alexandre.chartre@oracle.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 02, 2020 at 10:22:18AM +0200, Alexandre Chartre wrote: > .macro RETPOLINE_JMP reg:req > - call .Ldo_rop_\@ > + INTRA_FUNCTION_CALL .Ldo_rop_\@ > .Lspec_trap_\@: > pause > lfence > @@ -102,7 +116,7 @@ > .Ldo_retpoline_jmp_\@: > RETPOLINE_JMP \reg > .Ldo_call_\@: > - call .Ldo_retpoline_jmp_\@ > + INTRA_FUNCTION_CALL .Ldo_retpoline_jmp_\@ > .endm There's a catch: this is part of an alternative. Which means if X86_FEATURE_RETPOLINE isn't set at runtime, then the retpoline won't be there and the ORC data will be wrong. In fact objtool should probably be made smart enough to warn about this situation, when an alternative changes the stack state. The only way I can think of to fix this is to have ORC alternatives :-/ -- Josh