All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy Fitzhardinge <jeremy@goop.org>
To: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: [PATCH 2 of 6] early PV on HVM
Date: Thu, 22 Apr 2010 16:42:51 -0700	[thread overview]
Message-ID: <4BD0DEFB.40808@goop.org> (raw)
In-Reply-To: <alpine.DEB.2.00.1004221606290.11380@kaball-desktop>

On 04/22/2010 08:15 AM, Stefano Stabellini wrote:
> From: Sheng Yang <sheng@linux.intel.com>
>
> this patch:
>
> - adds a xen_guest_init hook in setup.c right after kvm_guest_init;
>
> - initializes basic pv on hvm features in xen_guest_init;
>   

Looks mostly OK, except:

> diff --git a/drivers/xen/xenbus/xenbus_probe.c b/drivers/xen/xenbus/xenbus_probe.c
> index ab04a1b..7d11957 100644
> --- a/drivers/xen/xenbus/xenbus_probe.c
> +++ b/drivers/xen/xenbus/xenbus_probe.c
> @@ -55,6 +55,8 @@
>  #include <xen/events.h>
>  #include <xen/page.h>
>  
> +#include <xen/hvm.h>
> +
>  #include "xenbus_comms.h"
>  #include "xenbus_probe.h"
>  
> @@ -708,10 +710,19 @@ static int __init xenbus_probe_init(void)
>  		xen_store_interface = mfn_to_virt(xen_store_mfn);
>  	} else {
>  		xenstored_ready = 1;
> -		xen_store_evtchn = xen_start_info->store_evtchn;
> -		xen_store_mfn = xen_start_info->store_mfn;
> +		if (xen_hvm_domain()) {
> +			xen_store_evtchn =
> +				hvm_get_parameter(HVM_PARAM_STORE_EVTCHN);
> +			xen_store_mfn =
> +				hvm_get_parameter(HVM_PARAM_STORE_PFN);
> +			xen_store_interface =
> +				ioremap(xen_store_mfn << PAGE_SHIFT, PAGE_SIZE);
>   

I think I'd prefer to see these wrap 80 cols than be line-broken like this.

> +		} else {
> +			xen_store_evtchn = xen_start_info->store_evtchn;
> +			xen_store_mfn = xen_start_info->store_mfn;
> +			xen_store_interface = mfn_to_virt(xen_store_mfn);
> +		}
>  	}
> -	xen_store_interface = mfn_to_virt(xen_store_mfn);
>  
>  	/* Initialize the interface to xenstore. */
>  	err = xs_init();
> diff --git a/include/xen/xen.h b/include/xen/xen.h
> index a164024..cb8c48b 100644
> --- a/include/xen/xen.h
> +++ b/include/xen/xen.h
> @@ -9,8 +9,10 @@ enum xen_domain_type {
>  
>  #ifdef CONFIG_XEN
>  extern enum xen_domain_type xen_domain_type;
> +extern void xen_guest_init(void);
>  #else
>  #define xen_domain_type		XEN_NATIVE
> +#define xen_guest_init() do { } while (0)
>  #endif
>   

This isn't an appropriate header for this.  Something under
arch/x86/include/asm would be better.

    J

  reply	other threads:[~2010-04-22 23:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-22 15:15 [PATCH 2 of 6] early PV on HVM Stefano Stabellini
2010-04-22 23:42 ` Jeremy Fitzhardinge [this message]
2010-04-23 15:34   ` Stefano Stabellini
2010-04-23 19:09     ` Jeremy Fitzhardinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4BD0DEFB.40808@goop.org \
    --to=jeremy@goop.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.