From patchwork Wed Jul 18 09:40:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10531927 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A3D73602CA for ; Wed, 18 Jul 2018 09:43:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 900BA28FCD for ; Wed, 18 Jul 2018 09:43:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8320628FD5; Wed, 18 Jul 2018 09:43:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1281828FCD for ; Wed, 18 Jul 2018 09:43:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7C90E6B02B6; Wed, 18 Jul 2018 05:43:23 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 74E806B02B7; Wed, 18 Jul 2018 05:43:23 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5EFF76B02B8; Wed, 18 Jul 2018 05:43:23 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by kanga.kvack.org (Postfix) with ESMTP id F1C086B02B6 for ; Wed, 18 Jul 2018 05:43:22 -0400 (EDT) Received: by mail-ed1-f70.google.com with SMTP id v26-v6so1700551eds.9 for ; Wed, 18 Jul 2018 02:43:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=GeKJODt/lELI07uIv3YoFtxciyEQrxYNyviVxJiseOI=; b=qzZR8PgZdUGEA55fN6UMHYUtAu8e1afhxYRy66/iQqr6Y+71Iidtwps9uzbfYTDSxu lI/h0zzBt88xKksmS0Z4ubyAYAsEms7pkTvWXGfibiv1BcIqCy4Or4941sJqpKvpCWQF +G4buZuL8q4drmXwX2FDYs1u0XuqtoA0mufRkwyPr/a+j7r/vqJLLGKC0MjyNX6Cq23e qKO+baVy4y8P7HNMT0kFNKyY8gPe1nooC80rkic6J4Y0OoejMn9eIymHm+2EVCyIzCNQ /LEBmFZw8HWp3mj/Ijz6Kgm/GrJWI85pKA1DDwlVQH5RiAx0lriKjgvrQzpyHX5jV/vw cYUA== X-Gm-Message-State: AOUpUlGv+58VHKewIHuSSK6p7MYQk9ioanrXSJiKLyIqYQObpLL4DfE0 VTSDQ0mbvqE2oBmY3vIx82T0QAck/KAM3sM4ahdvZQgpFQP22JCFdfo0Z23HdMfHd6jflQNdpbn i4zj77VSFnhlOYOltVTglIAK+vf381pM64jE1T8QLy4a+n6EOoRvPegU1XWrzrRptOw== X-Received: by 2002:aa7:c4cf:: with SMTP id p15-v6mr6324910edr.240.1531907002551; Wed, 18 Jul 2018 02:43:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeRZZhBQJuCVf7eN76w+5S0xt72dm+C7y3BOMJOB/jmIj8thpc5mjS1+E1ZaknA3LXslvo8 X-Received: by 2002:aa7:c4cf:: with SMTP id p15-v6mr6318432edr.240.1531906889819; Wed, 18 Jul 2018 02:41:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531906889; cv=none; d=google.com; s=arc-20160816; b=BEIOhvJYj0KSkQn1MpYRBJomQhK64SgCw5HN3A+UB3jPV4PQ3nF1iYhb/Qd0deoa33 9Dtshs88rYs9g35JuGxXjxjkpV8zFtxXJZkmABAr9+1NJfjRfX8txIDb43r5oKfu3ZEn 5ZRTuQjY8ln6Lcj7PV5kHnh5pGAQ5WkaxVBkwmjA5/LzhIH9TVJj+liv8pbdtpZMJqoN awsRW49biZBJ0Ep+TZhXDg9CqvbVdUuuc5NCBxil2id/Wq+i38oisNhEaaWL8olNnlws GfCBWTL9CHiEubAXLneBXW9fIwLR0GdbtDxoIBtXo96cJczm7jwhb66kZgepQgTSf4/U lRlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=GeKJODt/lELI07uIv3YoFtxciyEQrxYNyviVxJiseOI=; b=k0cmpgq7l/wnt/k3zaQmuOa1HaR7+J1wlcQEEbCIgMAYv8+QIANhDPDxdCS152uwUj LSmJrslzyLVq5EbDq7MLdZMpyB75C1bBe4hzJNR+CA8oOgNLBP7PYfOrfgvMJ+2JCst8 NlTTgQ3lnBtNECiK869D0qAwu+xYtsdP85pzM+EuBMg3V90tyCuZ01QmysZtpBHgJeIl SYxGvfJc9m0QMTZYLMm0BJG+eLDRbXDVlmj11kbptvgG3GsJf0Lmgid7J9UKb5YdgOkB n26fdGFN2vMk3nIH8R6GEeY5nOi+W7hRSnzTxm/C6nPC0CRxnTzefOCrZFOJKv6mwgIc KSNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=DmUcK+RE; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: from theia.8bytes.org (8bytes.org. [2a01:238:4383:600:38bc:a715:4b6d:a889]) by mx.google.com with ESMTPS id y2-v6si1923555eda.263.2018.07.18.02.41.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jul 2018 02:41:29 -0700 (PDT) Received-SPF: pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) client-ip=2a01:238:4383:600:38bc:a715:4b6d:a889; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=DmUcK+RE; spf=pass (google.com: domain of joro@8bytes.org designates 2a01:238:4383:600:38bc:a715:4b6d:a889 as permitted sender) smtp.mailfrom=joro@8bytes.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=8bytes.org Received: by theia.8bytes.org (Postfix, from userid 1000) id C1B91325; Wed, 18 Jul 2018 11:41:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531906880; bh=H6+XRgYKsec5YHvORG8P0AsgnpOKwYcNQ0i+yAmS8p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DmUcK+RESwdsJ5tJVU4OT1FBremhqtEbuYdLsOMdPfmHRqOoUG8Mat8n2m/po2KzA i7CSJApCa+a9z8n/qTF+rlumAKIL8BAMoEJBfyFqg8EsX5QWhkekrU5K0JS2QnOimQ 23X+TRKntTJoupsonkGRPKXrGa6PJqikILBQ+iKiJ5lNFKGS9rpWCdC1leybyvYSBJ x0dDP4NoF5jR5xEjRfNqNSU8Ky0epMkNqhhLoh9UaqaOD5OqJ3MxJgh8bxD2YmDX8N zqx6pqpLq5M2GZBF2DrfApMNKJu8vdn7dop3YioKFVtE1kF1QZOChfeNe1jLNoB885 IJCnJ98Sy04KA== From: Joerg Roedel To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" Cc: x86@kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Linus Torvalds , Andy Lutomirski , Dave Hansen , Josh Poimboeuf , Juergen Gross , Peter Zijlstra , Borislav Petkov , Jiri Kosina , Boris Ostrovsky , Brian Gerst , David Laight , Denys Vlasenko , Eduardo Valentin , Greg KH , Will Deacon , aliguori@amazon.com, daniel.gruss@iaik.tugraz.at, hughd@google.com, keescook@google.com, Andrea Arcangeli , Waiman Long , Pavel Machek , "David H . Gutteridge" , jroedel@suse.de, joro@8bytes.org Subject: [PATCH 15/39] x86/pgtable: Rename pti_set_user_pgd to pti_set_user_pgtbl Date: Wed, 18 Jul 2018 11:40:52 +0200 Message-Id: <1531906876-13451-16-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531906876-13451-1-git-send-email-joro@8bytes.org> References: <1531906876-13451-1-git-send-email-joro@8bytes.org> X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel With the way page-table folding is implemented on 32 bit, we are not only setting PGDs with this functions, but also PUDs and even PMDs. Give the function a more generic name to reflect that. Signed-off-by: Joerg Roedel --- arch/x86/include/asm/pgtable_64.h | 12 ++++++------ arch/x86/mm/pti.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/pgtable_64.h b/arch/x86/include/asm/pgtable_64.h index 3c5385f..9406c4f 100644 --- a/arch/x86/include/asm/pgtable_64.h +++ b/arch/x86/include/asm/pgtable_64.h @@ -196,21 +196,21 @@ static inline bool pgdp_maps_userspace(void *__ptr) } #ifdef CONFIG_PAGE_TABLE_ISOLATION -pgd_t __pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd); +pgd_t __pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd); /* * Take a PGD location (pgdp) and a pgd value that needs to be set there. * Populates the user and returns the resulting PGD that must be set in * the kernel copy of the page tables. */ -static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) +static inline pgd_t pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd) { if (!static_cpu_has(X86_FEATURE_PTI)) return pgd; - return __pti_set_user_pgd(pgdp, pgd); + return __pti_set_user_pgtbl(pgdp, pgd); } #else -static inline pgd_t pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) +static inline pgd_t pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd) { return pgd; } @@ -226,7 +226,7 @@ static inline void native_set_p4d(p4d_t *p4dp, p4d_t p4d) } pgd = native_make_pgd(native_p4d_val(p4d)); - pgd = pti_set_user_pgd((pgd_t *)p4dp, pgd); + pgd = pti_set_user_pgtbl((pgd_t *)p4dp, pgd); *p4dp = native_make_p4d(native_pgd_val(pgd)); } @@ -237,7 +237,7 @@ static inline void native_p4d_clear(p4d_t *p4d) static inline void native_set_pgd(pgd_t *pgdp, pgd_t pgd) { - *pgdp = pti_set_user_pgd(pgdp, pgd); + *pgdp = pti_set_user_pgtbl(pgdp, pgd); } static inline void native_pgd_clear(pgd_t *pgd) diff --git a/arch/x86/mm/pti.c b/arch/x86/mm/pti.c index 4d418e7..f512222 100644 --- a/arch/x86/mm/pti.c +++ b/arch/x86/mm/pti.c @@ -117,7 +117,7 @@ void __init pti_check_boottime_disable(void) setup_force_cpu_cap(X86_FEATURE_PTI); } -pgd_t __pti_set_user_pgd(pgd_t *pgdp, pgd_t pgd) +pgd_t __pti_set_user_pgtbl(pgd_t *pgdp, pgd_t pgd) { /* * Changes to the high (kernel) portion of the kernelmode page