From patchwork Mon Jul 17 21:10:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9846133 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 C53BD60386 for ; Mon, 17 Jul 2017 21:11:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A1642624A for ; Mon, 17 Jul 2017 21:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F14A727F89; Mon, 17 Jul 2017 21:11:54 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 66DB32624A for ; Mon, 17 Jul 2017 21:11:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751846AbdGQVLf (ORCPT ); Mon, 17 Jul 2017 17:11:35 -0400 Received: from mail-bn3nam01on0071.outbound.protection.outlook.com ([104.47.33.71]:3344 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751771AbdGQVL0 (ORCPT ); Mon, 17 Jul 2017 17:11:26 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=/+Z7wdPBJfJ8E29P3tq00CWHBoiKhMeIdlGwMN9k1h0=; b=YpbqaEJA2r435BiUSoqHccy16350L8aYvbAnCpbyegIXVqZTvIbShoSSz9s0oSYvrWN14q9iYAOJMqEkK9E2DHYztMxEwvZ7DpuTHAa0f3rxt0L1l9xPQ2uhHbeLHmcCvsTSQfSN0qKeD4GYv7EJlOtySEMD+KmeqD4ZiG6QL+I= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; kernel.org; dmarc=none action=none header.from=amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.13; Mon, 17 Jul 2017 21:11:18 +0000 From: Tom Lendacky To: x86@kernel.org, linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, kvm@vger.kernel.org, kasan-dev@googlegroups.com Cc: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Arnd Bergmann , Jonathan Corbet , Matt Fleming , Konrad Rzeszutek Wilk , Andrey Ryabinin , Ingo Molnar , Borislav Petkov , Andy Lutomirski , "H. Peter Anvin" , Paolo Bonzini , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Rik van Riel , Larry Woodman , Dave Young , Toshimitsu Kani , "Michael S. Tsirkin" , Brijesh Singh Subject: [PATCH v10 09/38] x86/mm: Simplify p[g4um]d_page() macros Date: Mon, 17 Jul 2017 16:10:06 -0500 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR03CA0008.namprd03.prod.outlook.com (10.168.230.146) To MWHPR12MB1151.namprd12.prod.outlook.com (10.169.204.15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7447c43-3d21-47a2-b799-08d4cd58602e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 3:UuuNnfSuTN4Y4NPJHxFFdJffW3DMmlMzVUeTAoc/nYAZB49F0cqOUP3DMzh8DFjrXc/1XlY/28OYnGGeDEXmdU266XlUBGP12yHc+jXXSrmcpzBYc0G3zjjCJwd61RHodR9bWTeOnTCuSvTcRy/wmC3MQFFtgE86hknHDvmkyNEs81YrXc1LwUxgZ3qmBUbWM+gTS0Nv1guUY8VHG/h6iQYipFJCdTi397EzKaPQksYxPZ3Ra9DYViyn/VMzaBtUGpQqA4+7dS+YLfDEZ02OWfkGEnQUrK6uKJxDG5l6RKantPfEdeyKEWF8GighH74cyxSbzgL128bAIbkCR0Jkhjlq8KyVPpmazyFDcfuB2bhvBflZmeb0aKNP13N79uUiv1IaenENF7Y1XQ1FghA+S5oBBo0C4/Uaah5ODsxqYZf1k9/kfCYfh7yU2lt9FIqHtabk33Ejwg8cIcDYjWTqUrM39DZv39cWyAiqRDDjSQjocigGfIBJE4D1tBnOUAZ1s+GTTmBShz5co1E2u8sOeEzyxCzxTITVKiuuMPUIoeH//q6JrLgjfyz+a1ncmKZVza4dVlMgfDZgoGazuN7eoz/3zKdEWki5G0XBYuvCHiDc/0oN/NDwb0nQeDveNFAqWp1+BRbhRNn136kHVS9zA6fjkwadWMWUVvEd2zFWNngH1mZScmRxDw85chd5Z0r48ylroid649R72d3wtbOmdpgtI9JE1ymfyRyaBHUyd7/uqLyzmOvcYkYDSlbttRHYYId3+atPBWvRFkBltAfjsw== X-MS-TrafficTypeDiagnostic: MWHPR12MB1151: X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 25:fhcQUAWu9v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9ArkOP2M4quU2HvR0hP+pkO2+JQJN9h7XIZFsGf657iydyPhQjm9fxtBQLBP X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6055026)(6041248)(20161123558100)(20161123555025)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR12MB1151; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR12MB1151; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 4:Yq0mMaVCtRj2LGA2GHastX8+E1UXsYgh2+bd571ENN?= =?us-ascii?Q?K3mRawS/AAnV5k1mmjjQ8HH1Xk/NFGKsupzgcG4+gFs6yo8fr+oObsxjbKIs?= =?us-ascii?Q?KD4rZ4xJU3WbqVXy5IhFK5mdVSLJB7lTJHFWeOtmPp9wq6GSShcZY4gTkohC?= =?us-ascii?Q?17ZBBUYCNHcjVA04DXuwUO9uTyw0HFMceZNTJUY3vtAWA3Pgi7iDxy45vj1h?= =?us-ascii?Q?zM4FGJ3WF4+FfPFADPBVBU9p2XeMTM7q0sN6Bupi8+JzQ3BDhptUstOadM1f?= =?us-ascii?Q?3hZrGY2y21E0C/msvtlqLOW6RzWXAWNo78wQG5kWguCmYPu4L6JfT7av5963?= =?us-ascii?Q?psMR20ToVFUcUUf4HXRPj6xC6NRKNQCzZendRW6U7NWj8g892q4n4RlovY2C?= =?us-ascii?Q?hTuEPojirbwd0cw+uXPSKD8MwNXFmIKHtNh4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SFV:NSPM; SFS:(10009020)(4630300001)(7370300001)(6009001)(39410400002)(39850400002)(39840400002)(39860400002)(39400400002)(39450400003)(25786009)(6506006)(33646002)(54906002)(7416002)(76176999)(478600001)(8676002)(50986999)(6486002)(47776003)(5660300001)(189998001)(42186005)(38730400002)(305945005)(72206003)(53416004)(66066001)(50466002)(48376002)(110136004)(118296001)(2950100002)(81166006)(5003940100001)(3846002)(6666003)(36756003)(53936002)(7350300001)(6512007)(2906002)(7736002)(6116002)(86362001)(4326008)(50226002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1151; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 23:jBUEpvVWOsa9kEV3chvbE5LmgXkofZE7G+34ewK7B?= =?us-ascii?Q?2loPxVA/qhmqADXkrS/l2hZdKjCNxfb3AmEscQ3cqcJDS58N8FmH11klc/vw?= =?us-ascii?Q?ju7b3pmLu3hFoeJAjhAJWvovRP7hjkfn7UvTCIJf1eXQQZJlwcf0gFguTTqh?= =?us-ascii?Q?RcZtTu6UY2rv9GY3uixM5mAz5fF4s+CoX6eUb+jaFq1Eg22QC8MiwNKXqNiC?= =?us-ascii?Q?SicB4fBS+Ls2M/ZhcT6PVzSihB3J0Acza+YKdJ7brjkqzVYfPmirQe4VHSJu?= =?us-ascii?Q?vy171O+xvjmIYBjgpP14Et+UTmfVcokRWBDuT/z/qntW4K5OTwgb9RPw2eXb?= =?us-ascii?Q?LDVCk4J0XtDA1OPezX8sW15GVQDjoqyJ8/gpYx0BLeKea9KNhKVJly5IN7pk?= =?us-ascii?Q?HrYVWRGhjjHWV6TZqAL8IFnlQIj+fOSqBMqBV+7swECVfVRGh5wOj0Z2SrPu?= =?us-ascii?Q?ORItKFzz3z1k3ljlptEaQgvhUXh+F5OldZP/g/sStKngE8jPe0cFcRigQ/fy?= =?us-ascii?Q?zghVIzLKOknE7fHIf3/okLZI5kgPhiecDD+D6qzq1ZRJfcr3K3cUaHlVg6a3?= =?us-ascii?Q?vH2cBmIld/L/PS62OxxzfmHp29gfgiKNcQkVaY2IWD1tEWgJWFQEnjuGTRd2?= =?us-ascii?Q?AvJpi2DgxZ9ymJjMr1hLeIZqL/cE8roA2260No11Zx0g0jXqHaxaqtdjdNGk?= =?us-ascii?Q?aevwXjF4IsUH7KNJ1rigCCJvPBDvX+JNuWFxy5ToIXDqg5poibOHiuFdxnxd?= =?us-ascii?Q?izdyRqmb3V//vYbxbzewgQ65Coznvb4rrGS19gl+o6ykdVCEDPs9lvib0mxI?= =?us-ascii?Q?Wa88yp6suEDYRZV3PP3Xa5oOQRzC7P+cKKTjzcxvvQyc4DFwkCr4UwaMuavO?= =?us-ascii?Q?QL+2dmKxo2hifV3IdpKTkAWI1k5LRwnCFm4bwyu+AfpQ1WgZWY5EvysLV2sC?= =?us-ascii?Q?syui1Z5sRvsahwcNlBDh+FZzfo9pRe4nBlaMxedEPyzl57uNM4ihppKL2pz0?= =?us-ascii?Q?UJQK6uOdyySqkugA34IOge9+jn12k0cb5bEOWM6siOzcpV0onVfQoodu3X9t?= =?us-ascii?Q?WUwEJnc9mE7cBmQFahDbVEJqpKQxISYmvE6uKcOvWGJwlEL5qV7lcCiTRihr?= =?us-ascii?Q?UDWy0jGTikAVkNWv9JFfTXJRk91gnf0JEnBNBQay0F6t5eojUuVKBuYaNFY6?= =?us-ascii?Q?8dKWJxepJl/4M8=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR12MB1151; 6:5OZ452De4UIFBsa+4SdaAjudFkhKKPBG3UodGJWDsZ?= =?us-ascii?Q?/aidxOnOYQ/rLprP6auVQzvhhrl6fOyHZJ9gMuRH/Sr+RVOxIcAZ+2KVjeMY?= =?us-ascii?Q?6oyVKZaEZjQIFx66VJAX6LPhYmuIbcYppjqDmKUCnTfbDdi07TIHJY+2AKbK?= =?us-ascii?Q?TUebisQ8BE6ZnttlfMxX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Su/q/MwuPqqAuQB/9V/x/b8Q7D5uOirgNz51acUgSs1LiZpSSN1cw8xoeNUR4/61ZtqbkbQ4Mnb08X1ElNCS1qyCcYwVHB+qh/gUUz/DLu4IN7nblbHWHAxQs1YZcpBOG96C37+xuZeVQDRQCXSMFZWIDiPggfTMSk8LII0WTXTppTDhEUDdzACCPhU4xEb7EJS1p6PKlzWWy3iKDKeyO+T7vxZmwkKN41BfjOWlakTeqkBXev0zXFsChgamBmnZ2aMbn36wWUhQeRqNoNje+p4AdylwQYxZu51cLYNFbHl6jCngnwR4se1WCDHgl2uEGB5aU+DjN9AaZMGYE2dnsfV39/xECISWEXFH6tepyHD4SCJWAC5tbdLqNfQtfw3hwR3son+mO3KTXb3FxvdXvGSSc24BB7UnuJHQ2Py+AD4ALj/niefD3J1j4Y= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 20:XwG1j19dBQo4Y4GoAMZn+vukrHp5YBYQi1pJWmYbTMveY6vI28mIP8saNW+iiuyRUOghih/62xVInWD18Na2zh8fnCtU3g8TLB9dCGaybaYQU4AV1RG1ZJnzhVFOsb6uIO5cKvm1fbkZNCCYFh2sl7Sbfvhw/XTUJiFvqatcLNHNRp0XC+u7SZI+tozX/nfaqpGn29ehjcfTS5Q6i9Kq6LP1pXE9DvsbYdwxR4jX0kmtCjN/5K9EzB3fiVGK72yq X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 21:11:18.5213 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1151 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Create a pgd_pfn() macro similar to the p[4um]d_pfn() macros and then use the p[g4um]d_pfn() macros in the p[g4um]d_page() macros instead of duplicating the code. Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/x86/include/asm/pgtable.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h index 77037b6..b64ea52 100644 --- a/arch/x86/include/asm/pgtable.h +++ b/arch/x86/include/asm/pgtable.h @@ -195,6 +195,11 @@ static inline unsigned long p4d_pfn(p4d_t p4d) return (p4d_val(p4d) & p4d_pfn_mask(p4d)) >> PAGE_SHIFT; } +static inline unsigned long pgd_pfn(pgd_t pgd) +{ + return (pgd_val(pgd) & PTE_PFN_MASK) >> PAGE_SHIFT; +} + static inline int p4d_large(p4d_t p4d) { /* No 512 GiB pages yet */ @@ -704,8 +709,7 @@ static inline unsigned long pmd_page_vaddr(pmd_t pmd) * Currently stuck as a macro due to indirect forward reference to * linux/mmzone.h's __section_mem_map_addr() definition: */ -#define pmd_page(pmd) \ - pfn_to_page((pmd_val(pmd) & pmd_pfn_mask(pmd)) >> PAGE_SHIFT) +#define pmd_page(pmd) pfn_to_page(pmd_pfn(pmd)) /* * the pmd page can be thought of an array like this: pmd_t[PTRS_PER_PMD] @@ -773,8 +777,7 @@ static inline unsigned long pud_page_vaddr(pud_t pud) * Currently stuck as a macro due to indirect forward reference to * linux/mmzone.h's __section_mem_map_addr() definition: */ -#define pud_page(pud) \ - pfn_to_page((pud_val(pud) & pud_pfn_mask(pud)) >> PAGE_SHIFT) +#define pud_page(pud) pfn_to_page(pud_pfn(pud)) /* Find an entry in the second-level page table.. */ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address) @@ -824,8 +827,7 @@ static inline unsigned long p4d_page_vaddr(p4d_t p4d) * Currently stuck as a macro due to indirect forward reference to * linux/mmzone.h's __section_mem_map_addr() definition: */ -#define p4d_page(p4d) \ - pfn_to_page((p4d_val(p4d) & p4d_pfn_mask(p4d)) >> PAGE_SHIFT) +#define p4d_page(p4d) pfn_to_page(p4d_pfn(p4d)) /* Find an entry in the third-level page table.. */ static inline pud_t *pud_offset(p4d_t *p4d, unsigned long address) @@ -859,7 +861,7 @@ static inline unsigned long pgd_page_vaddr(pgd_t pgd) * Currently stuck as a macro due to indirect forward reference to * linux/mmzone.h's __section_mem_map_addr() definition: */ -#define pgd_page(pgd) pfn_to_page(pgd_val(pgd) >> PAGE_SHIFT) +#define pgd_page(pgd) pfn_to_page(pgd_pfn(pgd)) /* to find an entry in a page-table-directory. */ static inline p4d_t *p4d_offset(pgd_t *pgd, unsigned long address)