Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-26 Thread Vincenzo Frascino
On 1/26/21 12:07 PM, Catalin Marinas wrote: > On Tue, Jan 26, 2021 at 11:58:13AM +, Vincenzo Frascino wrote: >> On 1/25/21 5:56 PM, Catalin Marinas wrote: >>> On Mon, Jan 25, 2021 at 04:09:57PM +, Vincenzo Frascino wrote: On 1/25/21 2:59 PM, Catalin Marinas wrote: > On Mon, Jan

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-26 Thread Catalin Marinas
On Tue, Jan 26, 2021 at 11:58:13AM +, Vincenzo Frascino wrote: > On 1/25/21 5:56 PM, Catalin Marinas wrote: > > On Mon, Jan 25, 2021 at 04:09:57PM +, Vincenzo Frascino wrote: > >> On 1/25/21 2:59 PM, Catalin Marinas wrote: > >>> On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wr

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-26 Thread Vincenzo Frascino
On 1/25/21 5:56 PM, Catalin Marinas wrote: > On Mon, Jan 25, 2021 at 04:09:57PM +, Vincenzo Frascino wrote: >> On 1/25/21 2:59 PM, Catalin Marinas wrote: >>> On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wrote: On 1/25/21 1:02 PM, Mark Rutland wrote: > On Fri, Jan 22,

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Mark Rutland
Hi Vincenzo, On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote: > Currently, the __is_lm_address() check just masks out the top 12 bits > of the address, but if they are 0, it still yields a true result. > This has as a side effect that virt_addr_valid() returns true even for > inv

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Catalin Marinas
On Mon, Jan 25, 2021 at 04:09:57PM +, Vincenzo Frascino wrote: > On 1/25/21 2:59 PM, Catalin Marinas wrote: > > On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wrote: > >> On 1/25/21 1:02 PM, Mark Rutland wrote: > >>> On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Mark Rutland
On Mon, Jan 25, 2021 at 02:59:12PM +, Catalin Marinas wrote: > On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wrote: > > On 1/25/21 1:02 PM, Mark Rutland wrote: > > > On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote: > > > This patch itself looks fine, but it's not

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Vincenzo Frascino
On 1/25/21 2:59 PM, Catalin Marinas wrote: > On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wrote: >> On 1/25/21 1:02 PM, Mark Rutland wrote: >>> On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote: Currently, the __is_lm_address() check just masks out the top 12

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Catalin Marinas
On Mon, Jan 25, 2021 at 02:36:34PM +, Vincenzo Frascino wrote: > On 1/25/21 1:02 PM, Mark Rutland wrote: > > On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote: > >> Currently, the __is_lm_address() check just masks out the top 12 bits > >> of the address, but if they are 0, it s

Re: [PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-25 Thread Vincenzo Frascino
Hi Mark, On 1/25/21 1:02 PM, Mark Rutland wrote: > Hi Vincenzo, > > On Fri, Jan 22, 2021 at 03:56:40PM +, Vincenzo Frascino wrote: >> Currently, the __is_lm_address() check just masks out the top 12 bits >> of the address, but if they are 0, it still yields a true result. >> This has as a sid

[PATCH v4 1/3] arm64: Improve kernel address detection of __is_lm_address()

2021-01-22 Thread Vincenzo Frascino
Currently, the __is_lm_address() check just masks out the top 12 bits of the address, but if they are 0, it still yields a true result. This has as a side effect that virt_addr_valid() returns true even for invalid virtual addresses (e.g. 0x0). Improve the detection checking that it's actually a k