Received: by 10.223.185.116 with SMTP id b49csp1259581wrg; Fri, 16 Feb 2018 15:48:20 -0800 (PST) X-Google-Smtp-Source: AH8x2242Qw3C29N4Pa5oKNOfPxyILP2YNQH9IVm/uRVuG+OaihFg5XKQNvfQEyGvXBGNawEyoxJ2 X-Received: by 2002:a17:902:aa8e:: with SMTP id d14-v6mr7031636plr.94.1518824899978; Fri, 16 Feb 2018 15:48:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518824899; cv=none; d=google.com; s=arc-20160816; b=ji1ijNL8CzUILOLOkD+HvBwVzuJqIpATeI8A0K2GmjANalMqZ6XKhPDKtnfvkljkGP HHavD43PDkLxfWZmHIz1xaMG0jQo7mUNOYeSB/XKlYsGmrVG5LaXpQkSVmM8kJRFD94U kIEqWrE7T5RA859YresmAoSYWohtVV5hGHiiwOHPkHEhdjJWiHID2AmsULHmvLuHdFI+ 7Q8c834tHbKUzv+gw7J9v/6ZWrrZSdUM9PpgBcVSj3UkMKXvhRKVxN2XeStDTRjD5gtN FXrz2IGtJYv1euAV6n0JJ9/OnKO7NLkCuapliiXIDJvOE4X1cZHrxpU+3VE8onz2bid7 5WTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=maDJO6QDaDe+kXm40CHyOTahw2cIHyEpZfRAw/PpI7c=; b=Scj5SGdTtFIXyrGURBp6wxqkATen6riZTmT2lbg5+CGLGWt4wskqXDwExDA+wEbglj 1/3b1nh9OZxfJflOLZGK1gvQgAXIUnxNy0f+Ws/gDXuzR4tGwMnQqX2emOPxy5vdjYbr iTZPmfaLloGDtHcUe1h+ebY9KYJK+/G5w5/h131B7myJLx9b00pQoEfindPpjqdsSnD1 MoCQA7CuFm7WU3kO7+GOWqMzYxUwwiz/Ea0iuE5CsSdSzP+WAts9ibC2smzROA5lDVR5 ZKag74RLMU8lu6JraiXoNEBdkTye0CkvAsZo/7FksMRN2hv2RfqDzid+b4AVhEdS0hjU 4D0g== ARC-Authentication-Results: i=1; mx.google.com; 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 bf3-v6si3198597plb.145.2018.02.16.15.48.05; Fri, 16 Feb 2018 15:48:19 -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; 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 S1751029AbeBPXq6 (ORCPT + 99 others); Fri, 16 Feb 2018 18:46:58 -0500 Received: from mga02.intel.com ([134.134.136.20]:51140 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750836AbeBPXq4 (ORCPT ); Fri, 16 Feb 2018 18:46:56 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 16 Feb 2018 15:46:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,522,1511856000"; d="scan'208";a="204946236" Received: from schen9-desk3.jf.intel.com (HELO [10.54.74.42]) ([10.54.74.42]) by fmsmga006.fm.intel.com with ESMTP; 16 Feb 2018 15:46:55 -0800 Subject: Re: [tip:x86/pti] x86/speculation: Use IBRS if available before calling into firmware To: David Woodhouse , mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, peterz@infradead.org, linux-tip-commits@vger.kernel.org References: <1518362359-1005-1-git-send-email-dwmw@amazon.co.uk> <1518808600.7876.49.camel@infradead.org> From: Tim Chen Message-ID: <66f94cb1-8160-56e0-680c-2e847ae05893@linux.intel.com> Date: Fri, 16 Feb 2018 15:46:55 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.0 MIME-Version: 1.0 In-Reply-To: <1518808600.7876.49.camel@infradead.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks. Tim