Received: by 10.223.185.116 with SMTP id b49csp1658324wrg; Sat, 17 Feb 2018 02:27:12 -0800 (PST) X-Google-Smtp-Source: AH8x227KUCz0PZ2nCU7gOsDieF7gbeiB8m91zlNqw1NPncLuZ3rLyhRwgJkQF1W/lAezCD7c82BD X-Received: by 2002:a17:902:8549:: with SMTP id d9-v6mr3456026plo.54.1518863231897; Sat, 17 Feb 2018 02:27:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518863231; cv=none; d=google.com; s=arc-20160816; b=J5jfhmrVEwgvG1APrWsaqrbFuda1Ia5PSTZcCrdGj3I38fAMsabZ9TT4sI4VtMUE8K y9WdVCB+1Qv9oJv7B3RB1Wrz2ft7DwZ/HL3y83L+jwhTcO8wV7HZiR/t7ag928aRL/CW ROd7katNbuAuWXRysb1w9MYdN9c9mK5e0ZWByQckCghO2eHv/hDBtz0TRPmBPoedhC/j /QmOA8t4ZOxD5cJgxELoDuJni7BE+ACNEDTbcDomwvOfA7GE+F/5KNB8mHv3hTMdCeQ/ Nhom98tA4mfpk5JJJ0CnkMUkiPsa1tWRfumN7RuQ/c/L5GFwCWBy5fBg2hTGnbp3FmAi pCcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=WJOSHoUGHxXld1IeOI4QpYW84azJD9C9u8ZJ8IlYe94=; b=dsx1Oghdobl5cO7SXJnTk5SfHggb+X76OlnaeJlJmSRaXOnncSORFHSx0cP4q6yig1 Px8DsWFGBVITGAR42N3z+E4D0Db4s+myqXjU3CIBGVSzTlC+XVeCrTYGNtWMTa7FIiek qo37uu3uT4f1ftPDiP68Q/V6b3iA3i6XgqpkINg+weI/iONz5SzkFZo9YL20q5HYiSnt RL1eHQXVPfsGcsQ/kFYaVwTGPYThorPnhGC2ctZXv/cMXoNb49MHvrQNPxdjAymau7i0 FYPxmwoGozvrCpvlsjpIV4s0tDlXJZR4FmDitj5wGpnxK8JmwTfxmV9ND8+K7lUrcW4k TZmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=j7h/g3Uh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k136si843817pga.44.2018.02.17.02.26.57; Sat, 17 Feb 2018 02:27:11 -0800 (PST) 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=fail header.i=@gmail.com header.s=20161025 header.b=j7h/g3Uh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751151AbeBQK0W (ORCPT + 99 others); Sat, 17 Feb 2018 05:26:22 -0500 Received: from mail-wm0-f68.google.com ([74.125.82.68]:32855 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751072AbeBQK0U (ORCPT ); Sat, 17 Feb 2018 05:26:20 -0500 Received: by mail-wm0-f68.google.com with SMTP id x4so8666780wmc.0; Sat, 17 Feb 2018 02:26:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=WJOSHoUGHxXld1IeOI4QpYW84azJD9C9u8ZJ8IlYe94=; b=j7h/g3UhpCq5hV1hrRKB9d2ogrV2zU6HBTRrlEdzqVD1J3MoIh2OQfu5+dq32h6eYo Mn+5KeZ0XxUFVS9jO19NjC7S66Fnm/Wxbi4/3biRIDYWb8mpzrruObHDu/k7IaW31qAe WvYZ/mNHKmv6QxafmXSPaVLu1n1wMDczEeyz1Ab5p6H6+weRmNXxd92Eqhfefcr88YF0 Kk6OMalgrMGlketiJmeELGyXrVKwzEFzFcf+Z05EM5NQgwGuzMrEU/VAQVIw0F3oJFEn YETQPuhwOwal3Y0orEoa6+6jXemm7ZQuloo/D8i3n5OgkryjNTxbUTFQDjwZkk6XMsge Bzww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=WJOSHoUGHxXld1IeOI4QpYW84azJD9C9u8ZJ8IlYe94=; b=Nn4cCVgw5OMzB7wOz1FpyjXYdUVP+DL1TA8gnPHWuH8ALGV+2no1T9vKpIUHZvChMR 2+gguK3uPbkvd+ZJkn751YV55Sb3gq+7oNzOtDwi57INxbkCepQqlTmpFQ59XmqVfVLx vkjkSs60fGLMfwtBN9y8eAmrsKcnKzW6S47XYb710dhcw1XIXX0Gy0JvkVsx9gTHYAQB nD8ghxr6KXUC3DXmKSRPPOhEsw2o+NWBwhsXSLP6Ds0cQ3JD9dXoTMlfEEtO6XKpd0Ms sz8Bwr3vPiki0TfkuK/yyChoDLIuAP03ybuGqD3fH5VCoA1QG50OPAqzrIAMak+poVC3 Mfcg== X-Gm-Message-State: APf1xPA3zGLo78P1JI/uVenFbdrBwGb/3pGdGrR/eqSRpXB1uxiK8z6W 3IyrYjYSPBrxxDX4J/hXzCY= X-Received: by 10.28.92.70 with SMTP id q67mr6768364wmb.43.1518863179477; Sat, 17 Feb 2018 02:26:19 -0800 (PST) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id 81sm17244952wmi.26.2018.02.17.02.26.17 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 17 Feb 2018 02:26:18 -0800 (PST) Date: Sat, 17 Feb 2018 11:26:16 +0100 From: Ingo Molnar To: Tim Chen , Peter Zijlstra Cc: David Woodhouse , hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, linux-tip-commits@vger.kernel.org, Borislav Petkov , Peter Zijlstra Subject: Re: [tip:x86/pti] x86/speculation: Use IBRS if available before calling into firmware Message-ID: <20180217102616.vcwatxsgj2vunlew@gmail.com> References: <1518362359-1005-1-git-send-email-dwmw@amazon.co.uk> <1518808600.7876.49.camel@infradead.org> <66f94cb1-8160-56e0-680c-2e847ae05893@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <66f94cb1-8160-56e0-680c-2e847ae05893@linux.intel.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Tim Chen wrote: > On 02/16/2018 11:16 AM, David Woodhouse wrote: > > On Fri, 2018-02-16 at 10:44 -0800, Tim Chen wrote: > >> > >> I encountered hang on a machine but not others when using the above > >> macro. It is probably an alignment thing with ALTERNATIVE as the > >> problem went > >> away after I made the change below: > >> > >> Tim > >> > >> diff --git a/arch/x86/include/asm/nospec-branch.h > >> b/arch/x86/include/asm/nospec-branch.h > >> index 8f2ff74..0f65bd2 100644 > >> --- a/arch/x86/include/asm/nospec-branch.h > >> +++ b/arch/x86/include/asm/nospec-branch.h > >> @@ -148,6 +148,7 @@ extern char __indirect_thunk_end[]; > >> > >> #define alternative_msr_write(_msr, _val, _feature) \ > >> asm volatile(ALTERNATIVE("", \ > >> + ".align 16\n\t" \ > >> "movl %[msr], %%ecx\n\t" \ > >> "movl %[val], %%eax\n\t" \ > >> "movl $0, %%edx\n\t" \ > > > > That's weird. Note that .align in an altinstr section isn't actually > > going to do what you'd expect; the oldinstr and altinstr sections > > aren't necessarily aligned the same, so however many NOPs it inserts > > into the alternative, might be deliberately *misaligning* it in the > > code that actually gets executed. > > > > Are you sure you're not running a kernel where the alternatives code > > would turn that alternative which *starts* with a NOP, into *all* NOPs? > > > > I rebuild the kernel again without the align. I'm no longer > seeing the issue again on that machine that had an issue earlier. > So let's ignore this for now as I can't reproduce the problem. > > It should be other issues causing the hang I saw earlier. Note that PeterZ was struggling with intermittent boot hangs yesterday as well, which hangs came and went during severeal (fruitless) bisection attempts. Then at a certain point the hangs went away altogether. The symptoms for both his and your hangs are consistent with an alignment dependent bug. My other guess is that it's perhaps somehow microcode related? I'm not seeing any hangs myself, on various test systems. Thanks, Ingo