Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751932AbeAPWwI (ORCPT + 1 other); Tue, 16 Jan 2018 17:52:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:33408 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbeAPWwH (ORCPT ); Tue, 16 Jan 2018 17:52:07 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CA57420C0F Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=luto@kernel.org X-Google-Smtp-Source: ACJfBos6H0TNlZEB4M0+A3EV4if3GUiQIdlFqSqceFG3St2yWVELqMAFXf/RUdOBhmWFtANOh8V4dAeNrzUgK+rGknw= MIME-Version: 1.0 In-Reply-To: <20180116165213.GF2228@hirez.programming.kicks-ass.net> References: <1516120619-1159-1-git-send-email-joro@8bytes.org> <1516120619-1159-7-git-send-email-joro@8bytes.org> <20180116165213.GF2228@hirez.programming.kicks-ass.net> From: Andy Lutomirski Date: Tue, 16 Jan 2018 14:51:45 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 06/16] x86/mm/ldt: Reserve high address-space range for the LDT To: Peter Zijlstra Cc: Joerg Roedel , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , X86 ML , LKML , linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , "Liguori, Anthony" , Daniel Gruss , Hugh Dickins , Kees Cook , Andrea Arcangeli , Waiman Long , Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 16, 2018 at 8:52 AM, Peter Zijlstra wrote: > On Tue, Jan 16, 2018 at 05:36:49PM +0100, Joerg Roedel wrote: >> From: Joerg Roedel >> >> Reserve 2MB/4MB of address space for mapping the LDT to >> user-space. > > LDT is 64k, we need 2 per CPU, and NR_CPUS <= 64 on 32bit, that gives > 64K*2*64=8M > 2M. If this works like it does on 64-bit, it only needs 128k regardless of the number of CPUs. The LDT mapping is specific to the mm. How are you dealing with PAE here? That is, what's your pagetable layout? What parts of the address space are owned by what code?