Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp279603pxb; Tue, 19 Oct 2021 02:43:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvuOvLckRpkPhjykA0BqgSZiT3VL5P6Bxc6Pt91v9izM9MFaqTtiDHMtR7l+wnNV9nVPlc X-Received: by 2002:a17:906:6a0b:: with SMTP id qw11mr26598117ejc.422.1634636633677; Tue, 19 Oct 2021 02:43:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634636633; cv=none; d=google.com; s=arc-20160816; b=MznIKxqnV2lyyp0n0Gze8YJatOsXDfLswmxdQVg0zgVX+4/M73vmh7MoJdiDi+q+bJ gTjZvzhoN16rsZn6AzkdfG82duDnSXawhAHvMxRxsgfjX+dXz4T8Q2SASH5lb36g6oxy IUKqYH6cj8JS8Gcmp3HLjM7xKEBOERtJ2rolcgwgxFIGPIFrpg2eaVOG/pAXHp7vfC/e mNJrViWAw9yo/6BinOZA2wlsIsYP9px22Wx2pqi/dJxzQ7I7EAojREWU0e2O6U6qRlnH omXwLSp9lIbn3tgjuykS8KD/excClOwsbor03z1Pkdesz3mNH4xuLYMr49ayae3ntGiY NTNw== 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-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OzhAUkgUxAsZVvVo72iev/FptlxQMpUIteNenWAl3x0=; b=ghKt6f5HBPIhrTyAeJbpAa0VHCrV+FHgwxLvbirvtiUoTbt7+uyRf8IcX9lGEVvdhb NzoAOunF7XIT2RBFadAC/E6x30AfwzwYqKDgZ/OJv/bap865IbxPn8tRzjnhOvl/JgGP lWRaxG1EkzE/LMREpO4JpKitCAsaC0aDExafLESi9MZomH0Uf+eRzazo0d6y2APrhK9K N2GpPnZ+F6qlsdYDiMjsWWI1AT9z5ycarmpbUy3q+B0I4G/ai9vxSaTsRviTxMiqKUco Pfq0AQW9zOFR6+k1pN0gN7BTee2atI2ughqYe8DRZ2W3HTSGguKAuDsW0jz50M5OxNay w1rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=rSJMH2it; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v4si20820448edi.519.2021.10.19.02.43.28; Tue, 19 Oct 2021 02:43:53 -0700 (PDT) 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=@infradead.org header.s=desiato.20200630 header.b=rSJMH2it; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235096AbhJSJnZ (ORCPT + 99 others); Tue, 19 Oct 2021 05:43:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235059AbhJSJnX (ORCPT ); Tue, 19 Oct 2021 05:43:23 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37673C06161C for ; Tue, 19 Oct 2021 02:41:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=OzhAUkgUxAsZVvVo72iev/FptlxQMpUIteNenWAl3x0=; b=rSJMH2it0fhVmZSXw9YaBpIgpR SKr7zwGcVAxgWgS8Hl4MRBF0w482BIyv9XQ24lc7aEMwoPdzDsZTDh9IXazBACRN7NsoJUVAGpKRk kmrtNTtDThwwLBdH7nfogCybneL8fBcTggNLk+K4cUK9GL6hHmWRqOIwe0rLo4TudjUxvLJ1jVSUp 91n+b0k1cDyS9I2GP10m+xw0gRKwYdi7u0x14bgiqSQYY6l8/JLbnzXeyiqa44bfFPLUk9m6Y271Z AIQ8JwZqKvXyBFtoYZwL51JNySiNNkhxYFv+VrCL4jFqrFp2HkQ5B4M/m6vqpSV9ywYGuA5WLSH2D rzVP4jyw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mclc9-00Akbj-Dl; Tue, 19 Oct 2021 09:40:57 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4E9BE30024D; Tue, 19 Oct 2021 11:40:56 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2B493236E4530; Tue, 19 Oct 2021 11:40:56 +0200 (CEST) Date: Tue, 19 Oct 2021 11:40:56 +0200 From: Peter Zijlstra To: Alexander Lobakin Cc: Borislav Petkov , x86@kernel.org, jpoimboe@redhat.com, andrew.cooper3@citrix.com, linux-kernel@vger.kernel.org, alexei.starovoitov@gmail.com, ndesaulniers@google.com Subject: Re: [PATCH 4/9] x86/alternative: Implement .retpoline_sites support Message-ID: References: <20211013122217.304265366@infradead.org> <20211013123645.002402102@infradead.org> <20211015165635.GH174703@worktop.programming.kicks-ass.net> <20211018225905.86034-1-alobakin@pm.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211018225905.86034-1-alobakin@pm.me> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 11:06:35PM +0000, Alexander Lobakin wrote: > From: Peter Zijlstra > Date: Fri, 15 Oct 2021 18:56:35 +0200 > > Hi, > > Gave it a spin with Clang/LLVM, and Just your normal clang build, not some fancy LTO ? eg. make CC=clang. > > > > + target = addr + insn->length + insn->immediate.value; > > > > + reg = (target - &__x86_indirect_thunk_rax) / > > > > + (&__x86_indirect_thunk_rcx - &__x86_indirect_thunk_rax); > > this triggers > > > > > + > > > > + if (WARN_ON_ONCE(reg & ~0xf)) > > > > + return -1; > > this: > > WARN in patch_retpoline:408: addr pcibios_scan_specific_bus+0x196/0x200, op 0xe8, reg 0xb88ca > WARN in patch_retpoline:408: addr xen_pv_teardown_msi_irqs+0x8d/0x120, op 0xe8, reg 0xb88ca > WARN in patch_retpoline:408: addr __mptcp_sockopt_sync+0x7e/0x200, op 0xe8, reg 0xb88ca > [...] > (thousands of them, but op == 0xe8 && reg == 0xb88ca are always the same) > > I know this reg calculation is about to be replaced, but anyway ;) Well, I was sorta hoping to keep that with something like: https://lkml.kernel.org/r/YWgA+vbWCdGLZhq5@hirez.programming.kicks-ass.net Anyway, let me try and reproduce.