Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754637AbbLXH5z (ORCPT ); Thu, 24 Dec 2015 02:57:55 -0500 Received: from mga01.intel.com ([192.55.52.88]:64591 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753050AbbLXH5x (ORCPT ); Thu, 24 Dec 2015 02:57:53 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,472,1444719600"; d="scan'208";a="877923758" From: "Chen, Yu C" To: Andy Lutomirski , "Zheng, Lv" CC: "Moore, Robert" , "Wysocki, Rafael J" , "Brown, Len" , "Andy Lutomirski" , Lv Zheng , "linux-kernel@vger.kernel.org" , Linux ACPI , "H. Peter Anvin" , "Borislav Petkov" Subject: RE: [PATCH v4 7/7] ACPI / x86: introduce acpi_os_readable() support Thread-Topic: [PATCH v4 7/7] ACPI / x86: introduce acpi_os_readable() support Thread-Index: AQHRLXRnRL/kuZhBvUWr+aZgefsuPJ7KrTWAgABxKICAAKu9UIABCo7ggAIi7ACAB1SzoIAA6KaAgABNGQCAAXUZAIAA6udA Date: Thu, 24 Dec 2015 07:57:34 +0000 Message-ID: <36DF59CE26D8EE47B0655C516E9CE64028688FC9@shsmsx102.ccr.corp.intel.com> References: <36DF59CE26D8EE47B0655C516E9CE64028686D35@shsmsx102.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E883BB08C24@SHSMSX101.ccr.corp.intel.com> <36DF59CE26D8EE47B0655C516E9CE640286886D1@shsmsx102.ccr.corp.intel.com> <1AE640813FDE7649BE1B193DEA596E883BB0A29B@SHSMSX101.ccr.corp.intel.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYjg5ODM2NzUtZTY4YS00MGY0LTkxZWMtNTQ1ZjFhZGEzYzU1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjQuMTAuMTkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT3RSTkZ5aCtsT2hJVTNQNGJrWVwvbDV5YWYrXC9rMmtWY3NMZzBhY3Z1R2swPSJ9 x-ctpclassification: CTP_IC 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 mail.home.local id tBO7wBdu019978 Content-Length: 1470 Lines: 32 Hi,Andy > -----Original Message----- > From: Andy Lutomirski [mailto:luto@amacapital.net] > Sent: Thursday, December 24, 2015 9:40 AM > To: Zheng, Lv > Cc: Chen, Yu C; Moore, Robert; Wysocki, Rafael J; Brown, Len; Andy > Lutomirski; Lv Zheng; linux-kernel@vger.kernel.org; Linux ACPI; H. Peter > Anvin; Borislav Petkov > Subject: Re: [PATCH v4 7/7] ACPI / x86: introduce acpi_os_readable() support > > On Tue, Dec 22, 2015 at 7:25 PM, Zheng, Lv wrote: [cut] > > It seems a bit unfortunate to me that the ACPICA debugger lets userspace > choose what address to dump rather than dumping by pathname, but given > that constraint, I guess this function is needed. > > Can you do something like checking virt_addr_valid and then using > virt_to_pfn and page_is_ram? If that's not enough (e.g. if it doesn't work for > vmalloc addresses and you need those), you could try to do something like > slow_virt_to_phys, but you'd need to do some extra checks to avoid the > BUG in the function. > [Yu] This is a good method, firstly virt_addr_valid can exclude the vaddr of vmalloc/kmap , then slow_virt_to_phys can check if this vaddr has a valid pte physical address, but I guess we need another non-BUG_on version of slow_virt_to_phys, I'll try to test with your suggestion, thanks! Yu ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?