Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp4353427imm; Mon, 20 Aug 2018 14:28:30 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaeG0utTM7lCGW5Itk1Or0yT9PbhOMSz/598iyh3L8a8EGv73JzDg1+TciH6VDVZm1zlcq8 X-Received: by 2002:a17:902:b947:: with SMTP id h7-v6mr509433pls.140.1534800510532; Mon, 20 Aug 2018 14:28:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534800510; cv=none; d=google.com; s=arc-20160816; b=bncNDXQQCp7EvhGI0yhK0oVGHr2ai3YYI5XesG0wIHYPl6pR3GEmJlCvB14Eu/55qa IoZTVU5cgcEFY0Tb83ioyAB6zwfY7+lGBhngcS6mtuwcg6RGhAM38Ao9PppcYGsJ8MIl DyuS4tbf7QTrlo0JCEHHE3mENHphP6CGKmpAZB0mhqGAXGVhOaafdRamhLNrP+QrYF6h /KGewIfLHtgc1WJei3+PRjeNxSMgU3VA6OoDaKqgKTS2huUwXc+sMMvl433tvHP+ZBcO WVbsOdeuYlwKnQ9bjV8MjfyW4DEm7nLWQXRwTDE06mIOAeIFdr2manNgftyxX7XBWmPy u1hg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=92DS7IVfrqhrKgQqQXDTE2nTprc0i3J+m5MoQhxoIy4=; b=M7ELCpmq3DkFEIOmLRpcoB+dYXQtBuDjtU9HvvTzgEgrTART0OE5QYHOOzpKDT+pYr oneY59gIsk5MP68k/Vl+9x0V5wTro6BrxXJnOq4JX/9LfiXkmAZl3aEFqFVtwXPjPrjQ 4U98gSh3SFkxuRku+TkfIu6ZYsuWZc4Y8yymfjepFcoV719hoX15G9RCDNwQx3W4rMYB +LjBlD3IzzsLQl1PMlaoy/ZCqTlnorLdhhUrS/wh55mHYFvFEbQmPwGGpw7rkQqtTCo+ 7nVb5wW/2NRmNrMfUpq6B8/207VqoYKHCxnKnNS5rcPWZYp4lmEczqHeQvEeYNSa7R7E RsjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=XTHvaRtV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5-v6si10223407pfg.36.2018.08.20.14.28.14; Mon, 20 Aug 2018 14:28:30 -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=@oracle.com header.s=corp-2018-07-02 header.b=XTHvaRtV; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726653AbeHUAny (ORCPT + 99 others); Mon, 20 Aug 2018 20:43:54 -0400 Received: from userp2120.oracle.com ([156.151.31.85]:47534 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbeHUAny (ORCPT ); Mon, 20 Aug 2018 20:43:54 -0400 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w7KLO0LD042833; Mon, 20 Aug 2018 21:26:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : mime-version : content-type; s=corp-2018-07-02; bh=92DS7IVfrqhrKgQqQXDTE2nTprc0i3J+m5MoQhxoIy4=; b=XTHvaRtVQf/y8DJvZYx7ENw/2RLmCJaXkT2E1TQm81Jyed53kZXC4aoyN58obHMLNnDY HuXjRVsLH7nRg3L5nmG/tVFZC9jDPX+FrwmAH4zZgZEDIl7F9o9Rszbt3A+OGG7r5lGH ZF8vEDdHS0B+gySqG7ZpeZJNeS4dMJ2puaTo1suAOybfy23750M4Cim1p0mzyYev8ljN VPlvIMWm5Zr3+RCDmxYhL470y+e7mNXQTXH97TAhkLlOwAnP3gB/TaCkN/7hvD76zeGU X4tkVgjfUuEP2OnNSY6fOHTVWUHxnDNgpbOa4OastBIL99/Zu+m3r5SDKb2liXlsYrwk kg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2kxc3qgvs7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Aug 2018 21:26:01 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w7KLPxUA003535 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Aug 2018 21:26:00 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w7KLPwiZ014182; Mon, 20 Aug 2018 21:25:58 GMT Received: from char.us.oracle.com (/10.152.35.101) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 20 Aug 2018 14:25:58 -0700 Received: by char.us.oracle.com (Postfix, from userid 1000) id 665FA6A010B; Mon, 20 Aug 2018 17:25:56 -0400 (EDT) Date: Mon, 20 Aug 2018 17:25:56 -0400 From: Konrad Rzeszutek Wilk To: kernel-hardening@lists.openwall.com, Liran Alon , Deepa Srinivasan , linux-mm@kvack.org, juerg.haefliger@hpe.com, khalid.aziz@oracle.com, chris.hyser@oracle.com, tyhicks@canonical.com, dwmw@amazon.co.uk, keescook@google.com, andrew.cooper3@citrix.com, jcm@redhat.com, Boris Ostrovsky , Kanth , Joao Martins , jmattson@google.com, pradeep.vincent@oracle.com, Linus Torvalds , ak@linux.intel.com, john.haxby@oracle.com, jsteckli@os.inf.tu-dresden.de Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de Subject: Redoing eXclusive Page Frame Ownership (XPFO) with isolated CPUs in mind (for KVM to isolate its guests per CPU) Message-ID: <20180820212556.GC2230@char.us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.8.3 (2017-05-23) X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8991 signatures=668707 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808200216 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! See eXclusive Page Frame Ownership (https://lwn.net/Articles/700606/) which was posted way back in in 2016.. In the last couple of months there has been a slew of CPU issues that have complicated a lot of things. The latest - L1TF - is still fresh in folks's mind and it is especially acute to virtualization workloads. As such a bunch of various folks from different cloud companies (CCed) are looking at a way to make Linux kernel be more resistant to hardware having these sort of bugs. In particular we are looking at a way to "remove as many mappings from the global kernel address space as possible. Specifically, while being in the context of process A, memory of process B should not be visible in the kernel." (email from Julian Stecklina). That is the high-level view and how this could get done, well, that is why posting this on LKML/linux-hardening/kvm-devel/linux-mm to start the discussion. Usually I would start with a draft of RFC patches so folks can rip it apart, but thanks to other people (Juerg thank you!) it already exists: (see https://www.mail-archive.com/linux-kernel@vger.kernel.org/msg1222756.html) The idea would be to extend this to: 1) Only do it for processes that run under CPUS which are in isolcpus list. 2) Expand this to be a per-cpu page tables. That is each CPU has its own unique set of pagetables - naturally _START_KERNEL -> __end would be mapped but the rest would not. Thoughts? Is this possible? Crazy? Better ideas?