From patchwork Thu Feb 16 15:44:57 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Lendacky X-Patchwork-Id: 9577599 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 E5E1A60244 for ; Thu, 16 Feb 2017 15:51:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D704428612 for ; Thu, 16 Feb 2017 15:51:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CABCF2861F; Thu, 16 Feb 2017 15:51:16 +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 481D228612 for ; Thu, 16 Feb 2017 15:51:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932489AbdBPPpR (ORCPT ); Thu, 16 Feb 2017 10:45:17 -0500 Received: from mail-co1nam03on0083.outbound.protection.outlook.com ([104.47.40.83]:15777 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932276AbdBPPpL (ORCPT ); Thu, 16 Feb 2017 10:45:11 -0500 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=zBMxP116ZfhsCIgmj5Az0S4r2ep7WKwfKiMG5lxNw6U=; b=Ecca2mTPe1CCKCsZ+mUFdt3LlW5fE3teCeU7CnlXe5S5fY0aDl+iwAT9qEPcyVB8uPzbwEI3hB/BIBrZxiKVsOgtFGDZ2Vclj80yAI+bGh6oR4D1gK4y+dVM/iY0ryaP8+8eiyE6ATHhOgkfDgvXOcE/0NY1ob7mP6RsHoLuOC4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Thomas.Lendacky@amd.com; Received: from tlendack-t1.amdoffice.net (165.204.77.1) by BN6PR12MB1138.namprd12.prod.outlook.com (10.168.226.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.888.16; Thu, 16 Feb 2017 15:45:00 +0000 From: Tom Lendacky Subject: [RFC PATCH v4 13/28] efi: Update efi_mem_type() to return defined EFI mem types To: , , , , , , , , CC: Rik van Riel , Radim =?utf-8?b?S3LEjW3DocWZ?= , Toshimitsu Kani , Arnd Bergmann , Jonathan Corbet , Matt Fleming , "Michael S. Tsirkin" , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Brijesh Singh , Ingo Molnar , Alexander Potapenko , Andy Lutomirski , "H. Peter Anvin" , Borislav Petkov , Andrey Ryabinin , Thomas Gleixner , Larry Woodman , Dmitry Vyukov Date: Thu, 16 Feb 2017 09:44:57 -0600 Message-ID: <20170216154457.19244.5369.stgit@tlendack-t1.amdoffice.net> In-Reply-To: <20170216154158.19244.66630.stgit@tlendack-t1.amdoffice.net> References: <20170216154158.19244.66630.stgit@tlendack-t1.amdoffice.net> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: CY4PR13CA0013.namprd13.prod.outlook.com (10.168.161.151) To BN6PR12MB1138.namprd12.prod.outlook.com (10.168.226.140) X-MS-Office365-Filtering-Correlation-Id: e067d8aa-7614-4797-36aa-08d45682c5c2 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL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RFrFyNRukdckPoQyDflC0ha6bnUvEKSeqHXzR9yHegZK6CWvJxfN8qe23WUwvkEazskcg7AE06Qhir2YdE3Ydf8v/xKx1DYpRo7cQ3A==; 20:rBuKEApJp5WVwJtPXYsMzOTRatvhT+apKbNQguFHZolFDj48/JlU7H1JHLPHOIKqRC0gGy2vpb228I3DMwbifOz4cbYZqVfdM1H6XRGSVQFCNdIgDkEMm4g3Y/JNlEquYJFYF1KaF/HELUxvdqx1Gp1P9nuQ8oOKS/8ZjzUb1lex9+RMjOTqz4Ou8ELJ+HGNjomWkXIfs9VdtCUJFoKzpcLbzslv6N7BIrxA18++SQZDeGIKxdXK44nv9IuvAJdnRwi47nCTFevlucv9ms6KDwX6FEiVMfg6rR7TALa7PQylR5Ep+HcHIGpq/YxtGl0LdSGU6nAiVkG7JISWbpvoqwktJ6TK95BETZBhz+KTp/4jjwwF/YsLrNhYJD4j9h7y8xzTSz1Y7QeeGBT7279Jws7bfgbAHT577D0//PeG/dbhtoAezHZ9gUuhgIRvFADzN+qqTiZPHoy2kmRLtiGozrgLf0b4jQ978wDExV7p/SEXgQMcMvVGdHk7IWlSQWjQ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123564025)(20161123560025)(20161123555025)(20161123558025)(6072148); SRVR:BN6PR12MB1138; BCL:0; PCL:0; RULEID:; SRVR:BN6PR12MB1138; X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 4:JZsJw0/kJ7U11gPh8vFfHAVaQTGhfxB0KnvGbREBIRpHpYV/6znGSxJ8ljOfPkcbgqqaTjmt/iAsvA4HEUQPCjOFe88e7Ppn/TbaI2a1l7x7kDyj79sNknCJ4CvjaI0LZGxmUcyFLyb4D7xuAHVUNIUu5SdEV53/B5NDTI8ErtX1AxZxuQicOZffqUV/UZIbvjqNw0XH/90AxMomywp9MxejoBg9WU3qDKiLYg6ybfQ0KmujWabUVJe3LmllcEhrzSghba1xfC+6ms/t3bE5YqmyX9xXEjm31G3VCb8jXcJ68rN1moRcSgcBcCBpLgKc5H8Mdrs9eJ15vpzfood5YDBDFV5C6ejNMzGc/WodI50k6v6BBrONAJy4hHf91O+sxWHa6JN6F1SCWhzAawEiJ358IUiC7b01bnpEIwwx6oLGFBxxJssF4225MO756fYytuolTqAtbalMvd6iSLmMCoEbgucn339n0gN5coAOBngTYcgwUlkIfa3H3qvrVS/AZZdiaCEQeQ8Q0LlvmgZTwpX/DyHUZpXLmnKJ1sglIJnFNDxo+tv7PmtNmxjxKmSyDW/SJTre/u4HoieKUPHYGjl0T7G5B+q03EKEaDSmWx/8Qv361l6jXPv6VwNfpmsIZwyuR8iLrwyZGSmOiDp5RmIzQpiT+XieNm6sjPlhqvM= X-Forefront-PRVS: 0220D4B98D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(4630300001)(6009001)(7916002)(39860400002)(39450400003)(39840400002)(39410400002)(39850400002)(199003)(189002)(5660300001)(7736002)(305945005)(7416002)(33646002)(6666003)(101416001)(83506001)(42186005)(68736007)(23676002)(106356001)(2950100002)(69596002)(53416004)(389900003)(189998001)(50986999)(15650500001)(76176999)(54356999)(4001350100001)(105586002)(103116003)(97736004)(25786008)(2201001)(55016002)(81156014)(86362001)(66066001)(9686003)(1076002)(81166006)(6116002)(4326007)(2906002)(3846002)(8676002)(54906002)(47776003)(53936002)(50466002)(38730400002)(92566002)(6506006)(97746001)(230700001)(71626007)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1138; H:tlendack-t1.amdoffice.net; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtCTjZQUjEyTUIxMTM4OzIzOnJuYmxoNj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zB6U3FxVlBVN3ZYdUFYQWlnK0J6MXdEcmNuQ2FtN1JzUUxlL240c1Fw?= =?utf-8?B?NXN1Ym9QbDArS0RtUmNmS1F4SG50MkRTa1BaUmYvMHJORnpicURlU3BKWmIv?= =?utf-8?Q?WEB6VABvx3Guv2H1YkT45bp8sUBhF4=3D?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 6:vR92nztQp+uoxFeJs3Bek/ueUcBhWhuXslq9eF3DrSVxe8QjGjTlTwsMcoM8hy/+ycQv56dXiKImOo3uDNKCICsx7LbDak/m2isUiUG0egD7cmJo2aThJgPavUpM3zwds+LYsRbfeFcps+/Jrudf6AQkl1z6XO2d6vEECmTgHr2nyctZCDjAySGZbCOCF0nDL9niLrs7WdBzAkJ9PfvudtIsgwu+gQaETodWm9daIoA6+4FGA+OObf5c3DyMc9V7TymTcEMo/87qbb82gAMqkZcDXpbz9Ho1R1FObSJ1HgnqEc1dYLR6y5vJ3aai1UtI4jwBD6xbcFALIb7Ukr+0hoF3g5JF7Lke+gs3UenQAe8WoYFDaZSiEue2cuuoJ/c9/hJUFu9GlxoC04zAMawKbrAfx1WWF+uJsTsF1kMyBdo=; 5:5x/7W9GDVLEykTqXkRMzJYgSICtBvozMoGeDH01yIh8EVu9z6MDLhL/Uh13Um09GR28l5NODAxhZI+Smunttf81meNPtDsH8iLjGaAYPfbaDsn7Zv3rjAEvsmc0M5A+VMDtUwBMg0HzdF286J43SAA==; 24:VLhCvHdKL3KtQaUdofv67XCLlY/ZiicoaitwEsCUV87U1BUnA5pszGlxhnzqP9OVAoW9o8S/MlpwFC7dAvNNYMAqxlHcv4ekkrM9UeirY2o= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1138; 7:y9JLitZ5c/MoXhH+CEGcgqYHZXNTc6qPk13NDGgzCNgu7D8uOU3LTAe0+QAqk0jMPaQYBqjRNoGFb3D2PQZ20/mNW2lZf/MFoGecpZ1B0mGw4i9KuhU+brZT5SnRJ8AiqAcduBeMScn+5f6sXGdApLcAy0JBOrzBNbRkqTjwBxpRR08Gx/pA+kAaqK5ot+MXt0zUSCVHqi2nSaqnVclfGMui3FlCHsNBt2tjXMO86w0WJ98C+mb9Mq5k62uRduhQ7bKG74vW633Q9FxuTVgQwpGucSvhVlc6CHVqJ/eZxthPbvLkBLfGeUHOrLHAHp3sr782Y+W1BBgvoL2C1QQw9A==; 20:G6MgnhPlDcqmVk4jVAP8VMGdYsUM6I984HFd/+CZGZhXrFUclYHC8Ca14laRAD1yJfv2Zr2Lb/gaDput1hJJ8yv+Ovzmo38K4h9cbCV8FqjTqlfenPvBBPTO3rewl7aWdpSAJiquOWcr+D5y4pz6TN+GmDNWjH6he5k9LkE2fuAL7ar8Wa1BbdetF1M71+vK75Sw3aEuVC2frd3p+XYbJ9KQUDOl+ttFVuKTaxJZo7N5hv19yCa6jVSHl0QHn0xX X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2017 15:45:00.2966 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1138 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Update the efi_mem_type() to return EFI_RESERVED_TYPE instead of a hardcoded 0. Signed-off-by: Tom Lendacky --- arch/x86/platform/efi/efi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c index a15cf81..6407103 100644 --- a/arch/x86/platform/efi/efi.c +++ b/arch/x86/platform/efi/efi.c @@ -1037,7 +1037,7 @@ u32 efi_mem_type(unsigned long phys_addr) efi_memory_desc_t *md; if (!efi_enabled(EFI_MEMMAP)) - return 0; + return EFI_RESERVED_TYPE; for_each_efi_memory_desc(md) { if ((md->phys_addr <= phys_addr) && @@ -1045,7 +1045,7 @@ u32 efi_mem_type(unsigned long phys_addr) (md->num_pages << EFI_PAGE_SHIFT)))) return md->type; } - return 0; + return EFI_RESERVED_TYPE; } static int __init arch_parse_efi_cmdline(char *str)