From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12258C43387 for ; Mon, 7 Jan 2019 20:03:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D9170206BB for ; Mon, 7 Jan 2019 20:03:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727001AbfAGUDS (ORCPT ); Mon, 7 Jan 2019 15:03:18 -0500 Received: from mx1.redhat.com ([209.132.183.28]:47832 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726511AbfAGUDS (ORCPT ); Mon, 7 Jan 2019 15:03:18 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CCB954026B; Mon, 7 Jan 2019 20:03:17 +0000 (UTC) Received: from [10.10.120.16] (ovpn-120-16.rdu2.redhat.com [10.10.120.16]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AEC3B620D0; Mon, 7 Jan 2019 20:03:16 +0000 (UTC) Subject: Re: [PATCH 1/1] x86/boot/compressed/64: Set EFER.LME=1 in 32-bit trampoline code before returning to long mode To: "Kirill A. Shutemov" Cc: x86@kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, linux-kernel@vger.kernel.org, linux-x86_64@vger.kernel.org, bgilbert@redhat.com References: <20190104054411.12489-1-wei@redhat.com> <20190107082512.w5gkbebsypionyey@black.fi.intel.com> From: Wei Huang Message-ID: <6899e645-9579-f599-922a-eb26fc56e8ab@redhat.com> Date: Mon, 7 Jan 2019 14:03:15 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <20190107082512.w5gkbebsypionyey@black.fi.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Mon, 07 Jan 2019 20:03:17 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [adding lkml and linux-x86_64] On 1/7/19 2:25 AM, Kirill A. Shutemov wrote: > On Fri, Jan 04, 2019 at 05:44:11AM +0000, Wei Huang wrote: >> In some old AMD KVM implementation, guest's EFER.LME bit is cleared by KVM >> when the hypervsior detects guest sets CR0.PG to 0. This causes guest OS >> to reboot when it tries to return from 32-bit trampoline code because CPU >> is in incorrect state: CR4.PAE=1, CR0.PG=1, CS.L=1, but EFER.LME=0. >> As a precaution, this patch sets EFER.LME=1 as part of long mode >> activation procedure. This extra step won't cause any harm when Linux is >> booting on bare-metal machine. >> >> Signed-off-by: Wei Huang > > Thanks for tracking this down. BTW I think this patch _might_ be related the recent reboot issue reported in https://lkml.org/lkml/2018/7/1/836 since the symptoms are exactly the same. > > Acked-by: Kirill A. Shutemov > Fixes: 34bbb0009f3b ("x86/boot/compressed: Enable 5-level paging during decompression stage") >