Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7662646ybh; Thu, 8 Aug 2019 20:55:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqxLyk6uC+jkkjKNkFnR7D/oTr6pqrmHpEOfqYog5IJPuTTtyuP1SjPB/FzaHkzaZoiCaRKU X-Received: by 2002:a62:e806:: with SMTP id c6mr19342828pfi.158.1565322928893; Thu, 08 Aug 2019 20:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565322928; cv=none; d=google.com; s=arc-20160816; b=fkAD3F03hf2wVjtigaTBu3djacJfRrL09ot7s4bdaVqrUAouP01YA+TiOVFVDlfXEH 2mXRmXjEoNYAXCDIKr8Z9e0lihDngE82525r5aBolawaTiaBgBv30kHONFJ9jBhsbq1Y 86obhLbluXIrVvSMKuBtdlIF8HJhKWEJsXEJE5uCIxpFYDxTTjOoEZyjeJTXYHfnr8ue J0JA32SPrAM6Ugq9s9Rf5w0nYx33pGXjGJ5uQhNRnIWRiW9SmEsEGtLJh8oODyVaQxXm UaxyGwEptvrBuz1uq5L23BAsVJHyS0KE331aWHSaAkPBzFTTxFIMQYcKC8yCrIpYAF97 iHIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iuvsbUVR3JGHE/UbU0VbPCmgBNC5gqV92hG0GhCg0Zw=; b=ax9oLf1Nih6nRLLLCMwLs/aer9h6W11a8xzb4WhSo6pBq2X6estpiewfj9V8awfRqh wRurB2qOrt1UTT+fwkMe9agULVx29+b/GoCjG5Txi9yp+ODLdr1Q+AjQQVdmR4hRogLx 4P7NcAseNTEKid0JFrZCsjwel+wBd+7kksq9xGIycoAy5RkCOEkfPrk2QX05AMq+XuQa LqrsfiT6sy1077Nd/4qaSyV/rqFZ5gcNJKqgGdF3/cAcPGReGh7H6hoNHyQ1ApvTSWom VC3SqFjQ28F4bmOeJumLgd04ix9u9eae+uiWZfReQFvo04hx5FpCPXS9l3R8gicZZQFf VhOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="A/7UlikJ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si14142322pgg.368.2019.08.08.20.55.11; Thu, 08 Aug 2019 20:55:28 -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=@gmail.com header.s=20161025 header.b="A/7UlikJ"; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404960AbfHIDyd (ORCPT + 99 others); Thu, 8 Aug 2019 23:54:33 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:46494 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729307AbfHIDyd (ORCPT ); Thu, 8 Aug 2019 23:54:33 -0400 Received: by mail-pg1-f193.google.com with SMTP id w3so7949252pgt.13 for ; Thu, 08 Aug 2019 20:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:reply-to; bh=iuvsbUVR3JGHE/UbU0VbPCmgBNC5gqV92hG0GhCg0Zw=; b=A/7UlikJ1Ngdzc+LR6NvKkjsDJInRqrQv8W+m3osg3RxSKOBuV8fp6Wzwf2AeDNnVR 3oqczfprfuIGug1gTkQDbRF+aIyyFet+luhK9LIpWqnwuzFK5pbmB+AJ05Oi1DaX4IYn cd8tYwPmCUvtEkkJ3ceTyZaFJXuywvZZ2ImWsfl7Uc3kRSykgZjHS2oxwwwPHgC8qT79 QQUBSSEoCQ2DdBgVZZRjTct7uiuJ8MobJDlHUrO4NXi17NBhvHEBie3g4pQllKHopkjR EufZPn3jx3J5RsK6G4+hyqGF+qtBxRWw/AVV/IpMMyfcMqgfDqDenmkahPYNmJfN+27H wpzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=iuvsbUVR3JGHE/UbU0VbPCmgBNC5gqV92hG0GhCg0Zw=; b=ZInoVydqQEcYUIQlPWYg6mVgJCQYN+z2EVmku6wjGGjBnR4g2YTTFNn/0ibeKHsVnG 5GQETYpBz8lvaEWbc15umG6vP6a22ikIBP1ZASiwo9//VUNifIhVqEEv1jDPBK4LKeWF akZzgrSJkuFMdY9wYvjtN/kByqHgYfZ6ANL8J5RvbTj9uv9q3hvAcCJ2538X0znhlpxS 8l9nIq/N6jX/0FKYZrDJ1PcvEVRsw69/zR0UXGrXBtN10NuGNojJOU/G9Itk2wfUantZ pUxvZiNJ2FwBRonPZOs+wxIyANEKYVIGcdfCuoxg4eRNCnXpFk0WTYjgQsQqGAg4MQcd MOSg== X-Gm-Message-State: APjAAAWR/6qYN8BEyg7EyRg2ztNatv+gcU0VEjl01jvl5u7Gxmh4RPDf y3tVa8NfW8qNZWMC+U7/uOdcMWNz X-Received: by 2002:a65:60cd:: with SMTP id r13mr16103908pgv.315.1565322872123; Thu, 08 Aug 2019 20:54:32 -0700 (PDT) Received: from localhost (c-73-189-176-234.hsd1.ca.comcast.net. [73.189.176.234]) by smtp.gmail.com with ESMTPSA id h1sm125718786pfg.55.2019.08.08.20.54.31 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 08 Aug 2019 20:54:31 -0700 (PDT) From: Isaku Yamahata To: linux-kernel@vger.kernel.org, x86@kernel.org Cc: toshi.kani@hpe.com, fei1.li@intel.com, Isaku Yamahata Subject: [PATCH 0/3] x86/mtrr, pat: make PAT independent from MTRR Date: Thu, 8 Aug 2019 20:54:17 -0700 Message-Id: X-Mailer: git-send-email 2.17.1 Reply-To: isaku.yamahata@gmail.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make PAT(Page Attribute Table) independent from MTRR(Memory Type Range Register). Some environments (mainly virtual ones) support only PAT, but not MTRR because PAT replaces MTRR. It's tricky and no gain to support both MTRR and PAT except compatibility. So some VM technologies don't support MTRR, but only PAT. This patch series makes PAT available on such environments without MTRR. patch 1 and 2 are only preparation. no logic change, function rename (mtrr_ => mtrr_pat_ which is commonly used by both MTRR and PAT) and moving functions out from mtrr specific files to a common file. patch 3 is an essential patch which makes PAT independent from MTRR. Isaku Yamahata (3): x86/mtrr: split common funcs from mtrr.c x86/mtrr: split common funcs from generic.c x86/mtrr, pat: make PAT independent from MTRR arch/x86/Kconfig | 1 - arch/x86/include/asm/mtrr.h | 37 ++- arch/x86/include/asm/pat.h | 2 + arch/x86/kernel/cpu/common.c | 2 +- arch/x86/kernel/cpu/mtrr/Makefile | 2 +- arch/x86/kernel/cpu/mtrr/generic.c | 116 +-------- arch/x86/kernel/cpu/mtrr/mtrr.c | 211 +---------------- arch/x86/kernel/cpu/mtrr/mtrr.h | 8 +- arch/x86/kernel/cpu/mtrr/rendezvous.c | 324 ++++++++++++++++++++++++++ arch/x86/kernel/setup.c | 4 +- arch/x86/kernel/smpboot.c | 8 +- arch/x86/mm/Makefile | 3 + arch/x86/mm/pat.c | 99 +++++++- arch/x86/power/cpu.c | 2 +- 14 files changed, 479 insertions(+), 340 deletions(-) create mode 100644 arch/x86/kernel/cpu/mtrr/rendezvous.c -- 2.17.1