Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933454AbbFXAQH (ORCPT ); Tue, 23 Jun 2015 20:16:07 -0400 Received: from mga01.intel.com ([192.55.52.88]:59651 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755056AbbFXAP6 (ORCPT ); Tue, 23 Jun 2015 20:15:58 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,669,1427785200"; d="scan'208";a="593583268" From: "Zheng, Lv" To: "Rafael J. Wysocki" CC: "Wysocki, Rafael J" , "Brown, Len" , Lv Zheng , "linux-kernel@vger.kernel.org" , "linux-acpi@vger.kernel.org" , "Moore, Robert" Subject: RE: [PATCH 03/32] ACPICA: Hardware: Enable 64-bit firmware waking vector for selected FACS. Thread-Topic: [PATCH 03/32] ACPICA: Hardware: Enable 64-bit firmware waking vector for selected FACS. Thread-Index: AQHQrhTuji6zwa7NYUmJDlzwTOY9w526yVrw Date: Wed, 24 Jun 2015 00:15:33 +0000 Message-ID: <1AE640813FDE7649BE1B193DEA596E88027335E6@SHSMSX101.ccr.corp.intel.com> References: <261af597362906597365810a650c8e5c189e86da.1434684719.git.lv.zheng@intel.com> <2005221.p5Qv0lW5dz@vostro.rjw.lan> In-Reply-To: <2005221.p5Qv0lW5dz@vostro.rjw.lan> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id t5O0GF7O013798 Content-Length: 3840 Lines: 77 Hi, Rafael > From: Rafael J. Wysocki [mailto:rjw@rjwysocki.net] > Sent: Wednesday, June 24, 2015 8:30 AM > > On Friday, June 19, 2015 11:38:28 AM Lv Zheng wrote: > > ACPICA commit 7aa598d711644ab0de5f70ad88f1e2de253115e4 > > > > The root cause of the reported bug might be one of the followings: > > 1. BIOS may favor the 64-bit firmware waking vector address when the > > version of the FACS is greater than 0 and Linux currently only supports > > resuming from the real mode, so the 64-bit firmware waking vector has > > never been set and might be invalid to BIOS while the commit enables > > higher version FACS. > > 2. BIOS may favor the FACS reported via the "FIRMWARE_CTRL" field in the > > FADT while the commit doesn't set the firmware waking vector address of > > the FACS reported by "FIRMWARE_CTRL", it only sets the firware waking > > vector address of the FACS reported by "X_FIRMWARE_CTRL". > > > > This patch excludes the cases that can trigger the bugs caused by the root > > cause 1. > > > > ACPI specification says: > > A. 32-bit FACS address (FIRMWARE_CTRL field in FADT): > > Physical memory address of the FACS, where OSPM and firmware exchange > > control information. > > If the X_FIRMWARE_CTRL field contains a non zero value then this field > > must be zero. > > A zero value indicates that no FACS is specified by this field. > > B. 64-bit FACS address (X_FIRMWARE_CTRL field in FADT): > > 64bit physical memory address of the FACS. > > This field is used when the physical address of the FACS is above 4GB. > > If the FIRMWARE_CTRL field contains a non zero value then this field > > must be zero. > > A zero value indicates that no FACS is specified by this field. > > Thus the 32bit and 64bit firmware waking vector should indicate completely > > different resuming environment - real mode (1MB addressable) and non real > > mode (4GB+ addressable) and currently Linux only supports resuming from > > real mode. > > > > This patch enables 64-bit firmware waking vector for selected FACS via > > acpi_set_firmware_waking_vector() so that it's up to OSPMs to determine which > > resuming mode should be used by BIOS and ACPICA changes won't trigger the > > bugs caused by the root cause 1. For example, Linux can pass > > physical_address64=0 as the parameter of acpi_set_firmware_waking_vector() to > > indicate no 64bit waking vector support. Lv Zheng. > > > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=74021 > > Link: https://github.com/acpica/acpica/commit/7aa598d7 > > Reported-and-tested-by: Oswald Buddenhagen > > Signed-off-by: Lv Zheng > > Signed-off-by: Bob Moore > > So what the patch does is to replace two functions, acpi_set_firmware_waking_vector() > taking one u32 argument and acpi_set_firmware_waking_vector64() taking one u64 > argument, with a modified acpi_set_firmware_waking_vector() taking two arguments > of type acpi_physical_address. And it breaks compliation when applied to Linux > as is AFAICS, doesn't it? Yes, and the fix is patch 04/32. > I guess the point is to allow the OS to set firmware_waking_vector *and* clear > xfirmware_waking_vector at the same time (by passing 0 as the second argument > of the function). And that helps to address the issue when xfirmware_waking_vector > has a random value to start with, we don't clear it and the BIOS thinks it is OK > to use it, right? Yes. > If that's the case, this patch should be combined with [4/32] and the signal-to-noise > ratio of [4/32] needs to be increased quite a bit. I'll combine the 2 patches. Thanks and best regards -Lv ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?