All of lore.kernel.org
 help / color / mirror / Atom feed
* Setting up hypervisor_callback and testing
@ 2006-02-15 11:49 Ivan Kelly
  2006-02-15 12:33 ` Simon Kagstrom
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kelly @ 2006-02-15 11:49 UTC (permalink / raw)
  To: xen-devel

im setting up my hypervisor callback with:
hypervisor_set_callbacks(CS_SELECTOR, (unsigned long)hypervisor_callback,
			 CS_SELECTOR, (unsigned long)failsafe_callback);
hypervisor_callback and failsafe_callback are as yet very simple assembly
funcations that just shutdown the domain.
<SNIP>
_hypervisor_callback:
        call    _hypervisor_shutdown
        ret

_failsafe_callback:
        call    _hypervisor_shutdown
        ret
</SNIP>

Im trying to test it with:
<SNIP>
_xen_cb_test:
        call    _hypervisor_save_kernel_stack
        mov     esi, _hypervisor_shared_info
        mov     1(esi), 0
        push    0
        push    __HYPERVISOR_xen_version
        call    _xen_op
        add     esp, 4*2
        ret
</SNIP>

The callback doesn't seem to be getting called at all. At the moment im only
trying to get very basic callback stuff working, so i've left out the save and
iret stuff. Could anyone point out where im going wrong?
Regards
Ivan Kelly

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Setting up hypervisor_callback and testing
  2006-02-15 11:49 Setting up hypervisor_callback and testing Ivan Kelly
@ 2006-02-15 12:33 ` Simon Kagstrom
  2006-02-17 17:58   ` Ivan Kelly
  0 siblings, 1 reply; 4+ messages in thread
From: Simon Kagstrom @ 2006-02-15 12:33 UTC (permalink / raw)
  To: Ivan Kelly, xen-devel

At Wed, 15 Feb 2006 11:49:05 +0000,
Ivan Kelly wrote:
> 
> im setting up my hypervisor callback with:
> hypervisor_set_callbacks(CS_SELECTOR, (unsigned long)hypervisor_callback,
> 			 CS_SELECTOR, (unsigned long)failsafe_callback);
> hypervisor_callback and failsafe_callback are as yet very simple assembly
> funcations that just shutdown the domain.
> <SNIP>
> _hypervisor_callback:
> [...]
> </SNIP>
> 
> The callback doesn't seem to be getting called at all. At the moment im only
> trying to get very basic callback stuff working, so i've left out the save and
> iret stuff. Could anyone point out where im going wrong?

Have you enabled event delivery? Look in the Mini-OS source kernel.c
and os.h, where "__sti" is defined:

#define __sti()                                                         \
do {                                                                    \
        vcpu_info_t *_vcpu;                                             \
        barrier();                                                      \
        _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \
        _vcpu->evtchn_upcall_mask = 0;                                  \
        barrier(); /* unmask then check (avoid races) */                \
        if ( unlikely(_vcpu->evtchn_upcall_pending) )                   \
                force_evtchn_callback();                                \
} while (0)

the events should be masked on startup I think, so maybe that's your
problem.

// Simon

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Setting up hypervisor_callback and testing
  2006-02-15 12:33 ` Simon Kagstrom
@ 2006-02-17 17:58   ` Ivan Kelly
  2006-02-17 19:53     ` Ivan Kelly
  0 siblings, 1 reply; 4+ messages in thread
From: Ivan Kelly @ 2006-02-17 17:58 UTC (permalink / raw)
  To: Simon Kagstrom; +Cc: xen-devel

On Wed, Feb 15, 2006 at 01:33:45PM +0100, Simon Kagstrom wrote:
> #define __sti()                                                         \
> do {                                                                    \
>         vcpu_info_t *_vcpu;                                             \
>         barrier();                                                      \
>         _vcpu = &HYPERVISOR_shared_info->vcpu_info[smp_processor_id()]; \
>         _vcpu->evtchn_upcall_mask = 0;                                  \
>         barrier(); /* unmask then check (avoid races) */                \
>         if ( unlikely(_vcpu->evtchn_upcall_pending) )                   \
>                 force_evtchn_callback();                                \
> } while (0)
> 
> the events should be masked on startup I think, so maybe that's your
> problem.
Ok, Ive setup up this. I hadn't the shared info mapped properly and took me a
while to figure out. now when i run the interrupt test i get:
(XEN) (file=/usr/src/xen/xen-2.0/xen/include/asm/mm.h, line=157) Error pfn
00000000: ed=fc59e6c0, sd2
Then the code seems to return to the entry point, and run again continuously.
I think it's trying to jump to an address that doesnt exist even though i have
callback_event set to _hypervisor_callback.
-Ivan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Setting up hypervisor_callback and testing
  2006-02-17 17:58   ` Ivan Kelly
@ 2006-02-17 19:53     ` Ivan Kelly
  0 siblings, 0 replies; 4+ messages in thread
From: Ivan Kelly @ 2006-02-17 19:53 UTC (permalink / raw)
  To: Simon Kagstrom, xen-devel

> Ok, Ive setup up this. I hadn't the shared info mapped properly and took me a
> while to figure out. now when i run the interrupt test i get:
> (XEN) (file=/usr/src/xen/xen-2.0/xen/include/asm/mm.h, line=157) Error pfn
> 00000000: ed=fc59e6c0, sd2
> Then the code seems to return to the entry point, and run again continuously.
> I think it's trying to jump to an address that doesnt exist even though i have
> callback_event set to _hypervisor_callback.
Solved my problem now. Not sure what solved it, but i was calling the
set_callbacks hypercall without failsafe_addr set. sorted now.
-ivan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-02-17 19:53 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-02-15 11:49 Setting up hypervisor_callback and testing Ivan Kelly
2006-02-15 12:33 ` Simon Kagstrom
2006-02-17 17:58   ` Ivan Kelly
2006-02-17 19:53     ` Ivan Kelly

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.