Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4319756pxj; Tue, 8 Jun 2021 11:24:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTKjOLcXdPy7x08hkjhnQJofjgC9f+0+MMCjyYPhihlqqfFTbPT+RUQZqHiPiwlMFXdmTv X-Received: by 2002:a17:906:f192:: with SMTP id gs18mr21430412ejb.114.1623176651097; Tue, 08 Jun 2021 11:24:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623176651; cv=none; d=google.com; s=arc-20160816; b=O3NOhckWxi18Ajcd/G0yTOkbIjTlAQLSipmc3nIiSbJGj+aWIDyG48U7aorpjZm0YR h3aIEThi254Rx1Pp2XonKYuT9GLUXvqBZG12++orXLlFcoDEeRHC6dAShGgaHofrGBOG y4Zu0VaVOR7IAlHhj1oyXCFJj15GvOtIJr+dQjptXNEIHMLFrctvVrVzmopMEr4Esrdp w4/uGKKbkhRJ1JW3XuH2E7WqtVbJaYuZ9aBl5vekpShd541d3oMt8IoGcP5EIuSEvymB AXh8y6RSE6AD/jbxeLs7+DeZWLu2qZH+sXy6vhbCx7UkxunkLZDJhdDWNnAIZoI+LIL8 HohA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=S5x5dJs8d2mi+sk6vZuhsX9aDnrxEX5BFKyzyJmLqRU=; b=XRCRVp70YZOMxqjX3FtTpJg8MQvfWWxAN2GehqONzKkc9kFN7NAmf2+XK2C36B0NsM Ez9vmFmS412l1PRCaaGZqvxMj1boUcgTHV8DpjDK0StMlpZztgpUbjQ4GkzD7BD8/Rs9 W6Wc3fUovf8mE2XTHPpFYX0QbDOEhuij+3gRlT7POy0tKWAxu3mEShO7PXKU+Hx7HDTw sfgfycHf+yH+KF3zSwfwmvx/1zB+dPG13rISFU6pT2vG8os/X9pkE/oEKjhyfFTyZjwS cSb5lmnNj3fGhBFsw7VAHRhP5Hxdh7hkrUM5ZZkHn4aCaWvGujpp9T0gArtfhUOb6k82 Em0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=iLG7QObB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w13si356362edx.454.2021.06.08.11.23.46; Tue, 08 Jun 2021 11:24:11 -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=@google.com header.s=20161025 header.b=iLG7QObB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234074AbhFHSVf (ORCPT + 99 others); Tue, 8 Jun 2021 14:21:35 -0400 Received: from mail-lj1-f182.google.com ([209.85.208.182]:43525 "EHLO mail-lj1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234066AbhFHSVe (ORCPT ); Tue, 8 Jun 2021 14:21:34 -0400 Received: by mail-lj1-f182.google.com with SMTP id r14so9105837ljd.10 for ; Tue, 08 Jun 2021 11:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S5x5dJs8d2mi+sk6vZuhsX9aDnrxEX5BFKyzyJmLqRU=; b=iLG7QObByXRfzCEVH5a+QeLgxXMzL96RiXSA+cbqVM5VcqnLoFIbQJoalLeH4x5JQj Oqz9smXP3uZNArqCtYaBM2R6dHYk02bGMI4FxZdd8lD47Nwc6Rt0iT/B+bPe/Q1w4hum wmWVSqXpRldvYl1rfTectH5HegCHSQJPYoehm34rX2y4u8rR+7J6aN7p2t97MNip/FEk b6JT9D2PzjZq+uWagIXCpclqgypQ2sqySHtpyNGW0PKYGtchrX2zIUd+PBL6/oA73lq8 6UPe30prIoXzJgYCfmT/vPB5rSczdSNWHBmK2PQslwCw1J8+1GQXG54ZkvCULM/GCzRK MprQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S5x5dJs8d2mi+sk6vZuhsX9aDnrxEX5BFKyzyJmLqRU=; b=jENv6ydUI9guc3CfwvrpzJoksNbg3V3nHIvGnoCBS/HGBLR6oUPclE8ir3ybeLPH7D Stzt5UnsZO1ompJisT7PM9V+b5Bo19CA9MmAM3nCS9lHtkaDGZqxqQbgLEpZjjpc/L6V MdiPwx0ys0xvJgvpTLgCXMQIxl/bbCGARfapk/nimlbSguXtQnLaxI3qP9xdyamu+9lt WovSTPQKhdHZaao+mpls+SfCQzPE8Zt61MaXgqvTWnRoTTN9sMkqS9KJiJLxQZ5LFR18 0HucN90s4DxEOjr6HSzhhqk+sl9Y9TbS+ZeXz53dHgpRRFP2huDcplOcbgyjuBYbF1Ei 70wA== X-Gm-Message-State: AOAM532Sy2uBlB7pRSqFraqkoWZc7kCmcsmPyNzTQTnU0eN8MRbwG0ik gJIob1TNVd/vdJnm73CxEhkOO95sESNZF0xjoJaZNQ== X-Received: by 2002:a2e:96c9:: with SMTP id d9mr2537698ljj.0.1623176306424; Tue, 08 Jun 2021 11:18:26 -0700 (PDT) MIME-Version: 1.0 References: <20210604205018.2238778-1-ndesaulniers@google.com> <20210604235046.w3hazgcpsg4oefex@google.com> In-Reply-To: From: Nick Desaulniers Date: Tue, 8 Jun 2021 11:18:15 -0700 Message-ID: Subject: Re: [PATCH v3 16/16] objtool,x86: Rewrite retpoline thunk calls To: Nathan Chancellor Cc: Peter Zijlstra , =?UTF-8?B?RsSBbmctcnXDrCBTw7JuZw==?= , Josh Poimboeuf , lma@semihalf.com, Guenter Roeck , Juergen Gross , lb@semihalf.com, LKML , mbenes@suse.com, =?UTF-8?Q?Rados=C5=82aw_Biernacki?= , upstream@semihalf.com, "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , clang-built-linux , Sami Tolvanen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 8, 2021 at 10:30 AM Nathan Chancellor wrote: > > On 6/8/2021 10:22 AM, Peter Zijlstra wrote: > > On Tue, Jun 08, 2021 at 09:58:03AM -0700, Nathan Chancellor wrote: > >> On 6/7/2021 1:54 PM, 'Nick Desaulniers' via Clang Built Linux wrote: > >>> Nathan, > >>> Can you please test the below diff and see if that resolves your boot > >>> issue reported in: > >>> https://github.com/ClangBuiltLinux/linux/issues/1384 > >> > >> Unfortunately, it does not appear to resolve that issue. > >> > >> $ git log -2 --decorate=no --oneline > >> eea6a9d6d277 Peter's fix > >> 614124bea77e Linux 5.13-rc5 > >> > >> $ strings /mnt/c/Users/natec/Linux/kernel-investigation | grep microsoft > >> 5.13.0-rc5-microsoft-standard-WSL2-00001-geea6a9d6d277 > >> (nathan@archlinux-ax161) #3 SMP Tue Jun 8 09:46:19 MST 2021 > >> > >> My VM still never makes it to userspace. > > > > Since it's a VM, can you use the gdb-stub to ask it where it's stuck? > > > > Unfortunately, this is the VM provided by the Windows Subsystem for > Linux so examining it is nigh-impossible :/ I am considering bisecting > the transforms that objtool does to try and figure out the one that > causes the machine to fail to boot or try to reproduce in a different > hypervisor, unless you have any other ideas. Assuming this is an optimization and not required to boot/run; you could test that quickly by putting a return statement as the first statement in the list_for_each_entry loop in arch_rewrite_retpolines. If that works, you could instead use a counter to try to see which symbol is bad; once you bisect a counter value where things start/stop booting, you could try to print the corresponding symbol (ie `name`). (Optimization Fuel) (Sorry if any of that is unclear, let's follow up off thread if so). Maybe that symbol will give us further clues? I think that would tell us whether it's a problematic jump vs call, and via which register. -- Thanks, ~Nick Desaulniers