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] How does hypervisor handle the hypercalls fromguest OSes

To: "K.C. Chiu" <B8844014@xxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] How does hypervisor handle the hypercalls fromguest OSes?
From: Keir Fraser <Keir.Fraser@xxxxxxxxxxxx>
Date: Sun, 23 May 2004 19:20:36 +0100
Cc: "Ian Pratt" <Ian.Pratt@xxxxxxxxxxxx>, rolf.neugebauer@xxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxxxx
Delivery-date: Sun, 23 May 2004 19:22:25 +0100
Envelope-to: steven.hand@xxxxxxxxxxxx
In-reply-to: Your message of "Mon, 24 May 2004 01:08:59 +0800." <004501c440e8$ae194ae0$9713a8c0@linuxnxhc0axvc>
List-archive: <http://sourceforge.net/mailarchive/forum.php?forum=xen-devel>
List-help: <mailto:xen-devel-request@lists.sourceforge.net?subject=help>
List-id: List for Xen developers <xen-devel.lists.sourceforge.net>
List-post: <mailto:xen-devel@lists.sourceforge.net>
List-subscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=subscribe>
List-unsubscribe: <https://lists.sourceforge.net/lists/listinfo/xen-devel>, <mailto:xen-devel-request@lists.sourceforge.net?subject=unsubscribe>
Sender: xen-devel-admin@xxxxxxxxxxxxxxxxxxxxx
A couple of comments...

> long hypervisor_temp(struct task_struct *p, dom0_tmp_t *tmp)
> {
>         int ret;
>         unsigned long cpu_mask = 0;
>         int p_size;
> 
>         if ( sizeof(*p->temp) > PAGE_SIZE ) BUG();
> 
>         p->temp = (void *)get_free_page(GFP_KERNEL);
>         clear_page(p->temp);
>         p->temp = tmp->test;
          ^^^^^^^^^^^^^^^^^^^^
The line above looks like debugging you've forgotten to remove?

>         SHARE_PFN_WITH_DOMAIN(virt_to_page(p->temp), p->domain);
> 
>         cpu_mask = mark_guest_event(p, _EVENT_TEMP);
>         guest_event_notify(cpu_mask);
>         put_task_struct(p);
          ^^^^^^^^^^^^^^^^^^^
You probably don't want to decrement p's reference count here. p was
passed into the function as an argument, which usually means that
you are "borrowing" the caller's reference -- and he probably
expects to get it back!

Everything else looks like it is probably okay. The first comment
above could be the problem though -- it looks like the code is plain
wrong. 

 -- Keir


-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/xen-devel