RE: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-27 Thread Prakhya, Sai Praneeth
> > Another follow on question is, does every firmware support both > > blocking and non-blocking variants (specially legacy EFI firmware)? I > > am worried about this because, presently efi_delete_dummy_variable() > > uses set_variable() and > > query_variable_info() but if I change efi_delete_dum

Re: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-27 Thread Ard Biesheuvel
On 27 May 2018 at 10:37, Prakhya, Sai Praneeth wrote: >> > One more question again, if we are sure that non-blocking variants >> > will _always_ be called in atomic context, then, we got it covered. >> > Because, in >> > set_variable() and query_variable_info() (both blocking and >> > non-blocking

RE: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-27 Thread Prakhya, Sai Praneeth
> > One more question again, if we are sure that non-blocking variants > > will _always_ be called in atomic context, then, we got it covered. > > Because, in > > set_variable() and query_variable_info() (both blocking and > > non-blocking) we check for in_atomic() and if so, we don't use efi_rts_w

Re: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-27 Thread Ard Biesheuvel
On 27 May 2018 at 07:32, Prakhya, Sai Praneeth wrote: >> > Assume some user requested to execute some non-blocking variant of >> > efi_rts and the kernel hasn't called efi_call_virt() yet, but was >> > scheduled out. IOW, even though user requests for non-blocking efi call, we >> might still block

RE: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-26 Thread Prakhya, Sai Praneeth
> > Assume some user requested to execute some non-blocking variant of > > efi_rts and the kernel hasn't called efi_call_virt() yet, but was > > scheduled out. IOW, even though user requests for non-blocking efi call, we > might still block. Am I right? > > > > No, that is the whole point. These f

Re: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-25 Thread Ard Biesheuvel
On 26 May 2018 at 01:08, Prakhya, Sai Praneeth wrote: >> > Changes from V3 to V4: >> > -- >> > 1. As suggested by Peter, use completions instead of flush_work() as the >> > former is cheaper >> > 2. Call efi_delete_dummy_variable() from efisubsys_init(). Sorry! Ard, >> > wa

RE: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-25 Thread Prakhya, Sai Praneeth
> > Changes from V3 to V4: > > -- > > 1. As suggested by Peter, use completions instead of flush_work() as the > > former is cheaper > > 2. Call efi_delete_dummy_variable() from efisubsys_init(). Sorry! Ard, > > wasn't able to find a better alternative to keep this change lo

Re: [PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-25 Thread Ard Biesheuvel
On 26 May 2018 at 00:05, Sai Praneeth Prakhya wrote: > From: Sai Praneeth > > Problem statement: > -- > Presently, efi_runtime_services() silently switch %cr3 from swapper_pgd > to efi_pgd. As a consequence, kernel code that runs in efi_pgd (e.g., > perf code via an NMI) will have

[PATCH V4 0/3] Use efi_rts_wq to invoke EFI Runtime Services

2018-05-25 Thread Sai Praneeth Prakhya
From: Sai Praneeth Problem statement: -- Presently, efi_runtime_services() silently switch %cr3 from swapper_pgd to efi_pgd. As a consequence, kernel code that runs in efi_pgd (e.g., perf code via an NMI) will have incorrect user space mappings[1]. This could lead to otherwise une