From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1474022315 for ; Wed, 30 Oct 2024 12:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730292282; cv=none; b=l1tQWwAg8F9sLU3W54Ef1KLC7Ms5u4l+y/pwf9+RjXQqpMn9qxwWHg9u1EqmTQ+nRbAs9V6ITSEGjvMH5h3KARGnJ8GpDs+DY56ayBCw1gCcQwuSr5e22QsX7r4yYGDLVKcefWKUEFptP2uRw7SdeglEmTLciuW6fHmLnIDRmnc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730292282; c=relaxed/simple; bh=H++HmjKhebRVlkZRER4SxkpjW88SChOmMzndhY5L/0c=; h=Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type; b=d48SRo3QcFvPbehFKhpl29J5wipNqmo6nuHsyayGywRia7dd3azaRP7BKuxIkIVnvvh88jL+AocIKFdFn2MzrqMzRhNIyQTh/uxV9j1agltD4IenZE7MXg8xNwPpPEgHNgNo6pukcZy78e+El2P7fQ1Bhk+6I19LXxQwGYAmV6Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gknwLCtl; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gknwLCtl" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 84078C4CEE3; Wed, 30 Oct 2024 12:44:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1730292281; bh=H++HmjKhebRVlkZRER4SxkpjW88SChOmMzndhY5L/0c=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gknwLCtlhLnlXcVLYVnDtLlIhsEf0wPARZxOPwtwk85boWzajhf7BTjlbi4Q5Yc9I YoX3pFZC8DDUvXAEp6YJUA3eO2TYAfF8GLERArTGDvm8NZaSqn2gU7zqGVpcF9lCjQ vfEMPZWIukGVxRJpExzaue6W8gS94I7AbcO5ZC1ifGFIdTH7VepE5TvmsveAM/Qxof pRFmregQiI4OVlGMVRaEsXPWVEHb4iOydbS71amkgEutZQoTJnt5YqC2/GsU43a2v9 qifg32sVM2et671WD8qlFX07qWFQ/zwiAQNDnrjcr5rgRNDDlUtU+u2mDHeZV3qB87 4hm8V0J386vlw== Received: from sofa.misterjones.org ([185.219.108.64] helo=goblin-girl.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t683z-008Fqw-8b; Wed, 30 Oct 2024 12:44:39 +0000 Date: Wed, 30 Oct 2024 12:44:38 +0000 Message-ID: <861pzx3gll.wl-maz@kernel.org> From: Marc Zyngier To: Ard Biesheuvel Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Ard Biesheuvel , Catalin Marinas , Will Deacon , Mark Rutland , Ryan Roberts , Anshuman Khandual , Kees Cook Subject: Re: [RFC PATCH 7/8] arm64/mm: Use reduced VA sizes (36/39/42 bits) only for user space In-Reply-To: <20241030101803.2037606-17-ardb+git@google.com> References: <20241030101803.2037606-10-ardb+git@google.com> <20241030101803.2037606-17-ardb+git@google.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/29.4 (aarch64-unknown-linux-gnu) MULE/6.0 (HANACHIRUSATO) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: ardb+git@google.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, ardb@kernel.org, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, ryan.roberts@arm.com, anshuman.khandual@arm.com, keescook@chromium.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Wed, 30 Oct 2024 10:18:11 +0000, Ard Biesheuvel wrote: > > From: Ard Biesheuvel > > The advantage of a reduced virtual address space size is its impact on > the number of translation levels, which affects TLB pressure. The > working set of translations covering the kernel side is negligible > compared to user space, where each process has its own set of page > tables, and so most of the same benefit can be obtained by reducing the > VA size only for user space. > > As a preparatory step towards implementing this, drop all the reduced VA > space sizes in Kconfig, and replace it with a configurable userland VA > space size that is reflected in TASK_SIZE. This will be taken advantage > of in a subsequent patch to actually reduce the number of translations > used by the MMU for translating user space virtual addresses. I think this may have an impact on KVM's walking of the userspace page tables to determine whether we are trying to install a block mapping, which assumes that the start level and the number of VA bits are the same as the kernel (see get_user_mapping_size()). Probably nothing too complicated, but something to look into. Thanks, M. -- Without deviation from the norm, progress is not possible.