* [PATCH] efi/arm64: store Runtime Services revision
@ 2014-08-14 14:55 Semen Protsenko
[not found] ` <1408028122-1784-1-git-send-email-semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Semen Protsenko @ 2014-08-14 14:55 UTC (permalink / raw)
To: matt.fleming-ral2JQCrhuEAvxtiuMwx3w, x86-DgEjT+Ai2ygdnm+yROfE0A
Cc: linux-efi-u79uwXL29TY76Z2rM5mHXA,
linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
leif.lindholm-QSEj5FYQhm4dnm+yROfE0A,
roy.franz-QSEj5FYQhm4dnm+yROfE0A,
ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A,
catalin.marinas-5wv7dgnIgG8, msalter-H+wXaHxf7aLQT0dZR+AlfA
"efi" global data structure contains "runtime_version" field which must
be assigned in order to use it later in Runtime Services virtual calls
(virt_efi_* functions).
Before this patch "runtime_version" was unassigned (0), so each
Runtime Service virtual call that checks revision would fail.
Runtime Services revision being passed in UEFI system table from UEFI
to kernel (see efi_entry() function). In UEFI it's being stored at
MdePkg/Include/Uefi/UefiSpec.h as EFI_RUNTIME_SERVICES_REVISION.
Signed-off-by: Semen Protsenko <semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
---
arch/arm64/kernel/efi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c
index e72f310..5dbb7bd 100644
--- a/arch/arm64/kernel/efi.c
+++ b/arch/arm64/kernel/efi.c
@@ -463,6 +463,8 @@ static int __init arm64_enter_virtual_mode(void)
efi_native_runtime_setup();
set_bit(EFI_RUNTIME_SERVICES, &efi.flags);
+ efi.runtime_version = efi.systab->hdr.revision;
+
return 0;
err_unmap:
--
2.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread[parent not found: <1408028122-1784-1-git-send-email-semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>]
* Re: [PATCH] efi/arm64: store Runtime Services revision [not found] ` <1408028122-1784-1-git-send-email-semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> @ 2014-08-15 6:10 ` Ard Biesheuvel 2014-08-26 9:05 ` Will Deacon 1 sibling, 0 replies; 6+ messages in thread From: Ard Biesheuvel @ 2014-08-15 6:10 UTC (permalink / raw) To: Semen Protsenko Cc: Matt Fleming, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, Leif Lindholm, Roy Franz, Catalin Marinas, Mark Salter On 14 August 2014 16:55, Semen Protsenko <semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> wrote: > "efi" global data structure contains "runtime_version" field which must > be assigned in order to use it later in Runtime Services virtual calls > (virt_efi_* functions). > > Before this patch "runtime_version" was unassigned (0), so each > Runtime Service virtual call that checks revision would fail. > > Runtime Services revision being passed in UEFI system table from UEFI > to kernel (see efi_entry() function). In UEFI it's being stored at > MdePkg/Include/Uefi/UefiSpec.h as EFI_RUNTIME_SERVICES_REVISION. > Could you drop the last line with the Tianocore path? Tianocore is just one of the many UEFI implementations the kernel should be compatible with, so where it happens to store this value is not entirely relevant. > Signed-off-by: Semen Protsenko <semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> Acked-by: Ard Biesheuvel <ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > --- > arch/arm64/kernel/efi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c > index e72f310..5dbb7bd 100644 > --- a/arch/arm64/kernel/efi.c > +++ b/arch/arm64/kernel/efi.c > @@ -463,6 +463,8 @@ static int __init arm64_enter_virtual_mode(void) > efi_native_runtime_setup(); > set_bit(EFI_RUNTIME_SERVICES, &efi.flags); > > + efi.runtime_version = efi.systab->hdr.revision; > + > return 0; > > err_unmap: > -- > 2.0.1 > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] efi/arm64: store Runtime Services revision [not found] ` <1408028122-1784-1-git-send-email-semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> 2014-08-15 6:10 ` Ard Biesheuvel @ 2014-08-26 9:05 ` Will Deacon [not found] ` <20140826090533.GA3193-5wv7dgnIgG8@public.gmane.org> 1 sibling, 1 reply; 6+ messages in thread From: Will Deacon @ 2014-08-26 9:05 UTC (permalink / raw) To: Semen Protsenko Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Catalin Marinas, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Thu, Aug 14, 2014 at 03:55:22PM +0100, Semen Protsenko wrote: > "efi" global data structure contains "runtime_version" field which must > be assigned in order to use it later in Runtime Services virtual calls > (virt_efi_* functions). > > Before this patch "runtime_version" was unassigned (0), so each > Runtime Service virtual call that checks revision would fail. > > Runtime Services revision being passed in UEFI system table from UEFI > to kernel (see efi_entry() function). In UEFI it's being stored at > MdePkg/Include/Uefi/UefiSpec.h as EFI_RUNTIME_SERVICES_REVISION. > > Signed-off-by: Semen Protsenko <semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> > --- > arch/arm64/kernel/efi.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c > index e72f310..5dbb7bd 100644 > --- a/arch/arm64/kernel/efi.c > +++ b/arch/arm64/kernel/efi.c > @@ -463,6 +463,8 @@ static int __init arm64_enter_virtual_mode(void) > efi_native_runtime_setup(); > set_bit(EFI_RUNTIME_SERVICES, &efi.flags); > > + efi.runtime_version = efi.systab->hdr.revision; > + > return 0; I doubt it makes any difference, but can we assign this before we call efi_native_runtime_setup please? Will ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20140826090533.GA3193-5wv7dgnIgG8@public.gmane.org>]
* Re: [PATCH] efi/arm64: store Runtime Services revision [not found] ` <20140826090533.GA3193-5wv7dgnIgG8@public.gmane.org> @ 2014-08-26 18:24 ` Matt Fleming [not found] ` <20140826182450.GA28116-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org> 2014-10-13 16:14 ` Sam Protsenko 1 sibling, 1 reply; 6+ messages in thread From: Matt Fleming @ 2014-08-26 18:24 UTC (permalink / raw) To: Will Deacon Cc: Semen Protsenko, matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Catalin Marinas, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Tue, 26 Aug, at 10:05:33AM, Will Deacon wrote: > > I doubt it makes any difference, but can we assign this before we call > efi_native_runtime_setup please? This would have to be a follow up patch, v2 of this patch is already in Linus' tree as commit 6a7519e81321. -- Matt Fleming, Intel Open Source Technology Center ^ permalink raw reply [flat|nested] 6+ messages in thread
[parent not found: <20140826182450.GA28116-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>]
* Re: [PATCH] efi/arm64: store Runtime Services revision [not found] ` <20140826182450.GA28116-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org> @ 2014-08-26 18:27 ` Will Deacon 0 siblings, 0 replies; 6+ messages in thread From: Will Deacon @ 2014-08-26 18:27 UTC (permalink / raw) To: Matt Fleming Cc: Semen Protsenko, matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Catalin Marinas, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org On Tue, Aug 26, 2014 at 07:24:50PM +0100, Matt Fleming wrote: > On Tue, 26 Aug, at 10:05:33AM, Will Deacon wrote: > > > > I doubt it makes any difference, but can we assign this before we call > > efi_native_runtime_setup please? > > This would have to be a follow up patch, v2 of this patch is already in > Linus' tree as commit 6a7519e81321. Ah, ok, I wouldn't worry about it then. I was just trawling the list for arm64 patches without me on CC in case I missed anything during the kernel summit. Thanks for picking it up! Will ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] efi/arm64: store Runtime Services revision [not found] ` <20140826090533.GA3193-5wv7dgnIgG8@public.gmane.org> 2014-08-26 18:24 ` Matt Fleming @ 2014-10-13 16:14 ` Sam Protsenko 1 sibling, 0 replies; 6+ messages in thread From: Sam Protsenko @ 2014-10-13 16:14 UTC (permalink / raw) To: Will Deacon Cc: matt.fleming-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org, x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, ard.biesheuvel-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, Catalin Marinas, leif.lindholm-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, roy.franz-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org, msalter-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org > I doubt it makes any difference It really does. The whole reason I made this patch is that I was unable to call UpdateCapsule() runtime service, because when you try to call it, kernel code first tests if we have UEFI with certain Runtime Services revision. In this code (drivers/firmware/efi/runtime.c): static efi_status_t virt_efi_update_capsule(efi_capsule_header_t **capsules, unsigned long count, unsigned long sg_list) { if (efi.runtime_version < EFI_2_00_SYSTEM_TABLE_REVISION) return EFI_UNSUPPORTED; return efi_call_virt(update_capsule, capsules, count, sg_list); } Condition is false, because efi.runtime_version == 0. The same stuff was happening about some other Runtime Services. So this patch just fixes this. > but can we assign this before we call efi_native_runtime_setup please? Yeah, it's quite late for this as patch is already upstreamed :) Anyway, if you could explain why it's essential -- I can make another patch moving this code to correct place. On 26 August 2014 12:05, Will Deacon <will.deacon-5wv7dgnIgG8@public.gmane.org> wrote: > On Thu, Aug 14, 2014 at 03:55:22PM +0100, Semen Protsenko wrote: >> "efi" global data structure contains "runtime_version" field which must >> be assigned in order to use it later in Runtime Services virtual calls >> (virt_efi_* functions). >> >> Before this patch "runtime_version" was unassigned (0), so each >> Runtime Service virtual call that checks revision would fail. >> >> Runtime Services revision being passed in UEFI system table from UEFI >> to kernel (see efi_entry() function). In UEFI it's being stored at >> MdePkg/Include/Uefi/UefiSpec.h as EFI_RUNTIME_SERVICES_REVISION. >> >> Signed-off-by: Semen Protsenko <semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> >> --- >> arch/arm64/kernel/efi.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c >> index e72f310..5dbb7bd 100644 >> --- a/arch/arm64/kernel/efi.c >> +++ b/arch/arm64/kernel/efi.c >> @@ -463,6 +463,8 @@ static int __init arm64_enter_virtual_mode(void) >> efi_native_runtime_setup(); >> set_bit(EFI_RUNTIME_SERVICES, &efi.flags); >> >> + efi.runtime_version = efi.systab->hdr.revision; >> + >> return 0; > > I doubt it makes any difference, but can we assign this before we call > efi_native_runtime_setup please? > > Will ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2014-10-13 16:14 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-14 14:55 [PATCH] efi/arm64: store Runtime Services revision Semen Protsenko
[not found] ` <1408028122-1784-1-git-send-email-semen.protsenko-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2014-08-15 6:10 ` Ard Biesheuvel
2014-08-26 9:05 ` Will Deacon
[not found] ` <20140826090533.GA3193-5wv7dgnIgG8@public.gmane.org>
2014-08-26 18:24 ` Matt Fleming
[not found] ` <20140826182450.GA28116-HNK1S37rvNbeXh+fF434Mdi2O/JbrIOy@public.gmane.org>
2014-08-26 18:27 ` Will Deacon
2014-10-13 16:14 ` Sam Protsenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox