# Re: \[PATCHv3 33/33\] mm, x86: introduce PR\_SET\_MAX\_VADDR and PR\_GET\_MAX\_VADDR

- From: Andy Lutomirski \<luto@amacapital.net\>
- Date: 2017-02-17 17:22:14 
- List: linux-arch
- Page: https://ratatoskr.run/linux-arch/2017/02/4937243
- Thread: https://ratatoskr.run/linux-arch/2017/02/4937077/t.md

```text
On Fri, Feb 17, 2017 at 9:19 AM, Dave Hansen [ref] wrote:
> On 02/17/2017 06:13 AM, Kirill A. Shutemov wrote:
>> +/*
>> + * Default maximum virtual address. This is required for
>> + * compatibility with applications that assumes 47-bit VA.
>> + * The limit can be changed with prctl(PR_SET_MAX_VADDR).
>> + */
>> +#define MAX_VADDR_DEFAULT    ((1UL << 47) - PAGE_SIZE)
>
> This is a bit goofy.  It's not the largest virtual adddress that can be
> accessed, but the beginning of the last page.

No, it really is the limit.  We don't allow user code to map the last
page because ti would be a root hole due to SYSRET.  Thanks, Intel.
See the comment near TASK_SIZE_MAX IIRC.

--Andy
```
