Re: [Xen-devel] [PATCH v3 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-01-26 Thread Shannon Zhao


On 2016/1/26 19:31, Stefano Stabellini wrote:
> On Tue, 26 Jan 2016, Shannon Zhao wrote:
>> > On 2016/1/26 0:44, Stefano Stabellini wrote:
>>> > > On Sat, 23 Jan 2016, Shannon Zhao wrote:
> > >> > From: Shannon Zhao 
> > >> > 
> > >> > Move x86 specific codes to architecture directory and export those 
> > >> > EFI
> > >> > runtime service functions. This will be useful for initializing 
> > >> > runtime
> > >> > service on ARM later.
> > >> > 
> > >> > Signed-off-by: Shannon Zhao 
>>> > > This patch causes a build breakage on x86:
>>> > > 
>>> > > arch/x86/xen/efi.c: In function ‘xen_efi_probe’:
>>> > > arch/x86/xen/efi.c:101:2: error: implicit declaration of function 
>>> > > ‘HYPERVISOR_platform_op’ [-Werror=implicit-function-declaration]
>>> > > 
>> > This patch is based on following patch [1]. Maybe you need to update
>> > your branch. :)
>> > 
>> > [1] xen: rename dom0_op to platform_op
>> > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cfafae940381207d48b11a73a211142dba5947d3
> Sorry, I made a mistake rebasing the series. It doesn't help that I
> couldn't find any Linux RCs on top of which it applies cleanly. As Linus
> tags RCs often enough, it is usually helpful to base one's work on a tag
> so that it is easier for other people to work on it.
>
Ah, I'll rebase this series on top of the newest master at next version
since the relevant patches are in master.

> Please add my Reviewed-by to this patch.
Thanks a lot!

-- 
Shannon


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-01-26 Thread Shannon Zhao


On 2016/1/26 0:44, Stefano Stabellini wrote:
> On Sat, 23 Jan 2016, Shannon Zhao wrote:
>> > From: Shannon Zhao 
>> > 
>> > Move x86 specific codes to architecture directory and export those EFI
>> > runtime service functions. This will be useful for initializing runtime
>> > service on ARM later.
>> > 
>> > Signed-off-by: Shannon Zhao 
> This patch causes a build breakage on x86:
> 
> arch/x86/xen/efi.c: In function ‘xen_efi_probe’:
> arch/x86/xen/efi.c:101:2: error: implicit declaration of function 
> ‘HYPERVISOR_platform_op’ [-Werror=implicit-function-declaration]
> 
This patch is based on following patch [1]. Maybe you need to update
your branch. :)

[1] xen: rename dom0_op to platform_op
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cfafae940381207d48b11a73a211142dba5947d3

-- 
Shannon


___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-01-26 Thread Stefano Stabellini
On Tue, 26 Jan 2016, Shannon Zhao wrote:
> On 2016/1/26 0:44, Stefano Stabellini wrote:
> > On Sat, 23 Jan 2016, Shannon Zhao wrote:
> >> > From: Shannon Zhao 
> >> >
> >> > Move x86 specific codes to architecture directory and export those EFI
> >> > runtime service functions. This will be useful for initializing runtime
> >> > service on ARM later.
> >> >
> >> > Signed-off-by: Shannon Zhao 
> > This patch causes a build breakage on x86:
> >
> > arch/x86/xen/efi.c: In function ‘xen_efi_probe’:
> > arch/x86/xen/efi.c:101:2: error: implicit declaration of function 
> > ‘HYPERVISOR_platform_op’ [-Werror=implicit-function-declaration]
> >
> This patch is based on following patch [1]. Maybe you need to update
> your branch. :)
>
> [1] xen: rename dom0_op to platform_op
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=cfafae940381207d48b11a73a211142dba5947d3

Sorry, I made a mistake rebasing the series. It doesn't help that I
couldn't find any Linux RCs on top of which it applies cleanly. As Linus
tags RCs often enough, it is usually helpful to base one's work on a tag
so that it is easier for other people to work on it.

