Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3845686imw; Mon, 18 Jul 2022 15:52:37 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vIJRaLXBhEIfjw1zDj/oO4BPWKPF+FRLjrDVIDD422hMtLgUdus0TCh0a73DvlB4pV1eYG X-Received: by 2002:a17:902:b182:b0:16c:da9d:5e8b with SMTP id s2-20020a170902b18200b0016cda9d5e8bmr14676464plr.74.1658184757023; Mon, 18 Jul 2022 15:52:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658184757; cv=none; d=google.com; s=arc-20160816; b=p9ffmqLhQ+ENOOAowxtvL5142p6ACWeyZLzGeMpaQEkgJQwAkWKcjpFBKzHuyOj37X MuCvehop269SrNgbGwJ2E9U6k11yndx99wu9APNJFctLjHzi14Rve0KoJJvTMKdOIELn 4h/FetR/3UC9K6qkyJE8AgA+ZSX/hUqwtq7ORPbsji0RmxwNFPEEpGcXSrNaayHQLdEU 3o7WrbtiYRilLyW6dbAw5PON72nIzpQJ5CFrKMgv3pYAPGRt9ppKljvPgqAqPnW8mDts 4AKPsJhnIebX1ad+JSwSlvA009cPZqHjk0zUuX0/Zw+qA1kO5j19vcouJeFIJUzt8Vp/ IMuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=rUn0maBUx5ugE7Mgwb1+6jXU+G6FA5SFjDCLa91ltLA=; b=sez61EOYvcYUnkfkueb2NkGiIRbNpTrpCa3UEsEnGzTCMvt2MK/+8HNtVv98rVgB4e jCqIyChcV42e1en0y3//GvOFl18zpHm5agJw8gVNawZnqMi6lBd0lMfsgvVF7hUSqgP2 uXsEifb8WoDRpiZwRHKS5ZFFgl95qvqEyjB9YWVuB3l/dToCFBzEealn5qvxsb7j8YTH G0NzxQ4tcj3XSLzYJEU3Ph7RNJYQT+XDVqU/j+oCqLnKZhx6emV3csXklRBUOBLZaEiP L373bO1MySB7iwnA4GN5KhHEpiJTVfFNGw+0+MHJPb4K3S69DK4p0pk/lZD+hMT6AsSI VTww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cEKHYnwS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TPqogNFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o21-20020a17090aac1500b001ef9c6b364esi14433242pjq.92.2022.07.18.15.52.21; Mon, 18 Jul 2022 15:52:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cEKHYnwS; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=TPqogNFB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233487AbiGRWWb (ORCPT + 99 others); Mon, 18 Jul 2022 18:22:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229647AbiGRWWa (ORCPT ); Mon, 18 Jul 2022 18:22:30 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1293825581 for ; Mon, 18 Jul 2022 15:22:29 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1658182946; 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=rUn0maBUx5ugE7Mgwb1+6jXU+G6FA5SFjDCLa91ltLA=; b=cEKHYnwSGG0s4A2JV+dyUMQS9sne0IbbRh+3x4d5kzaN4Lj5KGNij85Yz85nr7q/Z3cST+ 9bfBLjT3NcXgITKYl4a9QTjcsJHu0ejZi/uma31074A/+/iSRI+tTz/9Aiw55L2gEyKSar TfXyvV5HjoeZvrzzortEBuBsV9ztIbPyNEigEz7SJ5YiMIE7LgTGTzmoPJqxov9leyaV9d 32AcJtJPuP4EeojwdGg7gnEzg5PpyDFjOx6CylwIkLYAJcOGVXUgPS7NhmPal4dIVBO960 JU5vPYWL5BfM/Rws/nKkzkheBipqoxJDJlA4baOQQLUK7m+8uYbwZM8yH6welQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1658182946; 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=rUn0maBUx5ugE7Mgwb1+6jXU+G6FA5SFjDCLa91ltLA=; b=TPqogNFBsbv2Irz8Nar57WgWb8eWWgHuX85i7riYrtw1PGR4UFYop1hUDWL/7IhApoPfNI QmZjNlnPmN93MjAg== To: Peter Zijlstra Cc: Linus Torvalds , LKML , the arch/x86 maintainers , Tim Chen , Josh Poimboeuf , Andrew Cooper , Pawan Gupta , Johannes Wikner , Alyssa Milburn , Jann Horn , "H.J. Lu" , Joao Moreira , Joseph Nuzman , Steven Rostedt , Juergen Gross , Masami Hiramatsu , Alexei Starovoitov , Daniel Borkmann , samitolvanen@google.com Subject: Re: [patch 00/38] x86/retbleed: Call depth tracking mitigation In-Reply-To: References: <20220716230344.239749011@linutronix.de> <87wncauslw.ffs@tglx> <87tu7euska.ffs@tglx> <87o7xmup5t.ffs@tglx> Date: Tue, 19 Jul 2022 00:22:26 +0200 Message-ID: <87lesqukm5.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 18 2022 at 23:18, Peter Zijlstra wrote: > On Mon, Jul 18, 2022 at 10:44:14PM +0200, Thomas Gleixner wrote: >> And we need input from the Clang folks because their CFI work also puts >> stuff in front of the function entry, which nicely collides. > > Right, I need to go look at the latest kCFI patches, that sorta got > side-tracked for working on all the retbleed muck :/ > > Basically kCFI wants to preface every (indirect callable) function with: > > __cfi_\func: > int3 > movl $0x12345678, %rax > int3 > int3 > \func: > endbr > \func_direct: > > Ofc, we can still put the whole: > > sarq $5, PER_CPU_VAR(__x86_call_depth); > jmp \func_direct > > thing in front of that. But it does somewhat destroy the version I had > that only needs the 10 bytes padding for the sarq. Right, because it needs the jump. I was just chatting with Jaoa about that over IRC. The jump slow things down. Jaoa has ideas and will reply soonish. Thanks, tglx