[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen master] efi: do not use runtime services table with efi=no-rs



commit 534f9e29ce28580892b3856036b5e5cd805667cc
Author:     Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
AuthorDate: Wed Nov 20 17:10:59 2019 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Nov 20 17:10:59 2019 +0100

    efi: do not use runtime services table with efi=no-rs
    
    Before dfcccc6631 "efi: use directmap to access runtime services table"
    all usages of efi_rs pointer were guarded by efi_rs_enter(), which
    implicitly refused to operate with efi=no-rs (by checking if
    efi_l4_pgtable is NULL - which is the case for efi=no-rs). The said
    commit (re)moved that call as unneeded for just reading content of
    efi_rs structure - to avoid unnecessary page tables switch. But it
    neglected to check if efi_rs access is legal.
    
    Fix this by adding explicit check for runtime service being enabled in
    the cases that do not use efi_rs_enter().
    
    Reported-by: Roman Shaposhnik <roman@xxxxxxxxxx>
    Fixes: dfcccc6631 "efi: use directmap to access runtime services table"
    Signed-off-by: Marek Marczykowski-Górecki <marmarek@xxxxxxxxxxxxxxxxxxxxxx>
    Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>
    Release-acked-by: Juergen Gross <jgross@xxxxxxxx>
---
 xen/common/efi/runtime.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/xen/common/efi/runtime.c b/xen/common/efi/runtime.c
index 22fd6c9b53..8c2ece468d 100644
--- a/xen/common/efi/runtime.c
+++ b/xen/common/efi/runtime.c
@@ -211,6 +211,8 @@ int efi_get_info(uint32_t idx, union xenpf_efi_info *info)
         break;
     case XEN_FW_EFI_RT_VERSION:
     {
+        if ( !efi_enabled(EFI_RS) )
+            return -EOPNOTSUPP;
         info->version = efi_rs->Hdr.Revision;
         break;
     }
@@ -613,7 +615,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
             break;
         }
 
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !efi_enabled(EFI_RS) || (efi_rs->Hdr.Revision >> 16) < 2 )
             return -EOPNOTSUPP;
         state = efi_rs_enter();
         if ( !state.cr3 )
@@ -631,7 +633,7 @@ int efi_runtime_call(struct xenpf_efi_runtime_call *op)
         if ( op->misc )
             return -EINVAL;
 
-        if ( (efi_rs->Hdr.Revision >> 16) < 2 )
+        if ( !efi_enabled(EFI_RS) || (efi_rs->Hdr.Revision >> 16) < 2 )
             return -EOPNOTSUPP;
         /* XXX fall through for now */
     default:
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.