From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965383AbcFMMfF (ORCPT ); Mon, 13 Jun 2016 08:35:05 -0400 Received: from mail-wm0-f51.google.com ([74.125.82.51]:35154 "EHLO mail-wm0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964997AbcFMMfB (ORCPT ); Mon, 13 Jun 2016 08:35:01 -0400 Date: Mon, 13 Jun 2016 13:34:52 +0100 From: Matt Fleming To: Tom Lendacky Cc: Borislav Petkov , Leif Lindholm , Mark Salter , Daniel Kiper , linux-arch@vger.kernel.org, linux-efi@vger.kernel.org, kvm@vger.kernel.org, linux-doc@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org, kasan-dev@googlegroups.com, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Radim =?utf-8?B?S3LEjW3DocWZ?= , Arnd Bergmann , Jonathan Corbet , Joerg Roedel , Konrad Rzeszutek Wilk , Paolo Bonzini , Ingo Molnar , "H. Peter Anvin" , Andrey Ryabinin , Alexander Potapenko , Thomas Gleixner , Dmitry Vyukov , Ard Biesheuvel Subject: Re: [RFC PATCH v1 10/18] x86/efi: Access EFI related tables in the clear Message-ID: <20160613123452.GB2658@codeblueprint.co.uk> References: <20160426225740.13567.85438.stgit@tlendack-t1.amdoffice.net> <20160510134358.GR2839@codeblueprint.co.uk> <20160510135758.GA16783@pd.tnic> <5734C97D.8060803@amd.com> <57446B27.20406@amd.com> <20160525193011.GC2984@codeblueprint.co.uk> <5746FE16.9070408@amd.com> <20160608100713.GU2658@codeblueprint.co.uk> <57599668.20000@amd.com> <20160613120322.GA2658@codeblueprint.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160613120322.GA2658@codeblueprint.co.uk> User-Agent: Mutt/1.5.24+41 (02bc14ed1569) (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 13 Jun, at 01:03:22PM, Matt Fleming wrote: > > Would we need a new function? Couldn't we just have a new > FIXMAP_PAGE_* constant? e.g. would something like this work? > > --- > > enum memremap_owner { > KERNEL_DATA = 0, > BOOT_DATA, > }; > > void __init * > early_memremap(resource_size_t phys_addr, unsigned long size, > enum memremap_owner owner) > { > pgprot_t prot; > > switch (owner) { > case BOOT_DATA: > prot = FIXMAP_PAGE_BOOT; > break; > case KERNEL_DATA: /* FALLTHROUGH */ > default: > prot = FIXMAP_PAGE_NORMAL; > > } > > return (__force void *)__early_ioremap(phys_addr, size, prot); > } Although it occurs to me that if there's a trivial 1:1 mapping between memremap_owner and FIXMAP_PAGE_* we might as well just add a new early_memremap_boot() that uses the correct FIXMAP_PAGE_* constant, akin to early_memremap_ro().