From patchwork Wed Jul 11 11:29:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 10519455 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 B500A603D7 for ; Wed, 11 Jul 2018 11:30:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B650526861 for ; Wed, 11 Jul 2018 11:30:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA47E28B76; Wed, 11 Jul 2018 11:30:57 +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 3C1ED26861 for ; Wed, 11 Jul 2018 11:30:57 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 47D4E6B027B; Wed, 11 Jul 2018 07:30:12 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 42D696B027C; Wed, 11 Jul 2018 07:30:12 -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 1C6FD6B027F; Wed, 11 Jul 2018 07:30:12 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id A3FA36B027C for ; Wed, 11 Jul 2018 07:30:11 -0400 (EDT) Received: by mail-ed1-f72.google.com with SMTP id x21-v6so5799753eds.2 for ; Wed, 11 Jul 2018 04:30:11 -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=T3QGkoqVmYU/Ik3arFPl16gs/wlKXKRo/S6Tr+sGIE80mw+EE7hs0sSAt0XYH+mmYE hs5VbFauOajhinFyxPqfS5/tCKFV9CYtUY6DzP8X0pz/KNd3l6/2W0oHo862CMPipqdA QuN8tY0g8+iGTcua1+frneJkYq8SEwfzpSvvAmRs8SVRMymEXivEe3u6uukp3wyRhcj/ mTLqIFyvit3Wpo7XA2fPZwGB3SC1+x81SHQSiBuDjwP65XFpGjc2Qj+6kVd85urpjtWk v0yBNt4E+fRcPz1EjgAF2/fPtHkX1fXo5rCFgt6j7Y9+ylHeO/hskFPTz0LdQDFoy22c DjgA== X-Gm-Message-State: AOUpUlHJKNRjyDCQw4expFnIu+vz3WdITNd8MhSSWK8280m7H8nJdnee 2aabOlrhgW7r/JjLIjneZvPg5cWw9fnwDvT/xmkFjNETEyHExu7BvC/28xOPxOgE3jcXUvzqJTv zbuUZ0LjaIStBP4lO2OQsomNz8C1jG/GNXpxisJJaBxuVDyso1aAQs5+ICoVc08qAmg== X-Received: by 2002:a50:8406:: with SMTP id 6-v6mr15969829edp.97.1531308611239; Wed, 11 Jul 2018 04:30:11 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+iWbTRJagONPhYT/VGXrNL4pSdzadttNNY0lX61ewy+bL6P5BVQp2m3CwIrii73tZ3B+N X-Received: by 2002:a50:8406:: with SMTP id 6-v6mr15969789edp.97.1531308610546; Wed, 11 Jul 2018 04:30:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531308610; cv=none; d=google.com; s=arc-20160816; b=krA9d0z95yBodzgdvmX/nR6326VHEHelkzs+uMtWqf5BAtWc/HkbdGJ+9QmhIL0Bqq oy6Rr0FreqphAaVS2JKq8EMObzUKJi9vwMnea3IdU5dAxwUTHgB6Wa/+/TRIiKAQSet+ NFf39iHd0+J0kettuA+V0giy9YKdkxMcoXB08NYP54uusdghl/tc51rUq9br8Bg3CoaZ jUu6dxixeCPmK2MgR8WeRBGU4iaRzN8kYk3pqzRhAeZIUamhoc6TRO7eQNd3eniTRqon MorKr8nvE5cUpz3CG0tKkyBvoH5ErqkdJps8Y6p2w/hmvdIm6losxH1eNN2ZM6JtCoGe JzNg== 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=BiITt+Q7nY6jECRa6aY4Cej6R+CCgp0ZwQg224R7izFav9rwC0A2Cfa1ebJnPTF066 PV6JbsTLpMdMdBq27Nm3ddFrHrHWv04h6x8V898Lr4v8ERe3Y2Kx3hEpXwNYtwnk5j7P SKCVUj5upLFsuKKo08Qilmm3Ws1qLEAyRQVClNXNQ+mPr2j+ASF8x0dyz/qd/e5hP3+9 2Y5OspanLcCl9dtzijoVrE8cPxGLe9rceAhN5fo+Kb9WDsxEEnSOeHB37MYxgd4a0r8r Cs9caZsRYDkZAYkx6D5Jod7D8ogvrn1pqBvmXlQzUzyLt0uRVGHWI8q4i8VQvJD9Dthf /eHA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@8bytes.org header.s=mail-1 header.b=ONiMJEu+; 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 k25-v6si6425045edf.84.2018.07.11.04.30.10 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 11 Jul 2018 04:30:10 -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=ONiMJEu+; 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 A3C4B8B7; Wed, 11 Jul 2018 13:30:02 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1531308602; bh=H6+XRgYKsec5YHvORG8P0AsgnpOKwYcNQ0i+yAmS8p0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ONiMJEu+/b9c3Qv72Me5KKGude0wN6gNaZWG5MXQ0Ez7CphBG+w0/mzC6Ce8jJ2es S1EmPAEYrwr3/RIgaSTo7HsL/7MZX1uT2sBfy/FYv21dMU7tWsBGRk0FUTxikAVsW2 gGLZfdTPTusjxCBv529RhKWTtvx2xn8ItMI4n8Yo+PyHXz/5Wf5YayPWLgJ5ac2jnI mpkWiJlYiUu7iiRKscr3QcfGtTR5DdTxHR5j/3EWDRMdaRVyqP/mjPsWbvFxIjQNkt d6Jcu7EeCQwCc3XAdi6XqI9aUO4SXIF1oZUUYdqukMv/CRA1t1mkwid79Thxy/KJRb HeoJUklwmalrA== 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, 11 Jul 2018 13:29:22 +0200 Message-Id: <1531308586-29340-16-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531308586-29340-1-git-send-email-joro@8bytes.org> References: <1531308586-29340-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