Received: by 10.223.176.46 with SMTP id f43csp973388wra; Wed, 24 Jan 2018 08:40:08 -0800 (PST) X-Google-Smtp-Source: AH8x227OzO3dEUxu7zVjD8S7+wQGcr7dYwpvLU/jLIs7XLzxyuLCdAKjF7hasy1BG2yBKllqQu6F X-Received: by 2002:a17:902:7244:: with SMTP id c4-v6mr9086118pll.414.1516812008084; Wed, 24 Jan 2018 08:40:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516812008; cv=none; d=google.com; s=arc-20160816; b=hrGCwQsDdDEo97u67QdkBAsGY5bhlye8oIdULNWnkbADsKGVwReWKeTuv/9pSP4hbB qOwU78EZCZ0E1zgAqCOKQ90qGkcM0Bs8ZP6ecr9g65UG8iwt/7OGFhD9E9trxTk/iqww ZLLscm0HgZguN8EA2CtaC+3qpOH3JsYWtV2/E4X/R9UL2ywmX/1Uk5F+CvS8KeEbJEk9 DILC3CWnMmGhVbyHdJOsOW/NdepaJV6MPcEooCS06M5vbUXpVzjNkJRYpF38vo3nEDkp Rs4BWeX3+QE0XYcEmYWHQ76Mn6R/05zHyghwiDEGpZl+oPf98YpKw0yaj7b5mChx1qmg 5UzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=je41VtJSNUC7DGoByWuZlFudS+058BDRd6dhNUz0iec=; b=xLfrf1XqlO3B3InRyrMU/ii29GIDq6Fu/Z34tKXbnGzuQBH6uHgRhTcqxnEMtmt+kF EzMaftfP7fyvw+nedAWeDngCnzO2AvihFkhNFYcHE0EQoVvQdB9Jm0LRXAbnZSqqY7GI ghYE6FrUmIf7nWUnnpoFr1dIdqVv/6OKIvq+G6DW/2+ay9+zHoRpxdffUgFnOHs1TkGs dG857+G2dJ0iZzshK78QCtQ85aCnuPgvYYf0ZtigB0H5MjStvuAlv7o9fdrxRzQLZ11Z wJAH10K9SLNSDA20rmR3VZ7N3tzYGdpvqe6yHSjF6m/Bj9g6AgL0izgo8IYXpshz8B6i PzJQ== ARC-Authentication-Results: i=1; mx.google.com; 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 p12si336124pgd.256.2018.01.24.08.39.53; Wed, 24 Jan 2018 08:40:08 -0800 (PST) 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; 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 S934348AbeAXQgh (ORCPT + 99 others); Wed, 24 Jan 2018 11:36:37 -0500 Received: from mga05.intel.com ([192.55.52.43]:60263 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934225AbeAXQgf (ORCPT ); Wed, 24 Jan 2018 11:36:35 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jan 2018 08:36:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,408,1511856000"; d="scan'208";a="22000807" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga003.jf.intel.com with ESMTP; 24 Jan 2018 08:36:32 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 5F9ADD0; Wed, 24 Jan 2018 18:36:31 +0200 (EET) From: "Kirill A. Shutemov" To: Ingo Molnar , x86@kernel.org, Thomas Gleixner , "H. Peter Anvin" , Tom Lendacky Cc: Linus Torvalds , Borislav Petkov , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv3 0/3] x86/mm/encrypt: Cleanup and switching between paging modes Date: Wed, 24 Jan 2018 19:36:20 +0300 Message-Id: <20180124163623.61765-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patcheset is a preparation set for boot-time switching between paging modes. Please review and consider applying. Code around sme_populate_pgd() is unnecessary complex and hard to modify. This patchset rewrites it in more stream-lined way to add support of boot-time switching between paging modes. I haven't tested the patchset on hardware capable of memory encryption. v3: - Move all page table related functions into mem_encrypt_identity.c v2: - Rebased to up-to-date tip Kirill A. Shutemov (3): x86/mm/encrypt: Move page table helpers into separate translation unit x86/mm/encrypt: Rewrite sme_populate_pgd() and sme_populate_pgd_large() x86/mm/encrypt: Rewrite sme_pgtable_calc() arch/x86/mm/Makefile | 14 +- arch/x86/mm/mem_encrypt.c | 578 +------------------------------------ arch/x86/mm/mem_encrypt_identity.c | 563 ++++++++++++++++++++++++++++++++++++ arch/x86/mm/mm_internal.h | 1 + 4 files changed, 574 insertions(+), 582 deletions(-) create mode 100644 arch/x86/mm/mem_encrypt_identity.c -- 2.15.1