aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
authorDaniel Kiper <daniel.kiper@oracle.com>2014-06-30 13:52:58 -0400
committerMatt Fleming <matt.fleming@intel.com>2014-07-18 16:23:55 -0400
commit9f27bc543bdf92e179927037e2ab8ed0261579a9 (patch)
tree22ed05817b2d162f25ddb4fbb67495a8a40c3dd4 /drivers/firmware
parent67a9b9c53cafd3f391dccc84a3af45334c6267fc (diff)
efi: Introduce EFI_PARAVIRT flag
Introduce EFI_PARAVIRT flag. If it is set then kernel runs on EFI platform but it has not direct control on EFI stuff like EFI runtime, tables, structures, etc. If not this means that Linux Kernel has direct access to EFI infrastructure and everything runs as usual. This functionality is used in Xen dom0 because hypervisor has full control on EFI stuff and all calls from dom0 to EFI must be requested via special hypercall which in turn executes relevant EFI code in behalf of dom0. Signed-off-by: Daniel Kiper <daniel.kiper@oracle.com> Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/efi.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 023937a63a48..ac88ec05eb70 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -104,16 +104,19 @@ static struct attribute *efi_subsys_attrs[] = {
104static umode_t efi_attr_is_visible(struct kobject *kobj, 104static umode_t efi_attr_is_visible(struct kobject *kobj,
105 struct attribute *attr, int n) 105 struct attribute *attr, int n)
106{ 106{
107 umode_t mode = attr->mode; 107 if (attr == &efi_attr_fw_vendor.attr) {
108 108 if (efi_enabled(EFI_PARAVIRT) ||
109 if (attr == &efi_attr_fw_vendor.attr) 109 efi.fw_vendor == EFI_INVALID_TABLE_ADDR)
110 return (efi.fw_vendor == EFI_INVALID_TABLE_ADDR) ? 0 : mode; 110 return 0;
111 else if (attr == &efi_attr_runtime.attr) 111 } else if (attr == &efi_attr_runtime.attr) {
112 return (efi.runtime == EFI_INVALID_TABLE_ADDR) ? 0 : mode; 112 if (efi.runtime == EFI_INVALID_TABLE_ADDR)
113 else if (attr == &efi_attr_config_table.attr) 113 return 0;
114 return (efi.config_table == EFI_INVALID_TABLE_ADDR) ? 0 : mode; 114 } else if (attr == &efi_attr_config_table.attr) {
115 if (efi.config_table == EFI_INVALID_TABLE_ADDR)
116 return 0;
117 }
115 118
116 return mode; 119 return attr->mode;
117} 120}
118 121
119static struct attribute_group efi_subsys_attr_group = { 122static struct attribute_group efi_subsys_attr_group = {