Subject: Re: [PATCH 5/6] kvmppc: magic page paravirtualization - guest part

From: Tony Breeds <[email-masked]>
Date: Thu, 24 Jul 2008 11:59:25 +1000

On Wed, Jul 23, 2008 at 10:36:46AM +0200, [email-masked] wrote:

Hi Christian,

<snip>

> +/*
> + * this is guest memory granted to the hypervisor;
> + * the hypervisor can place data in this area and rewrite
> + * privileged instructions to read from this area without
> + * trapping.
> + * Only the Hypervisor needs to be aware of the structure layout
> + * which makes the guest more felxible - the guest only guarantees
> + * the size which is requested by the hypervisor and read from a
> + * device tree entry.
> + */
> +void *kvm_magicpage;

static?

<snip>

> +/* reads the specified data field out of the hypervisor node */
> +static inline int kvmppc_pv_read_data(char *dtcell)
> +{
> +	struct device_node *dn;
> +	const int *dtval;
> +
> +	dn = of_find_node_by_path("/hypervisor");
> +	if (!dn)
> +		return -EINVAL;
> +
> +	dtval = of_get_property(dn, dtcell, NULL);
> +	if (dtval)
> +		return *dtval;
> +	else
> +		return -EINVAL;

You need an of_node_put(dn) in this function somewhere.

Yours Tony

  linux.conf.au    http://www.marchsouth.org/
  Jan 19 - 24 2009 The Australian Linux Technical Conference!