Hi,Andy > -----Original Message----- > From: Andy Lutomirski [mailto:luto@xxxxxxxxxxxxxx] > 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@xxxxxxxxxxxxxxx; 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 <lv.zheng@xxxxxxxxx> 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�����{�����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f