Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1266396
| From | "Chen, Yu C" <yu.c.chen@intel.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support |
| Date | 2015-11-10 11:50 +0100 |
| Message-ID | <qteEV-3V9-11@gated-at.bofh.it> (permalink) |
| References | <qrJ0u-Z9-3@gated-at.bofh.it> <qtctr-2BN-5@gated-at.bofh.it> <qtcts-2BN-11@gated-at.bofh.it> <qtdIR-3jG-17@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
> -----Original Message-----
> From: Chen, Yu C
> Sent: Tuesday, November 10, 2015 5:43 PM
> To: Zheng, Lv
> Cc: Lv Zheng; linux-kernel@vger.kernel.org; linux-acpi@vger.kernel.org;
> Wysocki, Rafael J; Brown, Len
> Subject: RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support
>
> Hi, Lv
> Sorry for my late feedback on the patch, one minor nit below:
>
> > -----Original Message-----
> > From: Zheng, Lv
> > Sent: Tuesday, November 10, 2015 4:22 PM
> > To: Wysocki, Rafael J; Brown, Len
> > Cc: Zheng, Lv; Lv Zheng; linux-kernel@vger.kernel.org; linux-
> > acpi@vger.kernel.org; Chen, Yu C
> > Subject: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable()
> > support
> >
> > From: Chen Yu <yu.c.chen@intel.com>
> >
> > This patch implements acpi_os_readable(). The function is used by ACPI
> > AML debugger to validate user specified pointers for the dumpable AML
> > operand objects.
> >
> > Signed-off-by: Chen Yu <yu.c.chen@intel.com>
> > Signed-off-by: Lv Zheng <lv.zheng@intel.com>
> > ---
> > +bool __acpi_memory_readable(void *pointer, size_t length) {
> > + unsigned long start_pfn, end_pfn;
> > +
> We should only check the low memory, otherwise the highmem address
> might bring unexpected behavior in this function, I think we should add:
> if (pointer >= PAGE_OFFSET)
> return false;
Should be :
If (pointer < PAGE_OFFSET && pointer >= high_memory)
return false;
> > + start_pfn = page_to_pfn(virt_to_page(pointer));
> > + end_pfn = page_to_pfn(virt_to_page(pointer + length));
> Convert pointer to char* first?
> end_pfn = page_to_pfn(virt_to_page((char*)pointer + length));
>
> > + /*
> > + * Since the acpi address is allocated by kmalloc, we only
> > + * need to consider the direct-mapping virtual address,
> > + * rather than the kmap/vmalloc/ioremap address.
> > + */
> > + return pfn_range_is_mapped(start_pfn, end_pfn) ? true : false; }
> > +
> Thanks!
>
> Best Regards,
> Yu
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC PATCH v2 0/5] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng <lv.zheng@intel.com> - 2015-11-06 07:50 +0100
[RFC PATCH v2 3/5] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng <lv.zheng@intel.com> - 2015-11-06 07:50 +0100
[RFC PATCH v2 2/5] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng <lv.zheng@intel.com> - 2015-11-06 07:50 +0100
[PATCH v2 4/7] ACPI / debugger: Add IO interface to access debugger functionalities Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 3/7] ACPICA: Debugger: Fix runtime stub issues of ACPI_DEBUGGER_EXEC using different stub mechanism Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 2/7] ACPICA: Debugger: Convert some mechanisms to OSPM specific Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support "Chen, Yu C" <yu.c.chen@intel.com> - 2015-11-10 10:50 +0100
RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support "Chen, Yu C" <yu.c.chen@intel.com> - 2015-11-10 11:50 +0100
Re: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-10 14:10 +0100
RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support "Chen, Yu C" <yu.c.chen@intel.com> - 2015-11-10 15:00 +0100
RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support "Zheng, Lv" <lv.zheng@intel.com> - 2015-11-11 06:10 +0100
RE: [PATCH v2 5/7] ACPI / x86: introduce acpi_os_readable() support "Chen, Yu C" <yu.c.chen@intel.com> - 2015-11-11 06:30 +0100
[PATCH v2 0/7] ACPICA / debugger: Add in-kernel AML debugger support Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 6/7] tools/power/acpi: Add userspace AML interface support Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 1/7] ACPICA: Debugger: Remove unnecessary status check Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
[PATCH v2 7/7] ACPI / debugger: Add module support for ACPI debugger Lv Zheng <lv.zheng@intel.com> - 2015-11-10 09:30 +0100
csiph-web