Subject: Re: x86 changes
To: Christoph Egger <Christoph_Egger@gmx.de>
From: Andrew Doran <ad@netbsd.org>
List: port-xen
Date: 09/26/2007 20:40:03
On Fri, Sep 21, 2007 at 10:23:27AM +0200, Christoph Egger wrote:

> On Friday 21 September 2007 00:41:46 Andrew Doran wrote:
> > Hi,
> >
> > I just realised that I am not subscribed to this list.. Is anyone willing
> > to try a Xen kernel with this patch?
> >
> > 	http://www.netbsd.org/~ad/x86.diff
> 
> In xenfunc.h, you have this:
> 
> +vaddr_t
> +rcr2(void)
> +{
> +
> +	return 0;	/* XXX Why? */
> +}
> 
> How about this:
> 
> #ifdef MULTIPROCESSOR
> #define curvcpu()    (/* Multiprocessor support not yet implemented */)
> #else
> #define curvcpu()    (0)
> #endif
> 
> vaddr_t
> rcr2(void)
> {
> #ifdef XEN3
>        int v = curvcpu();
>        return HYPERVISOR_shared_info->vcpu_info[v].arch.cr2;
> #else
>        __PRINTK(("XXX rcr2 not supported\n"));
>        return 0;
> #endif
> }

I think that makes sense. I'll have a look.
 
> Did you try to run a NetBSD/Xen Dom0 and a NetBSD/Xen DomU ?
> Xen emulates some instructions such as rdmsr/wrmsr for Dom0, but not
> for DomU.

I posted here since I had no xen installation. :-). I've since got a dom0
created, I'll try with a domU in the next day or so.

Thanks,
Andrew