[PATCH V2 1/3] efi: Use efi_mm in x86 as well as ARM

2017-08-28 Thread Sai Praneeth Prakhya
proves code maintainability and readability. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Lee, Chun-Yi <j...@suse.com> Cc: Borislav Petkov <b...@alien8.de> Cc: Tony Luck <tony.l...@intel.com> Cc: Andy Lutomirski <l...@kernel.org> Cc: Mic

[PATCH V2 2/3] x86/efi: Replace efi_pgd with efi_mm.pgd

2017-08-28 Thread Sai Praneeth Prakhya
From: Sai Praneeth <sai.praneeth.prak...@intel.com> Since the previous patch added support for efi_mm, let's handle efi_pgd through efi_mm and remove global variable efi_pgd. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Lee, Chun-Yi <j...@suse.com> C

[PATCH V2 0/3] Use mm_struct and switch_mm() instead of manually

2017-08-28 Thread Sai Praneeth Prakhya
From: Sai Praneeth Presently, in x86, to invoke any efi function like efi_set_virtual_address_map() or any efi_runtime_service() the code path typically involves read_cr3() (save previous pgd), write_cr3() (write efi_pgd) and calling efi function. Likewise after

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-24 Thread Sai Praneeth Prakhya
On Tue, 2017-08-15 at 14:46 -0700, Andy Lutomirski wrote: > On Tue, Aug 15, 2017 at 12:18 PM, Sai Praneeth Prakhya > <sai.praneeth.prak...@intel.com> wrote: > > +/* > > + * Makes the calling kernel thread switch to/from efi_mm context > > + * Can be used from SetVir

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-23 Thread Sai Praneeth Prakhya
On Mon, 2017-08-21 at 08:23 -0700, Andy Lutomirski wrote: > > > On Aug 21, 2017, at 7:08 AM, Peter Zijlstra wrote: > > > >> On Mon, Aug 21, 2017 at 06:56:01AM -0700, Andy Lutomirski wrote: > >> > >> > >>> On Aug 21, 2017, at 3:33 AM, Peter Zijlstra

Re: [PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-15 Thread Sai Praneeth Prakhya
On Tue, 2017-08-15 at 14:46 -0700, Andy Lutomirski wrote: > On Tue, Aug 15, 2017 at 12:18 PM, Sai Praneeth Prakhya > <sai.praneeth.prak...@intel.com> wrote: > > +/* > > + * Makes the calling kernel thread switch to/from efi_mm context > > + * Can be used from SetVir

[PATCH 1/3] efi: Use efi_mm in x86 as well as ARM

2017-08-15 Thread Sai Praneeth Prakhya
proves code maintainability and readability. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Lee, Chun-Yi <j...@suse.com> Cc: Borislav Petkov <b...@alien8.de> Cc: Andy Lutomirski <l...@kernel.org> Cc: Michael S. Tsirkin <m...@redhat.com> Cc: Rica

[PATCH 3/3] x86/efi: Use efi_switch_mm() rather than manually twiddling with cr3

2017-08-15 Thread Sai Praneeth Prakhya
stolen by efi_mm) after the above calls return successfully. We can use efi_switch_mm() only with x86_64 kernel and "efi=old_map" disabled because, x86_32 and efi=old_map doesn't use efi_pgd, rather they use swapper_pg_dir. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.co

[PATCH 2/3] x86/efi: Replace efi_pgd with efi_mm.pgd

2017-08-15 Thread Sai Praneeth Prakhya
From: Sai Praneeth <sai.praneeth.prak...@intel.com> Since the previous patch added support for efi_mm, let's handle efi_pgd through efi_mm and remove global variable efi_pgd. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Lee, Chun-Yi <j...@suse.com> C

[PATCH 0/3] Use mm_struct and switch_mm() instead of manually

2017-08-15 Thread Sai Praneeth Prakhya
From: Sai Praneeth Presently, in x86, to invoke any efi function like efi_set_virtual_address_map() or any efi_runtime_service() the code path typically involves read_cr3() (save previous pgd), write_cr3() (write efi_pgd) and calling efi function. Likewise after

Re: [PATCH v2] x86/efi: Disable runtime services on kexec kernel if booted with efi=old_map

2017-05-16 Thread Sai Praneeth Prakhya
On Wed, 2017-05-17 at 09:57 +0800, Dave Young wrote: > Hi Sai, > On 05/16/17 at 06:14pm, Sai Praneeth Prakhya wrote: > > From: Sai Praneeth <sai.praneeth.prak...@intel.com> > > > > Booting kexec kernel with "efi=old_map" in kernel command l

[PATCH v2] x86/efi: Disable runtime services on kexec kernel if booted with efi=old_map

2017-05-16 Thread Sai Praneeth Prakhya
mething else is mapped at the virtual address we allocated for runtime service regions in the initial boot] - Matt Fleming Since kexec was never intended to work with efi=old_map, disable runtime services in kexec if booted with efi=old_map, so that we don't panic. Signed-off-by: Sai Praneeth Prak

Re: [PATCH] x86/efi: Fix kexec kernel panic when efi=old_map is enabled

2017-05-12 Thread Sai Praneeth Prakhya
On Fri, 2017-05-12 at 17:56 +0800, joeyli wrote: > On Mon, May 08, 2017 at 12:25:23PM -0700, Sai Praneeth Prakhya wrote: > > From: Sai Praneeth <sai.praneeth.prak...@intel.com> > > > > Booting kexec kernel with "efi=old_map" in kernel command line

[PATCH V2] x86/efi: Add EFI_PGT_DUMP support for x86_32, kexec

2017-05-11 Thread Sai Praneeth Prakhya
x86_64, so let's extend it to other efi configurations like kexec kernel, efi=old_map and to x86_32 as well. This doesn't effect normal boot path because this config option should be used only for debug purposes. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Borisl

Re: [PATCH] x86/efi: Add EFI_PGT_DUMP support for x86_32, kexec and efi=old_map

2017-05-11 Thread Sai Praneeth Prakhya
On Thu, 2017-05-11 at 13:18 +0200, Borislav Petkov wrote: > On Wed, May 10, 2017 at 03:49:05PM -0700, Sai Praneeth Prakhya wrote: > > From: Sai Praneeth <sai.praneeth.prak...@intel.com> > > > > EFI_PGT_DUMP, as the name suggests dumps efi page tables to dmesg during &g

[PATCH] x86/efi: Add EFI_PGT_DUMP support for x86_32, kexec and efi=old_map

2017-05-10 Thread Sai Praneeth Prakhya
x86_64, so let's extend it to other efi configurations like kexec kernel, efi=old_map and to x86_32 as well. This doesn't effect normal boot path because this config option should be used only for debug purposes. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Borisl

[PATCH] x86/efi: Fix kexec kernel panic when efi=old_map is enabled

2017-05-08 Thread Sai Praneeth Prakhya
ic in a regular kernel because it uses old_map_region() and not __map_region(). Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Cc: Borislav Petkov <b...@alien8.de> Cc: Ricardo Neri <ricardo.n...@intel.com> Cc: Matt Fleming <m...@codeblueprint.co.uk> Cc:

Re: [PATCH V2] x86/efi: Add missing 1:1 mappings to support buggy firmware

2017-03-20 Thread Sai Praneeth Prakhya
On Thu, 2017-03-16 at 11:47 +, Matt Fleming wrote: > On Tue, 28 Feb, at 07:25:34PM, Sai Praneeth Prakhya wrote: > > > > > > > > > > I don't think we should be adding yet another place in the EFI code > > > > where we're modifying the page tables.

[PATCH] x86/efi-bgrt: Fix kernel panic when mapping BGRT data

2015-12-10 Thread Sai Praneeth Prakhya
RAM regions and not I/O regions. We also delete efi_lookup_mapped_addr() because it is impossible to use it without also doing the page table switch to efi_pgd. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Reported-by: Wendy Wang <wendy.w...@intel.com> Cc: Matt Fle

[PATCH V2] x86/efi: Fix kernel panic when CONFIG_DEBUG_VIRTUAL is enabled

2015-10-16 Thread Sai Praneeth Prakhya
.org/r/5462999a.7090...@intel.com. So, before calling __pa() virtual addresses should be validated which results in skipping call to split_page_count() and that should be fine because it is used to keep track of everything *but* 1:1 mappings. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@

[PATCH] x86/efi: Fix kernel panic when CONFIG_DEBUG_VIRTUAL is enabled

2015-10-13 Thread Sai Praneeth Prakhya
ecause it is used to keep track of direct kernel mappings and not 1:1 mappings. Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prak...@intel.com> Reported-by: Dave Hansen <dave.han...@intel.com> Cc: Matt Fleming <matt.flem...@intel.com> Cc: Ricardo Neri <ricardo.n...@intel.

<    1   2