Received: by 10.223.164.221 with SMTP id h29csp2036085wrb; Thu, 2 Nov 2017 05:01:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+Qg2L8ogC9yDudRb63GXmGQRahbHRtn+3aGZ/CutGr17j6bB5KDeLzm1WwAyxrfvWGhL80U X-Received: by 10.99.114.92 with SMTP id c28mr3349798pgn.342.1509624117964; Thu, 02 Nov 2017 05:01:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509624117; cv=none; d=google.com; s=arc-20160816; b=uz803nBVbg4UZwGHJKuGF+CJiA+oSosfIhbnYnzlFK76358nLP/rE2T9yqaJ0MFf/h nQzlfL9cyxoSvttGxuFOS6Dw85enzMYES1hlQhio/aiMQdH92VTwhSxurLRJ6st5xXG3 2okeAdCRCqSvQlBoyt6C1HacYSqp/Y8fnt55emoSA/s8gkl2hrXNTIqMf3LRJJbiSbbF xHjCTs40h3kgjoOHUvTOPFzu59LrAYRsshfO4ez7054AEOQV8hUPV7wb96j6Z+WH+1Rz wvX0s9H9N49HzTEiyYrHU3f9tJnrN9EIOl7tIt4PG0jQh1BAcRrAh8A7bBtbINm99/YF CLZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature:arc-authentication-results; bh=C6TzXD0OcAGIqVkeY5nWdFm22Zy/UANaTDnSk+kGR44=; b=TJUpCw3h3Y3wZUfJ4ppzysuqY9LnZy+qqz5k99QdrSWs9mPHHq4YT97QJhHNvBLmgS LPDPBi/ha+YaN9GAqoOW///pfDnRWTj7DPXI/XvPFXpLUoXwoiVdZeMwr53AayyQM9eT ObL5+xkKFkbUFgXi1m4vkQWR5rkyWsD8rTYXo6WPHbrTVw75cRowyGHZoTfHaQRwjgGx rX2QYaY7a+gRp4kqqTHNhiDnKPOWkGzf4U8tC9fMf7SXjv7rP+Le2XnWqGMD+P1Da6HA ZDHJyxj2H7qY8jDKZKUtDkLPhOaoGGbm1lLZ+getQjujK3Rfr9K9jLjxKYzJTdMahkmB GATA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=q0G2UB3i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si3746065pfh.276.2017.11.02.05.01.43; Thu, 02 Nov 2017 05:01:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amacapital-net.20150623.gappssmtp.com header.s=20150623 header.b=q0G2UB3i; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754153AbdKBMAr (ORCPT + 96 others); Thu, 2 Nov 2017 08:00:47 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:44084 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751401AbdKBMAp (ORCPT ); Thu, 2 Nov 2017 08:00:45 -0400 Received: by mail-oi0-f65.google.com with SMTP id v132so8260655oie.1 for ; Thu, 02 Nov 2017 05:00:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=C6TzXD0OcAGIqVkeY5nWdFm22Zy/UANaTDnSk+kGR44=; b=q0G2UB3iVPvCxbbFCpEhIXNia5lgyTLZ/PHm+e+FpzYSndhaYPRUpQ+Jk4KsE0LWSu 4p0fpSCRKx3owzFrLy5vq3XkZJg5xC97TnYy9vThCKkfwAtXEm/Y0ZO5fzFsWPKv1DnK s4EuFx+en+0W3dHs6R8uqsydH2Cjv0dM4smXq0WSWLRZtRmdmQ+rZIHDU5CyDdZ+86kb 8PW14SfJR/xFItk3Ym6zbr0PrqTJorzKRP5bSACTAfsvra8cGnpbW99HcXnfCcR6qy7M 9+Znn4+Rc4QQY7fsB2jEb10FwGhl4rkfkeCxCjt8NJYJQQCpYKZxTSOsHo6tbt039Kdu /jBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=C6TzXD0OcAGIqVkeY5nWdFm22Zy/UANaTDnSk+kGR44=; b=LdfurNJq9JW+VjqMHyXH/z2rgl1XQzLo5Rt3XEHhYJOe4C2DL4CQB4S37btrGjosgp MA9aFIzS3RDnzlTfjOJvo6LLuyYzm23roJ84Kx7Owhl90VgkxLH9vbGWJNID7RcX+8pX lx4xuxBoHZ0wNQwabfRzUrb221k2tb3iFccLh4zq9IAB22MpE61Ba3xPu4d++8uHfTiS fMl55774hpCzLL6HTCCusvwyDu4PFAYzrKGwpbX1uqjpod5QcZQvN4UccG1TlqOg2sKK XdeAKjiH5EU5hgaE6a4z6eje/xe2v9iT2XzznoBQ76/jhSm6e1XpeCOAIqSPOMqW+ScY wkBA== X-Gm-Message-State: AMCzsaX7AWo0vOaMTc09dmy/5AXKNQp32YFE7VKgEI5LSOYnPJUAst3g Ud31gvsykZSaPgsxU+muuFQICA== X-Received: by 10.202.48.68 with SMTP id w65mr1635882oiw.95.1509624045133; Thu, 02 Nov 2017 05:00:45 -0700 (PDT) Received: from [100.146.139.33] ([172.56.7.221]) by smtp.gmail.com with ESMTPSA id u19sm1283834oiu.26.2017.11.02.05.00.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Nov 2017 05:00:44 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (1.0) Subject: Re: KAISER memory layout (Re: [PATCH 06/23] x86, kaiser: introduce user-mapped percpu areas) From: Andy Lutomirski X-Mailer: iPhone Mail (15A432) In-Reply-To: Date: Thu, 2 Nov 2017 13:00:33 +0100 Cc: Andy Lutomirski , Dave Hansen , "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , moritz.lipp@iaik.tugraz.at, Daniel Gruss , michael.schwarz@iaik.tugraz.at, Linus Torvalds , Kees Cook , Hugh Dickins , X86 ML , Borislav Petkov , Josh Poimboeuf Content-Transfer-Encoding: 7bit Message-Id: <89E52C9C-DBAB-4661-8172-0F6307857870@amacapital.net> References: To: Thomas Gleixner Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Nov 2, 2017, at 12:48 PM, Thomas Gleixner wrote: > >> On Thu, 2 Nov 2017, Andy Lutomirski wrote: >> I think we're far enough along here that it may be time to nail down >> the memory layout for real. I propose the following: >> >> The user tables will contain the following: >> >> - The GDT array. >> - The IDT. >> - The vsyscall page. We can make this be _PAGE_USER. > > I rather remove it for the kaiser case. > >> - The TSS. >> - The per-cpu entry stack. Let's make it one page with guard pages >> on either side. This can replace rsp_scratch. >> - cpu_current_top_of_stack. This could be in the same page as the TSS. >> - The entry text. >> - The percpu IST (aka "EXCEPTION") stacks. > > Do you really want to put the full exception stacks into that user mapping? > I think we should not do that. There are two options: > > 1) Always use the per-cpu entry stack and switch to the proper IST after > the CR3 fixup Can't -- it's microcode, not software, that does that switch. > > 2) Have separate per-cpu entry stacks for the ISTs and switch to the real > ones after the CR3 fixup. How is that simpler? > >> We can either try to move all of the above into the fixmap or we can >> have the user tables be sparse a la Dave's current approach. If we do >> it the latter way, I think we'll want to add a mechanism to have holes >> in the percpu space to give the entry stack a guard page. >> >> I would *much* prefer moving everything into the fixmap, but that's a >> wee bit awkward because we can't address per-cpu data in the fixmap >> using %gs, which makes the SYSCALL code awkward. But we could alias >> the SYSCALL entry text itself per-cpu into the fixmap, which lets us >> use %rip-relative addressing, which is quite nice. >> >> So I guess my preference is to actually try the fixmap approach. We >> give the TSS the same aliasing treatment we gave the GDT, and I can >> try to make the entry trampoline work through the fixmap and thus not >> need %gs-based addressing until CR3 gets updated. (This actually >> saves several cycles of latency.) > > Makes a lot of sense. > > Thanks, > > tglx From 1582954821286780302@xxx Thu Nov 02 11:49:17 +0000 2017 X-GM-THRID: 1582946879853551948 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread