WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH 4 of 6] REDO: mem_access & mem_access 2: HVMOPs f

To: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 4 of 6] REDO: mem_access & mem_access 2: HVMOPs for setting mem access
From: Joe Epstein <jepstein@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 5 Jan 2011 06:59:28 -0800
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 05 Jan 2011 07:01:01 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:sender:received :in-reply-to:references:from:date:x-google-sender-auth:message-id :subject:to:cc:content-type; bh=dgCBSqT00L/z6svCrNddkzP9CMp6kDZzHLVkxw9U2p4=; b=A9F397pTFIKgJSCFIJAOknOjt9qFhSm3cP0/SrKhg4ae+0UiTOqGawghIxCjoqbQ1k j1M+hQpt+ofO0oE9HUDfWJml0yiNsK5sHV663ArA3bYefHSpNxQJLaXzKPR4g7PbOkbB TbdvhoUami6Ivs5sYRKZrZl3NX/PzmDZqsdTA=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=ZKGVq1hKnq+LvCuJKSvPb+ed2Luh80tQwuOBpJGyIF48hXn/kppK/L2xwlTgOhQWKU Kjo5EYlHItKfXeMhr+H9af3nG6t3hbkuZROSECUDUgzEs/yhx/SWGpzYxAEgabp6tfss aYS75VfSVWK5Q6uEDyXG6oHm16rH5iFw+IkqY=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110105142528.GF21948@xxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <AANLkTi=KF52g2=+KV9jZx7ysASTqm8gnTa0TOYKdLLpL@xxxxxxxxxxxxxx> <20110105142528.GF21948@xxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
One comment in line.

Thanks!

On Wed, Jan 5, 2011 at 6:25 AM, Tim Deegan <Tim.Deegan@xxxxxxxxxx> wrote:
Hi,

The libxc parts of this will need an Ack from one of the tools
maintainers.   Apart from that:

At 22:07 +0000 on 04 Jan (1294178841), Joe Epstein wrote:
> +/* Notify that a region of memory is to have specific access types */
> +struct xen_hvm_set_mem_access {
> +    /* Domain to be updated. */
> +    domid_t domid;
> +    /* Memory type */
> +    hvmmem_access_t hvmmem_access;
> +    /* First pfn, or ~0ull to set the default access for new pages */
> +    uint64_t first_pfn;
> +    /* Number of pages, ignored on setting default access */
> +    uint64_t nr;
> +};
> +typedef struct xen_hvm_set_mem_access xen_hvm_set_mem_access_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_hvm_set_mem_access_t);

Please arrange that these structs have the same size and layout in
32-bit and 64-bit builds.  Otherwise you'll have to write compatibility
code for 32-bit tools running on 64-bit Xen, and nobody wants more of
that.  The easiest thing is to use explicitly-sized intXX_t throughout,
naturally aligned.

Sorry, I just copied set_mem_type, which also had an enum.  I'll force the bit size on the mem_access functions...would you want me to change set_mem_type (not my code) as well for consistency?
 

> +#define HVMOP_get_mem_access        13
> +/* Get the specific access type for that region of memory */
> +struct xen_hvm_get_mem_access {
> +    /* Domain to be queried. */
> +    domid_t domid;
> +    /* Memory type: OUT */
> +    hvmmem_access_t hvmmem_access;
> +    /* pfn, or ~0ull for default access for new pages.  IN */
> +    uint64_t pfn;
> +};
> +typedef struct xen_hvm_get_mem_access xen_hvm_get_mem_access_t;
> +DEFINE_XEN_GUEST_HANDLE(xen_hvm_get_mem_access_t);
>  #endif /* __XEN_PUBLIC_HVM_HVM_OP_H__ */
> diff -r 85a7611248b8 -r 4ead881da87d tools/libxc/Makefile
> --- a/tools/libxc/Makefile      Tue Jan 04 12:16:42 2011 -0800
> +++ b/tools/libxc/Makefile      Tue Jan 04 12:28:36 2011 -0800
> @@ -28,6 +28,7 @@
>  CTRL_SRCS-y       += xc_tmem.c
>  CTRL_SRCS-y       += xc_mem_event.c
>  CTRL_SRCS-y       += xc_mem_paging.c
> +CTRL_SRCS-y       += xc_mem_access.c
>  CTRL_SRCS-y       += xc_memshr.c
>  CTRL_SRCS-y       += xc_hcall_buf.c
>  CTRL_SRCS-y       += xc_foreign_memory.c
> diff -r 85a7611248b8 -r 4ead881da87d tools/libxc/xc_mem_access.c
> --- /dev/null   Thu Jan 01 00:00:00 1970 +0000
> +++ b/tools/libxc/xc_mem_access.c       Tue Jan 04 12:28:36 2011 -0800
> @@ -0,0 +1,42 @@
> +/******************************************************************************
> + *
> + * tools/libxc/xc_mem_access.c
> + *
> + * Interface to low-level memory access mode functionality
> + *
> + * Copyright (c) 2009 by Citrix Systems, Inc.

Ahem.

Otherwise, this looks OK to me.

Tim.

--
Tim Deegan <Tim.Deegan@xxxxxxxxxx>
Principal Software Engineer, Xen Platform Team
Citrix Systems UK Ltd.  (Company #02937203, SL9 0BG)

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel