lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110105202521.GG29993@dumpdata.com>
Date:	Wed, 5 Jan 2011 15:25:21 -0500
From:	Konrad Rzeszutek Wilk <konrad.wilk@...cle.com>
To:	stefano.stabellini@...citrix.com
Cc:	linux-kernel@...r.kernel.org, xen-devel@...ts.xensource.com,
	Jeremy Fitzhardinge <Jeremy.Fitzhardinge@...rix.com>,
	Ian Campbell <ian.campbell@...rix.com>
Subject: Re: [PATCH 01/11] xen: define gnttab_set_map_op/unmap_op

On Wed, Dec 15, 2010 at 01:40:36PM +0000, stefano.stabellini@...citrix.com wrote:
> From: Ian Campbell <ian.campbell@...rix.com>
> 
> Impact: hypercall definitions
> 
> These functions populate the gnttab data structures used by the
> granttab map and unmap ops and are used in the backend drivers.
> 
> Originally xen-unstable.hg 9625:c3bb51c443a7
> 
> [ Include Stefano's fix for phys_addr_t ]
> 
> Signed-off-by: Ian Campbell <ian.campbell@...rix.com>
> Signed-off-by: Stefano Stabellini <stefano.stabellini@...citrix.com>
> Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>
> ---
>  include/xen/grant_table.h |   39 ++++++++++++++++++++++++++++++++++++++-
>  1 files changed, 38 insertions(+), 1 deletions(-)
> 
> diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
> index 9a73170..1821aa1 100644
> --- a/include/xen/grant_table.h
> +++ b/include/xen/grant_table.h
> @@ -37,10 +37,16 @@
>  #ifndef __ASM_GNTTAB_H__
>  #define __ASM_GNTTAB_H__
>  
> -#include <asm/xen/hypervisor.h>
> +#include <asm/page.h>
> +
> +#include <xen/interface/xen.h>
>  #include <xen/interface/grant_table.h>
> +
> +#include <asm/xen/hypervisor.h>
>  #include <asm/xen/grant_table.h>
>  
> +#include <xen/features.h>
> +
>  /* NR_GRANT_FRAMES must be less than or equal to that configured in Xen */
>  #define NR_GRANT_FRAMES 4
>  
> @@ -107,6 +113,37 @@ void gnttab_grant_foreign_access_ref(grant_ref_t ref, domid_t domid,
>  void gnttab_grant_foreign_transfer_ref(grant_ref_t, domid_t domid,
>  				       unsigned long pfn);
>  
> +static inline void
> +gnttab_set_map_op(struct gnttab_map_grant_ref *map, phys_addr_t addr,
> +		  uint32_t flags, grant_ref_t ref, domid_t domid)
> +{
> +	if (flags & GNTMAP_contains_pte)
> +		map->host_addr = addr;
> +	else if (xen_feature(XENFEAT_auto_translated_physmap))
> +		map->host_addr = __pa(addr);
> +	else
> +		map->host_addr = addr;

Why not just get rid of the "flags & GNTMAP_contains_pte"? If
that returns false you still end up setting map->host_addr to addr.

> +
> +	map->flags = flags;
> +	map->ref = ref;
> +	map->dom = domid;
> +}
> +
> +static inline void
> +gnttab_set_unmap_op(struct gnttab_unmap_grant_ref *unmap, phys_addr_t addr,
> +		    uint32_t flags, grant_handle_t handle)
> +{
> +	if (flags & GNTMAP_contains_pte)
> +		unmap->host_addr = addr;
> +	else if (xen_feature(XENFEAT_auto_translated_physmap))
> +		unmap->host_addr = __pa(addr);
> +	else
> +		unmap->host_addr = addr;

Ditto here..
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