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] xen: introduce HVM_PARAM_BUFIOREQ_EVTCHN

To: Stefano Stabellini <Stefano.Stabellini@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xen: introduce HVM_PARAM_BUFIOREQ_EVTCHN
From: Keir Fraser <keir@xxxxxxx>
Date: Tue, 15 Nov 2011 16:10:22 +0000
Cc:
Delivery-date: Tue, 15 Nov 2011 08:11:51 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:user-agent:date:subject:from:to:message-id:thread-topic :thread-index:in-reply-to:mime-version:content-type :content-transfer-encoding; bh=touwQKaz0nwjBMKajm+HZR3ie3F52WiWXxbr0UU0ML4=; b=qLEfkF7Ci7XlHRJvN+2UADUi8/5zsAdcGPLkV517h2CGaMNUVkBUKwYE4nmyh2/AkK DPcQAkyfKQPJXiQXi16r5ThcuZ2K0bgs3Ged3ASeF44xXBG+jnVJp83c5hxuEvnWPiQm xDieKpgZ70AgV1G/fr6wK9OizlheSLFyl1VWg=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1321365190-601-1-git-send-email-stefano.stabellini@xxxxxxxxxxxxx>
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>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcyjsROVss10EYSJekuTMbrN8CG/LA==
Thread-topic: [Xen-devel] [PATCH] xen: introduce HVM_PARAM_BUFIOREQ_EVTCHN
User-agent: Microsoft-Entourage/12.31.0.110725
On 15/11/2011 13:53, "Stefano Stabellini" <Stefano.Stabellini@xxxxxxxxxxxxx>
wrote:

> From: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> 
> Introduce an event channel for buffered io event notifications,
> advertise the port number using an hvm param.
> This way the device model is not forced to check the buffered io page
> for data several times a second for the entire life of the VM (buffered
> io is mostly used for stdvga emulation in Xen that is switched off after
> the guest goes into graphical mode).

It doesn't look like this evtchn can be allocated and specified from outside
the hypervisor. Hence HVMOP_set_param(BUFIOREQ_EVTCHN) should fail with
-EINVAL or similar.

 -- Keir

> Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
> ---
>  xen/arch/x86/hvm/hvm.c          |   10 ++++++++++
>  xen/arch/x86/hvm/io.c           |    2 ++
>  xen/include/public/hvm/params.h |    3 ++-
>  3 files changed, 14 insertions(+), 1 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/hvm.c b/xen/arch/x86/hvm/hvm.c
> index ab7763b..dc01537 100644
> --- a/xen/arch/x86/hvm/hvm.c
> +++ b/xen/arch/x86/hvm/hvm.c
> @@ -972,6 +972,16 @@ int hvm_vcpu_initialise(struct vcpu *v)
>  
>      /* Register ioreq event channel. */
>      v->arch.hvm_vcpu.xen_port = rc;
> +
> +    if ( v->vcpu_id == 0 )
> +    {
> +        /* Create bufioreq event channel. */
> +        rc = alloc_unbound_xen_event_channel(v, 0);
> +        if ( rc < 0 )
> +            goto fail2;
> +        v->domain->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN] = rc;
> +    }
> +
>      spin_lock(&v->domain->arch.hvm_domain.ioreq.lock);
>      if ( v->domain->arch.hvm_domain.ioreq.va != NULL )
>          get_ioreq(v)->vp_eport = v->arch.hvm_vcpu.xen_port;
> diff --git a/xen/arch/x86/hvm/io.c b/xen/arch/x86/hvm/io.c
> index 7ebefc7..41a2ede 100644
> --- a/xen/arch/x86/hvm/io.c
> +++ b/xen/arch/x86/hvm/io.c
> @@ -118,6 +118,8 @@ int hvm_buffered_io_send(ioreq_t *p)
>      wmb();
>      pg->write_pointer += qw ? 2 : 1;
>  
> +    notify_via_xen_event_channel(v->domain,
> +            v->domain->arch.hvm_domain.params[HVM_PARAM_BUFIOREQ_EVTCHN]);
>      spin_unlock(&iorp->lock);
>      
>      return 1;
> diff --git a/xen/include/public/hvm/params.h b/xen/include/public/hvm/params.h
> index 1c5a1a9..6699788 100644
> --- a/xen/include/public/hvm/params.h
> +++ b/xen/include/public/hvm/params.h
> @@ -52,6 +52,7 @@
>  #define HVM_PARAM_IOREQ_PFN    5
>  
>  #define HVM_PARAM_BUFIOREQ_PFN 6
> +#define HVM_PARAM_BUFIOREQ_EVTCHN 26
>  
>  #ifdef __ia64__
>  
> @@ -141,6 +142,6 @@
>  /* Boolean: Enable nestedhvm (hvm only) */
>  #define HVM_PARAM_NESTEDHVM    24
>  
> -#define HVM_NR_PARAMS          26
> +#define HVM_NR_PARAMS          27
>  
>  #endif /* __XEN_PUBLIC_HVM_PARAMS_H__ */



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

<Prev in Thread] Current Thread [Next in Thread>