grub-devel
[Top][All Lists]
Advanced

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

Re: [Xen-devel] [PATCH v2 12/18] xen: setup Xen specific data for PVH


From: Roger Pau Monné
Subject: Re: [Xen-devel] [PATCH v2 12/18] xen: setup Xen specific data for PVH
Date: Fri, 19 Oct 2018 16:46:15 +0100
User-agent: NeoMutt/20180716

On Tue, Oct 09, 2018 at 01:03:11PM +0200, Juergen Gross wrote:
> Initialize the needed Xen specific data. This is:
> 
> - the Xen start of day page containing the console and Xenstore ring
>   page PFN and event channel
> - the grant table
> - the shared info page
> 
> Set the RSDP address for the guest from the start_info page passed
> as boot parameter.
> 
> Signed-off-by: Juergen Gross <address@hidden>
> ---
>  grub-core/kern/i386/xen/pvh.c | 107 
> ++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 107 insertions(+)
> 
> diff --git a/grub-core/kern/i386/xen/pvh.c b/grub-core/kern/i386/xen/pvh.c
> index b4933b454..93ed68245 100644
> --- a/grub-core/kern/i386/xen/pvh.c
> +++ b/grub-core/kern/i386/xen/pvh.c
> @@ -24,6 +24,7 @@
>  #include <grub/xen.h>
>  #include <grub/i386/linux.h>
>  #include <grub/machine/kernel.h>
> +#include <xen/hvm/params.h>
>  #include <xen/memory.h>
>  
>  struct xen_machine_mmap_entry
> @@ -39,6 +40,7 @@ static struct { char _entry[32]; } hypercall_page[128]
>    __attribute__ ((aligned (GRUB_XEN_PAGE_SIZE)));
>  
>  static grub_uint32_t xen_cpuid_base;
> +static struct start_info grub_xen_start_page;
>  static struct xen_machine_mmap_entry map[128];
>  static unsigned int nr_map_entries;
>  
> @@ -104,6 +106,36 @@ grub_xen_hypercall (grub_uint32_t callno, grub_uint32_t 
> a0,
>    return __res;
>  }
>  
> +static grub_uint32_t
> +grub_xen_get_param (int idx)
> +{
> +  struct xen_hvm_param xhv;
> +  int r;
> +
> +  xhv.domid = DOMID_SELF;
> +  xhv.index = idx;
> +  r = grub_xen_hypercall (__HYPERVISOR_hvm_op, HVMOP_get_param,
> +                       (grub_uint32_t) (&xhv), 0, 0, 0, 0);
> +  if (r < 0)
> +    grub_xen_early_halt ();

At this point you already have access to the hypervisor console from
the hypercall page, or alternatively you can use the 0xe9 IO port, IMO
a debug message should be printed instead of just halting. Or else
debugging failures is going to be quite complicated.

I would suggest to convert grub_xen_early_halt into
grub_xen_early_crash and make it a printf like function, or at least
take a string.

Thanks, Roger.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]