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

[Xen-devel] Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux

To: Andreas Färber <andreas.faerber@xxxxxx>
Subject: [Xen-devel] Re: [Qemu-devel] [PATCH] xen: net backend doesn't need linux headers.
From: Blue Swirl <blauwirbel@xxxxxxxxx>
Date: Sun, 7 Jun 2009 09:56:32 +0300
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, xen-discuss@xxxxxxxxxxxxxxx, Gerd Hoffmann <kraxel@xxxxxxxxxx>, qemu-devel@xxxxxxxxxx
Delivery-date: Tue, 09 Jun 2009 08:57:52 -0700
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=v0nze0MLv7AL8RMd6MA7hS2752HK/Y45YfeOFT6886c=; b=PbCaW5cF1fwom0VIGPZsxZoPyaRmp1caQyI7AM7W40aMkRtWFKGMSPlWhiFTwZejT6 IHXx2beO2uuKLZUu2Ay11Lnr3xgHqjK7Me8+L2W2/3kQHNeng4rN/+QwCN7g/qZjVfdq CqFS/Yz2Hc6cZVwBZVj4+ajy7G6BF/8y9eFbU=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=oTNoxFfZ0iE5cJP6a42NqyPc3xLpcFPkth1oXGDPRmdoxtqepEF+NURWZ9+uIZvYYT oaUIPitp1G99S5OMmUxhpaPHCs3Pa7gUWaD/bjcUQDl7hTsMTyI+uZ+Ox0cGdVthdznG HeU0IOWsEyZeYv7Tl6CyINex9ybEh1yaymfTQ=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1DB8C28C-ECE6-459C-B9BE-D4747CA4C9CF@xxxxxx>
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: <1243926324-13133-1-git-send-email-kraxel@xxxxxxxxxx> <f43fc5580906060852i671ee4a0ie575ce061271d9a2@xxxxxxxxxxxxxx> <28EBEC28-6D03-4321-8629-1F54EA30C634@xxxxxx> <1DB8C28C-ECE6-459C-B9BE-D4747CA4C9CF@xxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On 6/6/09, Andreas Färber <andreas.faerber@xxxxxx> wrote:
>
>  Am 06.06.2009 um 21:43 schrieb Andreas Färber:
>
>
>
> >
> > Am 06.06.2009 um 17:52 schrieb Blue Swirl:
> >
> >
> > > On 6/2/09, Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
> > >
> > > > Drop them to make qemu build on OpenSolaris.
> > > >
> > > > Cc: Andreas Färber <andreas.faerber@xxxxxx>
> > > > Signed-off-by: Gerd Hoffmann <kraxel@xxxxxxxxxx>
> > > >
> > >
> > > Thanks, applied.
> > >
> >
> > Thanks, the patch helps, but doesn't fully fix the build:
> >
> >  CC    xen_backend.o
> >  CC    xen_devconfig.o
> >  CC    xen_console.o
> >  CC    xenfb.o
> >  CC    xen_disk.o
> > In file included from
> /export/home/andreas/QEMU/qemu/hw/xen_disk.c:43:
> > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:20:
> warning: #pragma pack(push[, id], <n>) is not supported on this target
> > /export/home/andreas/QEMU/qemu/hw/xen_blkif.h:36:
> warning: #pragma pack(pop[, id], <n>) is not supported on this target
> >  CC    xen_nic.o
> > /export/home/andreas/QEMU/qemu/hw/xen_nic.c: In function
> `net_tx_packets':
> > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error:
> `PAGE_SIZE' undeclared (first use in this function)
> > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error:
> (Each undeclared identifier is reported only once
> > /export/home/andreas/QEMU/qemu/hw/xen_nic.c:179: error:
> for each function it appears in.)
> > make: *** [xen_nic.o] Error 1
> >
> > A quick search for PAGE_SIZE revealed some posts saying that PAGE_SIZE
> shouldn't be used in userland and be replaced with getpagesize(). Looking at
> the code though I see a number of XC_PAGE_SIZE that don't result in errors.
> Might PAGE_SIZE be a typo then?
> >
>
>  With this patch xen_nic.c compiles:
>
>  diff --git a/hw/xen_nic.c b/hw/xen_nic.c
>  index 048d865..3615c8c 100644
>  --- a/hw/xen_nic.c
>  +++ b/hw/xen_nic.c
>  @@ -176,7 +176,7 @@ static void net_tx_packets(struct XenNetDev *netdev)
>             if (txreq.flags & NETTXF_csum_blank) {
>                 /* have read-only mapping -> can't fill checksum in-place */
>                 if (!tmpbuf)
>  -                    tmpbuf = malloc(PAGE_SIZE);
>  +                    tmpbuf = malloc(XC_PAGE_SIZE);
>                 memcpy(tmpbuf, page + txreq.offset, txreq.size);
>                 net_checksum_calculate(tmpbuf, txreq.size);
>                 qemu_send_packet(netdev->vs, tmpbuf, txreq.size);

It also looks like there is no real need for using host or target page
size, so we could use for example MIN(4096,  txreq.size).

>  If then goes on to compile Xen stuff into sparc-softmmu and fails:
>
>   CC    sparc-softmmu/xen_machine_pv.o
>  /export/home/andreas/QEMU/qemu/hw/xen_machine_pv.c:116:
> warning: initialization from incompatible pointer type
>   CC    sparc-softmmu/xen_domainbuild.o
>  [...]
>   LINK  sparc-softmmu/qemu-system-sparc
>  Undefined            first referenced
>   symbol                  in file
>  xc_gnttab_map_grant_refs
> ../libqemu_common.a(xen_disk.o)
>  xc_gnttab_map_grant_ref
> ../libqemu_common.a(xen_disk.o)
>  xc_gnttab_munmap
> ../libqemu_common.a(xen_disk.o)
>  xc_gnttab_open
> ../libqemu_common.a(xen_backend.o)
>  ld: fatal: symbol referencing errors. No output written to
> qemu-system-sparc
>  collect2: ld returned 1 exit status
>  gmake[1]: *** [qemu-system-sparc] Error 1
>  make: *** [subdir-sparc-softmmu] Error 2
>
>  Same errors when linking i386-softmmu.
>
>  OpenSolaris 2009.06 has SUNWxvm@xxx,5.11-111, I interpret this as being Xen
> 3.1 - is that maybe too old?
>  Perhaps it's easier to just have QEMU's configure disable Xen support on
> Solaris for now then?

configure should probe for xc_gnttab symbols and disable Xen if these
are not found.

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