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] Help with test_and_clear_bit on events

To: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Subject: Re: [Xen-devel] Help with test_and_clear_bit on events
From: Daniel Castro <evil.dani@xxxxxxxxx>
Date: Tue, 4 Oct 2011 20:23:31 +0900
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 04 Oct 2011 04:25:11 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Zd+sN1wz3cpnJrR8YJ+2BF34qTjsz1x1IRWLsPcZIV0=; b=HA5cCeaQ1udnKQ3kO3g3JxTwomr9jB+xjcujLxDMkjk66/biifftddbyobMN8VMEfY WjlORNxfZX0plpUYDPHZMg7D6+dTRa8oYJpK7xUHpvAtNsJb43G4oVUHppLtykcZ5gh1 e5onstgloziHVgXiSjJ6y41uSZf8iHtOOcD0E=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1317726163.21903.113.camel@xxxxxxxxxxxxxxxxxxxxxx>
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: <CAP2B85_LhqE9F53FAJ3ez3+GDichDTcWiau=x2zdftqGdcADag@xxxxxxxxxxxxxx> <1317726163.21903.113.camel@xxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, Oct 4, 2011 at 8:02 PM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
> On Tue, 2011-10-04 at 11:57 +0100, Daniel Castro wrote:
>> Hello List,
>>
>> I have been trying for several days to be able to wait for events and
>> then continue execution based on the event received. My problem is in
>> the wait_ring function of xenbus.c
>> After debugging my test_and_clear_bit I corrected the error that
>> allows me to receive ONE event, but after that the bit is never set
>> again. My offset is always 2 (nr eq 2).
>> Please, can someone explain me how struct shared_info and these two
>> fields control the events that I can receive?
>> unsigned long evtchn_pending[sizeof(unsigned long) * 8];
>> unsigned long evtchn_mask[sizeof(unsigned long) * 8];
>>
>> I print the whole array Bit by Bit and I do not see a difference after
>> the arrival of the event and before the arrival.
>>
>> I also checked struct vcpu_info fields: u8 evtchn_upcall_pending and
>> u8 evtchn_upcall_mask to see if they are disabling the event delivery.
>> No changes before or after.
>
> If git://github.com/evildani/seabios_patch.git master is up to date
> then:
>    shared_info = malloc_high(sizeof(shared_info));
>    xatp.gpfn  = ((unsigned long)shared_info << PAGE_SHIFT);
> is wrong and you aren't registering the correct shared_info so you
> aren't actually looking at the right bits, the change in behaviour is
> just because you are now looking at different wrong bits.
>
> You need ">>" not "<<" (consider the relation between addresses and page
> numbers...).

Thanks, sorry for the typo, I just corrected it, the same behavior persists.

The output for shinfo->evtchn_pending[2] is
11001100110011001100110011001100, which bit am I supposed to change?
Here I am confused.
Also I have: VCPU.0 evtchn_upcall_mask 11000010 AND evntchn_pending 11000010

Sorry but I am somewhat confused by all this. Is this documented somewhere?

Million Thanks again!

>
> Ian.
>
>
>



-- 
+-=====---------------------------+
| +---------------------------------+ | This space intentionally blank
for notetaking.
| |   | Daniel Castro,                |
| |   | Consultant/Programmer.|
| |   | U Andes                         |
+-------------------------------------+

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