Re: [PATCH v4] x86/gart/kcore: Exclude GART aperture from kcore

2019-03-06 Thread Kairui Song
On Thu, Mar 7, 2019 at 1:03 AM Jiri Bohac wrote: > > Hi, > > On Wed, Mar 06, 2019 at 07:38:59PM +0800, Kairui Song wrote: > > +int register_mem_pfn_is_ram(int (*fn)(unsigned long pfn)) > > +{ > > + if (mem_pfn_is_ram) > > + return -EBUSY; > > + mem_pfn_is_ram = fn; > > + re

Re: [PATCH v4] x86/gart/kcore: Exclude GART aperture from kcore

2019-03-06 Thread Jiri Bohac
Hi, On Wed, Mar 06, 2019 at 07:38:59PM +0800, Kairui Song wrote: > +int register_mem_pfn_is_ram(int (*fn)(unsigned long pfn)) > +{ > + if (mem_pfn_is_ram) > + return -EBUSY; > + mem_pfn_is_ram = fn; > + return 0; > +} > + > +void unregister_mem_pfn_is_ram(void) > +{ > +

[PATCH v4] x86/gart/kcore: Exclude GART aperture from kcore

2019-03-06 Thread Kairui Song
On machines where the GART aperture is mapped over physical RAM, /proc/kcore contains the GART aperture range and reading it may lead to kernel panic. Vmcore used to have the same issue, until we fixed it in commit 2a3e83c6f96c ("x86/gart: Exclude GART aperture from vmcore")', leveraging existing