[PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Vasant Hegde
Add check to validate whether requested page is part of system RAM or not before mmap() and error out if its not part of system RAM. cat /proc/iomem: - -27 : System RAM 28-2f : namespace0.0 2000-2027 : System RAM 2028-202f

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Vaidyanathan Srinivasan
* Vasant Hegde [2019-10-02 13:18:56]: > Add check to validate whether requested page is part of system RAM > or not before mmap() and error out if its not part of system RAM. > > cat /proc/iomem: > - > -27 : System RAM > 28-2f : namespace0.0 > 2000

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Jeremy Kerr
Hi Vasant, > Add check to validate whether requested page is part of system RAM > or not before mmap() and error out if its not part of system RAM. opal_prd_range_is_valid() will return false if the reserved memory range does not have an ibm,prd-label property. If this you're getting invalid memo

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Vasant Hegde
On 10/3/19 7:17 AM, Jeremy Kerr wrote: Hi Vasant, Jeremy, Add check to validate whether requested page is part of system RAM or not before mmap() and error out if its not part of system RAM. opal_prd_range_is_valid() will return false if the reserved memory range does not have an ibm,prd-

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Jeremy Kerr
Hi Vasant, > Correct. We will have `ibm,prd-label` property. That's not the issue. It sure sounds like the issue - someone has represented a range that should be mapped by HBRT, but isn't appropriate for mapping by HBRT. > Here issueis HBRT is loaded into NVDIMM memory. OK. How about we just d

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-02 Thread Vasant Hegde
On 10/3/19 10:26 AM, Jeremy Kerr wrote: Hi Vasant, Correct. We will have `ibm,prd-label` property. That's not the issue. It sure sounds like the issue - someone has represented a range that should be mapped by HBRT, but isn't appropriate for mapping by HBRT. Here issueis HBRT is loaded into

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-03 Thread Jeremy Kerr
Hi Vasant, > > OK. How about we just don't do that? > > Yes. Hostboot will fix that. It will make sure that HBRT is loaded > into regular memory. Super. > > It sounds like we're just trying to work around an invalid > > representation of the mappings. > > Its not workaround. Its additional che

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-03 Thread Vaidyanathan Srinivasan
* Jeremy Kerr [2019-10-03 15:07:24]: > Hi Vasant, > > > > OK. How about we just don't do that? > > > > Yes. Hostboot will fix that. It will make sure that HBRT is loaded > > into regular memory. > > Super. > > > > It sounds like we're just trying to work around an invalid > > > representation

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-03 Thread Jeremy Kerr
Hi Vaidy, The current topic is who owns setting up the ATT bits for that piece of memory. It is the kernel today. Kernel decides to set this up as normal memory or I/O memory and sets the bits in page table entry. Or, what if there's a range of address-space that isn't backed by system RAM (

Re: [PATCH] powerpc/powernv/prd: Validate whether address to be mapped is part of system RAM

2019-10-04 Thread Vaidyanathan Srinivasan
* Jeremy Kerr [2019-10-04 11:27:46]: > Hi Vaidy, > > > The current topic is who owns setting up the ATT bits for that piece > > of memory. It is the kernel today. Kernel decides to set this up as > > normal memory or I/O memory and sets the bits in page table entry. > > > > > Or, what if ther