From patchwork Mon Jul 17 21:10:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9846245 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 AF7D660392 for ; Mon, 17 Jul 2017 21:21:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5BB827F91 for ; Mon, 17 Jul 2017 21:21:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D956628539; Mon, 17 Jul 2017 21:21:51 +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 3F57022B1F for ; Mon, 17 Jul 2017 21:21:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbdGQVV3 (ORCPT ); Mon, 17 Jul 2017 17:21:29 -0400 Received: from mail-bn3nam01on0076.outbound.protection.outlook.com ([104.47.33.76]:46539 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751500AbdGQVMC (ORCPT ); Mon, 17 Jul 2017 17:12:02 -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=i2LsUwfKGABIgpIEJSIO1B9HW1Oe/Jnb4TBVTGsGlTI=; b=McQxQl/ex+g2Mr9hS53x2OHQvQ/X33G2gA5rdN0nuxYL7041PC/gx8TOlweLgTnZ2A2w1VDV1Lej+7r4u4TAqLSI5Nt/xJZcslE2ryi0UGOWlJqh+q5ygx6Jo3977PiBkJMqata8MYD14oK9JEBYFRX/RcgGJKvmK1m51PtHLVU= 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:49 +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 17/38] efi: Update efi_mem_type() to return an error rather than 0 Date: Mon, 17 Jul 2017 16:10:14 -0500 Message-Id: <7fbf40a9dc414d5da849e1ddcd7f7c1285e4e181.1500319216.git.thomas.lendacky@amd.com> 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: ed5aa80b-03b3-4934-9e4f-08d4cd5872dd 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:cXVvQL/OhwMzhfAFnABM8yI6npfGiHZY9rBS3um6TBdCiNK6OZjSxylO2isJkRRmEObTDh+PdQyhSUbSXpGT50N/9v6i/krpJbQ5+bUuBEh92QXqKm+jKBsRhJGBSXNzsGJtUXQ3mcGeppzEcX2waGJzUBp8O9U232AXMoRCj7VCCjrIAuinGF+hlrigFEY91hL1OfPmH39uPDr/5T1P677vTyhCeeCMkjywUwBrbXYNh9Hb9n78YX934wt/lYjZ7SFjYSuzuM6rDTNEYZ18uzjO5ef8R+lIZgVPgXgEKTOddfumQ3BScWaozDniUc+8RPhXzE/jZfmk+X9r3jZxvBkr/u3mnElBVR6EearDVmx34YkzkVfQBh42Vr/p/JrpcJf/zx58ZeuoumW1d+er80BMb8BBeWsdkrdK+7+0iWOkij8+nN7BEV7Rva42Ggey0k6UXp+kI7BkPZKivRmgn6A5ROhMRapHMaZvS0XjSTbt7rBz5J3vTENHNdV2EMNu6aK8jXumLrG6yvsqCJ4YykBhTwt1feVEIqjQslH4KCKWeFyd1AKNGT3QW43CYAmyNamWmnMpDOLdDkO6FBj9U8bRk+Ij3EHgY7+LotUAA0akBhpfIKGnDLQy9pLsiskwyaNFm6MsbOwqSYNU3MzEo5Q7xAsMLuR7kRTKreN2x0hGhW9PbptWREAwmVreZGLw/O+QVFBCUysHK/BYz2F/hr1RymsN/U9CaW5cvEiE34s27njZO9gReYvdCwjVbOQeZqn/JinVS6r+VFQRawn3kA== X-MS-TrafficTypeDiagnostic: M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k1Wb2clWuIe92dWmGm7fA5le4c/8Uo6iPvK+cAchM7dSMDz9Zcc1yQuuGxi5VgU+qfJTuIhbTyZ7tu1oWBmZZWdFv3QZxuhKqVmKoztMMX/eIP65dWSv23nYWf X-Exchange-Antispam-Report-Test: UriScan:(236129657087228)(767451399110)(167848164394848); 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:IHYJfedK5hZ3ZrP+lSOi14ll4XemBd/jc2gnHNrpMV?= =?us-ascii?Q?ev0aZs53r0Pd9iJCn5KjwwHp/8t1LDtWIxL0qyf/7jCo+CU8MdgkFKLXbrcs?= =?us-ascii?Q?c1bMjfAuWmF8o5B6O6K9Z2gdW2AAXqPK548pQu50BWUMkigQPd6ejrtqTa5w?= =?us-ascii?Q?xBcx5JHei6UoUZa6b6aeLQe0ixM/6LcsgvM1A9crEk33EltqFanhfVZR3Xzk?= =?us-ascii?Q?tR6JsqguyzcdjO066fIAxTizNvfT+2YfwrhoMEJ9YFa+H64MJV0oWxYRaZS7?= =?us-ascii?Q?bXfVDRbGEj1trZmZhhdH+F56L2HmFgmyzsO1GIh+x0mBK+ud+BGq83cbWi0C?= =?us-ascii?Q?NOOPgxS60i4HYAQU3sk+OXbKr8RNue7ubk0dCz5gW9nF2JBA/64CYVg+HGfv?= =?us-ascii?Q?NflTVyg7FxukySCLU7K/Dode0tLpQ2BuJ2GoN9Sb8tiE6WYNHVF3yhddhb3s?= =?us-ascii?Q?Lxhq2PYY2xoddx3RTFPZprBOPPjz06/hr7KKYRiG54FTJsRK0dVG2cn3bUbn?= =?us-ascii?Q?e8shtjOMWEemrvpPN+rHCGwjaOAEhREBVMv4jZso8uqZBa02p5N7izr0PsNP?= =?us-ascii?Q?Q1ozXE4eU6GXK4veOW/mz3iE7uuyzqbV7cAJffLwAeHuwLnELzfw6uTZH3yj?= =?us-ascii?Q?L+41QZiDe3RE4qw4c15+FsEoxSk7d49zlAEFc5NjpkuK/Y13qsTG85wLSNOf?= =?us-ascii?Q?xatJpZUxud3tUvp0TVAwF+V6wvDOBOC4V40/6AokHttsGcsm6fOuxxWSnp8p?= =?us-ascii?Q?atziwUSg4Cckv81Bvx7XiWHD7TwV7+3R6CrspiCYa62RyFUhUYBRVgpjHna0?= =?us-ascii?Q?h7ev1A07n6/9VXvtodJOiybG5+WY073ph4VS2Sb9geUTCBgs0O4MD2N4F4ct?= =?us-ascii?Q?GULzpPspXhKgiapN9j1OlPDXAkWnQBzTZtE9sd8q67XjI79F2onNPH0N1twH?= =?us-ascii?Q?aThMZThUaZ1Kcopiji2GOvouS3bwnFn7bvSlX3a9TQreSDYiEPWco2pYYpjA?= =?us-ascii?Q?/rQHlyknItyfCuinoOlmbdIZoNlzSaZQqkDPW1/FGSieVWrllSPMlIxu1CAE?= =?us-ascii?Q?DT7e3elqotTHQRLrddPgigMSYQhQ/jBzWGBjstH8sEzPmbFdYUWe6K8R0QkC?= =?us-ascii?Q?K8FyKl/XMat6e06aBFhg5vQNzWLpjTb6WCwcxsxOwz4iK9Nccs+OMJB4OOcC?= =?us-ascii?Q?g/lxIOXKekqkHGPiHgA6taFMOVKI1Jsogfv3W05fBnIVbfOs6G/XLWci9lB3?= =?us-ascii?Q?xdyJJKNb1FqfW6dDtMmUOPVgpU7HzWdfctbim5SFgYshljodTtU+RU1anRnp?= =?us-ascii?Q?yOtxvOChTD51G0l303Qu0=3D?= X-Forefront-PRVS: 0371762FE7 X-Forefront-Antispam-Report: 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:DvTv8LhbdPussMRJ0E80PXZALMdeqRNVmJDHuZwph?= =?us-ascii?Q?A0u8/LU5QWDLhiYXAUpakqQtMlyFSUsF2m91XcFU0E6nel0eHM2UQukaVvub?= =?us-ascii?Q?uGHqAIux1mSz2s8g50LuYKpz3avgY2dHp2/6rBGyY8W4BFxO8JSA/mKMWUAh?= =?us-ascii?Q?OtZZIda0fXnbtHVwy+7sHDRKbhKsqMg3PlIwjY6LrSYlbzD2EL6Im5uvscpJ?= =?us-ascii?Q?hLrrdRV1M8apOxqGPedJnyUSNJwCx7w8isKvVhU75oBycPFno/s+DS64tRdq?= =?us-ascii?Q?xNoT0y3XzLx+Xtr9WbwPhMzWokJdOgH7CXvWT1tdF3KECJSW4lkfEizDKAMv?= =?us-ascii?Q?nHc2hFAV/LIOPI2yNyI6MyR9pRDAMML5RopGOMsX59htcHpMO2oaxOf9HDMy?= =?us-ascii?Q?oEbXvjSCtnrSXgEQjJdbImyV99miRKd5dOS4k6h3Y7cP3kdf55cL25PHDmIq?= =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fwo/7ecUPQU8xXOYQlOzZ//9PFFiRYy2y2lE?= =?us-ascii?Q?/ynUZG5GcBoMN3VJQ4Q2y2?= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 5:gTD7kMnTNB1dIzkwMElNcWp9/B9zYf44jwDMb7q1cBfe+s9mpMt+YErVw/m2Cy1bL5y2CTgrJMIlFq5fbTnN040sHpY11BBuiWxvhN3S8sFhGzwViNoJEGopDeOcRV2rY44wHTwEpGeDx77fymiXS9nntIytgpdV3C3GMm9WF4skwEZvOGAUoxl4ETBG9mHPeXSxRLMBkCRDJdjpsLMR1BEeoeYEfZi3Y25wzeEB7iby6I7wiYXc/AqxhYQbsjaB/JVKK2EWOiYypt6wk60aLHZbIlp/Kx91bKxo+qkDFnrUJI5dcBV4w/Vtw6vgcZ8HJzykeInftqyasJFuoLlcTurg0QW5mAs7+0q7FKxS9Hpl20WcctxLY6ean3lXgyePzZQtsom7A54UfQCpFWWbk7/2vbjU30zy/8umXZdLDo5iYgql+hkYtZdyRhvtuUcvAg5oYdh0oWEAjbHsjP03vp1EW4jn0G3lGH42UWf3I574/Y3yUaTsUfWkGywOb2wz; 24:r1UpOF3bzxsbEf24M2o85Sen/Poh1GWDSk0gYQSh/F3h7pc5K6vCqToln7nq7qecFCWtMNT9fZpHIVerAxvQPDYgDRcVi79XpsfDCZ8G7Qs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 7:GTBNihY5w/PkL69hTKUEAXvtT6zBqEigWTubM5LFmEvAl9kb21RVHbI2aaeNm3YK5hPselcJs2lAwPiRuUhLVBoKu6eCypCaCqHPnZRhPYlwVTpBcBXqNzqW9PR7Rb85AY5XrwEidmgNZh3OzyoO5VPIssHFmyqTXfGCsTOyhRxL5wJ5FGV9wpa3W+rX7X5g98O8ysfHJRbeK4vhOIe2i6wPtn2WhVAheF984B5Jwe7nH6jA4wpQ1WXJvR5avJICzkx74qs0P4Vwj8/Dkog4I4/fiFaEpw7joHwn0wGw9lPt58SjQPNVQku1e1irXNb1WSb5nFbr8JDACa9Yzk+eHFfeVajM+PDNQPejKHD9sJdO+OchGzOIJk8Z5DseYEuLHtkez0F82A3ypK9ua4wkeKHWQCQ+dN9954zTP2cho0jv0gu/mp7pdsmOUFpxTOsub4gDEAJls0Tt7v2xGYMl4X8FQoGOUkVsUQ/Bdknc9uh5aJU9uvkh5+1kcNIFmGlM1B2/Hcs7LSHYgqdrb/ghOYfU6ioSyt+ffLCj8wwHoPzuOXglye8oKnrdh1zmtpvlAqlqW3XOcd6a5wqaXBAnMuO6MY69KECWm2YcIhGQBUO/UmherdUxuIu+dYXxQS2MXSa2LKMjhQzkL+7mRJgwCq5jI7a2DlEUoq+1Ujd0ekF5H++mSXhiwBIZNM1Z0UyNzZHOXqtIVQapmOdz+IU6RjQcmnoTFEFhGmjgdiA+9LGqLC2MFi7413GX5Gi+loXiJxzHl2URQocDQ2bbuCdh6N1ausSlzTsoXu0pmYtXzK0= X-Microsoft-Exchange-Diagnostics: 1; MWHPR12MB1151; 20:TN7j8kb7GPYHZUKYDEOkZeYg4G277H5vms+lOSYrSL3AN82rqnWOhUtIANO1J27LTJO2DsP+f2qjYyO/vT56EARIVeDZ71fWqJnsIhpmgcTTIXcIl4FojrYMvPNXCrEozdffepaUR+KEjsdhwZdF2J8mUXNjYxDwXfgjpJ5TYKqV7hwJRiSK6eZUCWGGxNrE48YM3vovdCqgdLXFQqaEZWV/JzJ40eAQjVmw2y9F8HCvLgG4tu/7xBVFruhFcqW5 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jul 2017 21:11:49.9246 (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 The efi_mem_type() function currently returns a 0, which maps to EFI_RESERVED_TYPE, if the function is unable to find a memmap entry for the supplied physical address. Returning EFI_RESERVED_TYPE implies that a memmap entry exists, when it doesn't. Instead of returning 0, change the function to return a negative error value when no memmap entry is found. Reviewed-by: Matt Fleming Reviewed-by: Borislav Petkov Signed-off-by: Tom Lendacky --- arch/ia64/kernel/efi.c | 4 ++-- arch/x86/platform/efi/efi.c | 6 +++--- include/linux/efi.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c index 1212956..8141600 100644 --- a/arch/ia64/kernel/efi.c +++ b/arch/ia64/kernel/efi.c @@ -757,14 +757,14 @@ static void __init handle_palo(unsigned long phys_addr) return 0; } -u32 +int efi_mem_type (unsigned long phys_addr) { efi_memory_desc_t *md = efi_memory_descriptor(phys_addr); if (md) return md->type; - return 0; + return -EINVAL; } u64 diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index f084d87..6217b23 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -1035,12 +1035,12 @@ void __init efi_enter_virtual_mode(void) /* * Convenience functions to obtain memory types and attributes */ -u32 efi_mem_type(unsigned long phys_addr) +int efi_mem_type(unsigned long phys_addr) { efi_memory_desc_t *md; if (!efi_enabled(EFI_MEMMAP)) - return 0; + return -ENOTSUPP; for_each_efi_memory_desc(md) { if ((md->phys_addr <= phys_addr) && @@ -1048,7 +1048,7 @@ u32 efi_mem_type(unsigned long phys_addr) (md->num_pages << EFI_PAGE_SHIFT)))) return md->type; } - return 0; + return -EINVAL; } static int __init arch_parse_efi_cmdline(char *str) diff --git a/include/linux/efi.h b/include/linux/efi.h index 8e24f09..4e47f78 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h @@ -985,7 +985,7 @@ static inline void efi_esrt_init(void) { } extern int efi_config_parse_tables(void *config_tables, int count, int sz, efi_config_table_type_t *arch_tables); extern u64 efi_get_iobase (void); -extern u32 efi_mem_type (unsigned long phys_addr); +extern int efi_mem_type(unsigned long phys_addr); extern u64 efi_mem_attributes (unsigned long phys_addr); extern u64 efi_mem_attribute (unsigned long phys_addr, unsigned long size); extern int __init efi_uart_console_only (void);