From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=192.55.52.43; helo=mga05.intel.com; envelope-from=ruiyu.ni@intel.com; receiver=edk2-devel@lists.01.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 01BBB220C161C for ; Thu, 23 Nov 2017 16:59:49 -0800 (PST) Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Nov 2017 17:04:07 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,444,1505804400"; d="scan'208,217";a="179421999" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by fmsmga005.fm.intel.com with ESMTP; 23 Nov 2017 17:04:07 -0800 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 23 Nov 2017 17:04:06 -0800 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.152]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.159]) with mapi id 14.03.0319.002; Fri, 24 Nov 2017 09:04:05 +0800 From: "Ni, Ruiyu" To: Paolo Bonzini CC: Laszlo Ersek , "Zeng, Star" , edk2-devel-01 , Dann Frazier , "Dong, Eric" , Ard Biesheuvel Thread-Topic: [edk2] [PATCH] MdeModulePkg/AtaAtapiPassThru: disable only BM-DMA at ExitBootServices() Thread-Index: AQHTTnHqYwU6/89GNUuf4hMr1aV/GaL3WQMAgCj8OOD//4BlAIABkIZAgAAvH4CAALZygIAAl6Th Date: Fri, 24 Nov 2017 01:04:04 +0000 Message-ID: <892BF6B9-3CCC-45DB-8C72-E526130502BE@intel.com> References: <20171026154819.20865-1-lersek@redhat.com> <734D49CCEBEEF84792F5B80ED585239D5BACC0A1@SHSMSX104.ccr.corp.intel.com> <0C09AFA07DD0434D9E2A0C6AEB0483103B9BABBA@shsmsx102.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5BACDEC2@SHSMSX104.ccr.corp.intel.com> , <831b3082-2554-8196-5f79-d018e6d4ce37@redhat.com> In-Reply-To: <831b3082-2554-8196-5f79-d018e6d4ce37@redhat.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-Content-Filtered-By: Mailman/MimeDel 2.1.22 Subject: Re: [PATCH] MdeModulePkg/AtaAtapiPassThru: disable only BM-DMA at ExitBootServices() X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Nov 2017 00:59:50 -0000 Content-Language: zh-CN Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable Maybe win10 does some optimization in S4 path. Sent from a small-screen device =1B$B:_=1B(B 2017=1B$BG/=1B(B11=1B$B7n=1B(B24=1B$BF|!$>e8a=1B(B8:01=1B$B!$= =1B(BPaolo Bonzini > =1B$B<= LF;!'=1B(B On 23/11/2017 14:08, Laszlo Ersek wrote: On 11/23/17 03:20, Ni, Ruiyu wrote: I cannot explain precisely why the S4 resume fails. I can just guess: Windows might have some assumptions on the BM bit. Can we make this configurable on the platform level somehow? On one hand, I certainly don't want to break Windows 10, even in case this issue ultimately turns out to be a Windows 10 bug. On the other hand, OVMF does not support S4, and disabling BMDMA at ExitBootServices() in PCI drivers is specifically what the Driver Writers' Guide recommends. Otherwise pending DMA could corrupt OS memory. S4 can be done by the OS even if firmware says it doesn't support it. Once hibernation is done, it is merely a "courtesy" for the OSPM to turn off the computer using the _S4 ACPI object rather than _S5. Paolo