Please add my Reviewed-by to this patch.___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] [PATCH v3 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-01-25 Thread Stefano Stabellini
On Sat, 23 Jan 2016, Shannon Zhao wrote:
> From: Shannon Zhao 
>
> Move x86 specific codes to architecture directory and export those EFI
> runtime service functions. This will be useful for initializing runtime
> service on ARM later.
>
> Signed-off-by: Shannon Zhao 

This patch causes a build breakage on x86:

arch/x86/xen/efi.c: In function ‘xen_efi_probe’:
arch/x86/xen/efi.c:101:2: error: implicit declaration of function 
‘HYPERVISOR_platform_op’ [-Werror=implicit-function-declaration]



>  arch/x86/xen/efi.c| 112 
>  drivers/xen/efi.c | 174 
> ++
>  include/xen/xen-ops.h |  30 ++---
>  3 files changed, 168 insertions(+), 148 deletions(-)
>
> diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c
> index be14cc3..86527f1 100644
> --- a/arch/x86/xen/efi.c
> +++ b/arch/x86/xen/efi.c
> @@ -20,10 +20,122 @@
>  #include 
>  #include 
>
> +#include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> +#include 
> +
> +static efi_char16_t vendor[100] __initdata;
> +
> +static efi_system_table_t efi_systab_xen __initdata = {
> + .hdr = {
> + .signature  = EFI_SYSTEM_TABLE_SIGNATURE,
> + .revision   = 0, /* Initialized later. */
> + .headersize = 0, /* Ignored by Linux Kernel. */
> + .crc32  = 0, /* Ignored by Linux Kernel. */
> + .reserved   = 0
> + },
> + .fw_vendor  = EFI_INVALID_TABLE_ADDR, /* Initialized later. */
> + .fw_revision= 0,  /* Initialized later. */
> + .con_in_handle  = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .con_in = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .con_out_handle = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .con_out= EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .stderr_handle  = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .stderr = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
> + .runtime= (efi_runtime_services_t *)EFI_INVALID_TABLE_ADDR,
> +   /* Not used under Xen. */
> + .boottime   = (efi_boot_services_t *)EFI_INVALID_TABLE_ADDR,
> +   /* Not used under Xen. */
> + .nr_tables  = 0,  /* Initialized later. */
> + .tables = EFI_INVALID_TABLE_ADDR  /* Initialized later. */
> +};
> +
> +static const struct efi efi_xen __initconst = {
> + .systab   = NULL, /* Initialized later. */
> + .runtime_version  = 0,/* Initialized later. */
> + .mps  = EFI_INVALID_TABLE_ADDR,
> + .acpi = EFI_INVALID_TABLE_ADDR,
> + .acpi20   = EFI_INVALID_TABLE_ADDR,
> + .smbios   = EFI_INVALID_TABLE_ADDR,
> + .smbios3  = EFI_INVALID_TABLE_ADDR,
> + .sal_systab   = EFI_INVALID_TABLE_ADDR,
> + .boot_info= EFI_INVALID_TABLE_ADDR,
> + .hcdp = EFI_INVALID_TABLE_ADDR,
> + .uga  = EFI_INVALID_TABLE_ADDR,
> + .uv_systab= EFI_INVALID_TABLE_ADDR,
> + .fw_vendor= EFI_INVALID_TABLE_ADDR,
> + .runtime  = EFI_INVALID_TABLE_ADDR,
> + .config_table = EFI_INVALID_TABLE_ADDR,
> + .get_time = xen_efi_get_time,
> + .set_time = xen_efi_set_time,
> + .get_wakeup_time  = xen_efi_get_wakeup_time,
> + .set_wakeup_time  = xen_efi_set_wakeup_time,
> + .get_variable = xen_efi_get_variable,
> + .get_next_variable= xen_efi_get_next_variable,
> + .set_variable = xen_efi_set_variable,
> + .query_variable_info  = xen_efi_query_variable_info,
> + .update_capsule   = xen_efi_update_capsule,
> + .query_capsule_caps   = xen_efi_query_capsule_caps,
> + .get_next_high_mono_count = xen_efi_get_next_high_mono_count,
> + .reset_system = NULL, /* Functionality provided by Xen. */
> + .set_virtual_address_map  = NULL, /* Not used under Xen. */
> + .memmap   = NULL, /* Not used under Xen. */
> + .flags= 0 /* Initialized later. */
> +};
> +
> +static efi_system_table_t __init *xen_efi_probe(void)
> +{
> + struct xen_platform_op op = {
> + .cmd = XENPF_firmware_info,
> + .u.firmware_info = {
> + .type = XEN_FW_EFI_INFO,
> + .index = XEN_FW_EFI_CONFIG_TABLE
> + }
> + };
> + union xenpf_efi_info *info = _info.u.efi_info;
> +
> + if (!xen_initial_domain() || HYPERVISOR_platform_op() < 0)
> + return NULL;
> +
> + /* Here we know 

[Xen-devel] [PATCH v3 14/17] XEN: EFI: Move x86 specific codes to architecture directory

2016-01-22 Thread Shannon Zhao
From: Shannon Zhao 

Move x86 specific codes to architecture directory and export those EFI
runtime service functions. This will be useful for initializing runtime
service on ARM later.

Signed-off-by: Shannon Zhao 
---
 arch/x86/xen/efi.c| 112 
 drivers/xen/efi.c | 174 ++
 include/xen/xen-ops.h |  30 ++---
 3 files changed, 168 insertions(+), 148 deletions(-)

diff --git a/arch/x86/xen/efi.c b/arch/x86/xen/efi.c
index be14cc3..86527f1 100644
--- a/arch/x86/xen/efi.c
+++ b/arch/x86/xen/efi.c
@@ -20,10 +20,122 @@
 #include 
 #include 
 
+#include 
 #include 
+#include 
 
 #include 
 #include 
+#include 
+
+static efi_char16_t vendor[100] __initdata;
+
+static efi_system_table_t efi_systab_xen __initdata = {
+   .hdr = {
+   .signature  = EFI_SYSTEM_TABLE_SIGNATURE,
+   .revision   = 0, /* Initialized later. */
+   .headersize = 0, /* Ignored by Linux Kernel. */
+   .crc32  = 0, /* Ignored by Linux Kernel. */
+   .reserved   = 0
+   },
+   .fw_vendor  = EFI_INVALID_TABLE_ADDR, /* Initialized later. */
+   .fw_revision= 0,  /* Initialized later. */
+   .con_in_handle  = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .con_in = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .con_out_handle = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .con_out= EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .stderr_handle  = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .stderr = EFI_INVALID_TABLE_ADDR, /* Not used under Xen. */
+   .runtime= (efi_runtime_services_t *)EFI_INVALID_TABLE_ADDR,
+ /* Not used under Xen. */
+   .boottime   = (efi_boot_services_t *)EFI_INVALID_TABLE_ADDR,
+ /* Not used under Xen. */
+   .nr_tables  = 0,  /* Initialized later. */
+   .tables = EFI_INVALID_TABLE_ADDR  /* Initialized later. */
+};
+
+static const struct efi efi_xen __initconst = {
+   .systab   = NULL, /* Initialized later. */
+   .runtime_version  = 0,/* Initialized later. */
+   .mps  = EFI_INVALID_TABLE_ADDR,
+   .acpi = EFI_INVALID_TABLE_ADDR,
+   .acpi20   = EFI_INVALID_TABLE_ADDR,
+   .smbios   = EFI_INVALID_TABLE_ADDR,
+   .smbios3  = EFI_INVALID_TABLE_ADDR,
+   .sal_systab   = EFI_INVALID_TABLE_ADDR,
+   .boot_info= EFI_INVALID_TABLE_ADDR,
+   .hcdp = EFI_INVALID_TABLE_ADDR,
+   .uga  = EFI_INVALID_TABLE_ADDR,
+   .uv_systab= EFI_INVALID_TABLE_ADDR,
+   .fw_vendor= EFI_INVALID_TABLE_ADDR,
+   .runtime  = EFI_INVALID_TABLE_ADDR,
+   .config_table = EFI_INVALID_TABLE_ADDR,
+   .get_time = xen_efi_get_time,
+   .set_time = xen_efi_set_time,
+   .get_wakeup_time  = xen_efi_get_wakeup_time,
+   .set_wakeup_time  = xen_efi_set_wakeup_time,
+   .get_variable = xen_efi_get_variable,
+   .get_next_variable= xen_efi_get_next_variable,
+   .set_variable = xen_efi_set_variable,
+   .query_variable_info  = xen_efi_query_variable_info,
+   .update_capsule   = xen_efi_update_capsule,
+   .query_capsule_caps   = xen_efi_query_capsule_caps,
+   .get_next_high_mono_count = xen_efi_get_next_high_mono_count,
+   .reset_system = NULL, /* Functionality provided by Xen. */
+   .set_virtual_address_map  = NULL, /* Not used under Xen. */
+   .memmap   = NULL, /* Not used under Xen. */
+   .flags= 0 /* Initialized later. */
+};
+
+static efi_system_table_t __init *xen_efi_probe(void)
+{
+   struct xen_platform_op op = {
+   .cmd = XENPF_firmware_info,
+   .u.firmware_info = {
+   .type = XEN_FW_EFI_INFO,
+   .index = XEN_FW_EFI_CONFIG_TABLE
+   }
+   };
+   union xenpf_efi_info *info = _info.u.efi_info;
+
+   if (!xen_initial_domain() || HYPERVISOR_platform_op() < 0)
+   return NULL;
+
+   /* Here we know that Xen runs on EFI platform. */
+
+   efi = efi_xen;
+
+   efi_systab_xen.tables = info->cfg.addr;
+   efi_systab_xen.nr_tables = info->cfg.nent;
+
+   op.cmd = XENPF_firmware_info;
+   op.u.firmware_info.type = XEN_FW_EFI_INFO;
+   op.u.firmware_info.index = XEN_FW_EFI_VENDOR;
+   info->vendor.bufsz =