Received: by 10.223.176.46 with SMTP id f43csp4433157wra; Tue, 23 Jan 2018 09:20:18 -0800 (PST) X-Google-Smtp-Source: AH8x226drZZKnSat7sv9rF6t6uQTitOWATEtXJDqFWGDV/7BEdkTSNA46ihARBdBQQwybH1qz+qp X-Received: by 10.36.9.208 with SMTP id 199mr4374408itm.86.1516728018209; Tue, 23 Jan 2018 09:20:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516728018; cv=none; d=google.com; s=arc-20160816; b=t6mudiM9mnGY7fNukpLkQt5yBtxspKKiqOenm0BuaqPBfTJckVE5e359ADvjrJheWZ BLrKAVEBVcFR2DbgjQXbsyTdNaXRjRzDXQbkjpna09+1O+ZF+aRNh9UtMy2LMW2LwgNE eP5y+SY8kNz+IhOSoY9SJPZKlneaODQDwMyPR1cRU5uXzIVljSF0Z/laN+xltWI5Yd0a IpcC7t6vpCc/pgmZOVEWMS14t+/DxoJdi4QKlYQYcrC3KCjHMb+q/c1GBsoqlSAIa6NN Z32lvUELUjWpR1MT/tdP3WcHeFdFFLB/lV+pH4OdGO5dj8UwsjL1FvHokhh/7UCxRFd5 nuzg== 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=iFg/JScloKnL4HIXxVRpe+T5KcEI2W8I41izQm/CVJ8=; b=sx+SIwq7yUsU1zFw66fn0u4s++3ZC5mTqCq2qfh0/rBxudV8mMUmZtu18dj6dWcFlG p4q8Jc3Aq1L0hsfqrmCkNEEtYcIkNUvGma+y92Fbc6EuB/nVsvwzs7BlqJMkPfQzQmWJ ir4np1hVgGSunS97DuoEh6NwwJBGojJPed4zVlBwoJAPL50iwtZ+EbEFgDLOSxqjvmq+ XQ67/l9cyq1YlgVPTp+fGjHu4m3CM8CmrDPqb8y2TZCHtGfYXAI3O/3ia2d3zZErAP/T 67bFdtbo1Zd+QeakPHT1U/WoIbYd2hprpwhmLcYlyg24QhGM/QNLCwSLZZkLNnUfMlxT VaHA== 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 k9si8405968ita.104.2018.01.23.09.20.04; Tue, 23 Jan 2018 09:20:18 -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 S1751779AbeAWRTg (ORCPT + 99 others); Tue, 23 Jan 2018 12:19:36 -0500 Received: from mga11.intel.com ([192.55.52.93]:28591 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751683AbeAWRTe (ORCPT ); Tue, 23 Jan 2018 12:19:34 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Jan 2018 09:19:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,402,1511856000"; d="scan'208";a="25725988" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 23 Jan 2018 09:19:16 -0800 Received: by black.fi.intel.com (Postfix, from userid 1000) id 4D796D0; Tue, 23 Jan 2018 19:19:15 +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: [PATCHv2 0/3] x86/mm/encrypt: Cleanup and switching between paging modes Date: Tue, 23 Jan 2018 20:19:07 +0300 Message-Id: <20180123171910.55841-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. v2: - Rebased to up-to-date tip Kirill A. Shutemov (3): x86/mm/encrypt: Move sme_populate_pgd*() 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 | 13 +-- arch/x86/mm/mem_encrypt.c | 171 +++---------------------------------- arch/x86/mm/mem_encrypt_identity.c | 118 +++++++++++++++++++++++++ arch/x86/mm/mm_internal.h | 14 +++ 4 files changed, 152 insertions(+), 164 deletions(-) create mode 100644 arch/x86/mm/mem_encrypt_identity.c -- 2.15.1