Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756375AbdDGNf6 (ORCPT ); Fri, 7 Apr 2017 09:35:58 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:56582 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756298AbdDGNfs (ORCPT ); Fri, 7 Apr 2017 09:35:48 -0400 Subject: Re: [PATCH 8/8] x86/mm: Allow to have userspace mappings above 47-bits To: "Kirill A. Shutemov" , Linus Torvalds , Andrew Morton , x86@kernel.org, Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" References: <20170406140106.78087-1-kirill.shutemov@linux.intel.com> <20170406140106.78087-9-kirill.shutemov@linux.intel.com> Cc: Andi Kleen , Dave Hansen , Andy Lutomirski , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Dmitry Safonov From: Anshuman Khandual Date: Fri, 7 Apr 2017 19:05:26 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <20170406140106.78087-9-kirill.shutemov@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17040713-0008-0000-0000-000005517C84 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17040713-0009-0000-0000-0000135DB7FE Message-Id: <8d68093b-670a-7d7e-2216-bf64b19c7a48@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-04-07_12:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1702020001 definitions=main-1704070114 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1384 Lines: 27 On 04/06/2017 07:31 PM, Kirill A. Shutemov wrote: > On x86, 5-level paging enables 56-bit userspace virtual address space. > Not all user space is ready to handle wide addresses. It's known that > at least some JIT compilers use higher bits in pointers to encode their > information. It collides with valid pointers with 5-level paging and > leads to crashes. > > To mitigate this, we are not going to allocate virtual address space > above 47-bit by default. I am wondering if the commitment of virtual space range to the user space is kind of an API which needs to be maintained there after. If that is the case then we need to have some plans when increasing it from the current level. Will those JIT compilers keep using the higher bit positions of the pointer for ever ? Then it will limit the ability of the kernel to expand the virtual address range later as well. I am not saying we should not increase till the extent it does not affect any *known* user but then we should not increase twice for now, create the hint mechanism to be passed from the user to avail beyond that (which will settle in as a expectation from the kernel later on). Do the same thing again while expanding the address range next time around. I think we need to have a plan for this and particularly around 'hint' mechanism and whether it should be decided per mmap() request or at the task level.