* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
[not found] ` <200507291647.49230.jkim@niksun.com>
@ 2005-07-30 0:22 ` Jung-uk Kim
2005-07-30 11:57 ` Mars G. Miro
0 siblings, 1 reply; 10+ messages in thread
From: Jung-uk Kim @ 2005-07-30 0:22 UTC (permalink / raw)
To: freebsd-emulation; +Cc: qemu-devel, Juergen Lock, Mars G. Miro
[-- Attachment #1: Type: text/plain, Size: 387 bytes --]
Okay. I finally found a fix. It was actually quite simple. Newer
FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
in legacy ATA mode (aka PATA mode). The test failed and it was
treated like a SATA controller. Of course, IRQ failed to map. ;-)
Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
FreeBSD/amd64 host.
Cheers,
Jung-uk Kim
[-- Attachment #2: ide.diff --]
[-- Type: text/plain, Size: 411 bytes --]
--- qemu-0.7.1/hw/ide.c.orig Sun Jul 24 14:52:08 2005
+++ qemu-0.7.1/hw/ide.c Fri Jul 29 20:03:51 2005
@@ -2330,6 +2330,7 @@
pci_conf[0x01] = 0x80;
pci_conf[0x02] = 0x10;
pci_conf[0x03] = 0x70;
+ pci_conf[0x09] = 0x80; // legacy ATA mode
pci_conf[0x0a] = 0x01; // class_sub = PCI_IDE
pci_conf[0x0b] = 0x01; // class_base = PCI_mass_storage
pci_conf[0x0e] = 0x00; // header_type
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-07-30 0:22 ` [Qemu-devel] Re: ata devices on emulated amd64 on qemu Jung-uk Kim
@ 2005-07-30 11:57 ` Mars G. Miro
2005-08-01 2:57 ` Mars G. Miro
0 siblings, 1 reply; 10+ messages in thread
From: Mars G. Miro @ 2005-07-30 11:57 UTC (permalink / raw)
To: Jung-uk Kim; +Cc: freebsd-emulation, Juergen Lock, qemu-devel
On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> Okay. I finally found a fix. It was actually quite simple. Newer
> FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
> in legacy ATA mode (aka PATA mode). The test failed and it was
> treated like a SATA controller. Of course, IRQ failed to map. ;-)
> Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
> FreeBSD/amd64 host.
>
You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
FreeBSD54/amd64 Host.
Any thoughts of including this patch in the ports?
> Cheers,
>
> Jung-uk Kim
>
>
cheers
mars
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-07-30 11:57 ` Mars G. Miro
@ 2005-08-01 2:57 ` Mars G. Miro
2005-08-01 3:30 ` Mars G. Miro
0 siblings, 1 reply; 10+ messages in thread
From: Mars G. Miro @ 2005-08-01 2:57 UTC (permalink / raw)
To: Jung-uk Kim; +Cc: freebsd-emulation, Juergen Lock, qemu-devel
On 7/30/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> > Okay. I finally found a fix. It was actually quite simple. Newer
> > FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
> > in legacy ATA mode (aka PATA mode). The test failed and it was
> > treated like a SATA controller. Of course, IRQ failed to map. ;-)
> > Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
> > FreeBSD/amd64 host.
> >
>
>
> You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
> FreeBSD54/amd64 Host.
>
> Any thoughts of including this patch in the ports?
>
>
Oops. I noticed only now that this time, it's the emulated NE2000 NIC
that's not detected. This is for a FreeBSD/amd64 guest on
FreeBSD/amd64 Host.
Thanks.
> > Cheers,
> >
> > Jung-uk Kim
> >
> >
>
>
cheers
mars
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-01 2:57 ` Mars G. Miro
@ 2005-08-01 3:30 ` Mars G. Miro
2005-08-01 9:30 ` Mars G. Miro
0 siblings, 1 reply; 10+ messages in thread
From: Mars G. Miro @ 2005-08-01 3:30 UTC (permalink / raw)
To: Jung-uk Kim; +Cc: freebsd-emulation, Juergen Lock, qemu-devel
On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> On 7/30/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> > > Okay. I finally found a fix. It was actually quite simple. Newer
> > > FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
> > > in legacy ATA mode (aka PATA mode). The test failed and it was
> > > treated like a SATA controller. Of course, IRQ failed to map. ;-)
> > > Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
> > > FreeBSD/amd64 host.
> > >
> >
> >
> > You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
> > FreeBSD54/amd64 Host.
> >
> > Any thoughts of including this patch in the ports?
> >
> >
>
>
> Oops. I noticed only now that this time, it's the emulated NE2000 NIC
> that's not detected. This is for a FreeBSD/amd64 guest on
> FreeBSD/amd64 Host.
>
Scratch that.
This is only because there's no ed in the GENERIC kernel for AMD64.
Thanks.
> Thanks.
>
>
> > > Cheers,
> > >
> > > Jung-uk Kim
> > >
> > >
> >
> >
>
cheers
mars
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-01 3:30 ` Mars G. Miro
@ 2005-08-01 9:30 ` Mars G. Miro
2005-08-01 21:54 ` Juergen Lock
0 siblings, 1 reply; 10+ messages in thread
From: Mars G. Miro @ 2005-08-01 9:30 UTC (permalink / raw)
To: Jung-uk Kim; +Cc: freebsd-emulation, Juergen Lock, qemu-devel
On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > On 7/30/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> > > > Okay. I finally found a fix. It was actually quite simple. Newer
> > > > FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
>
> > > > in legacy ATA mode (aka PATA mode). The test failed and it was
> > > > treated like a SATA controller. Of course, IRQ failed to map. ;-)
> > > > Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
>
> > > > FreeBSD/amd64 host.
> > > >
> > >
> > >
> > > You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
> > > FreeBSD54/amd64 Host.
> > >
> > > Any thoughts of including this patch in the ports?
> > >
> > >
> >
> >
> > Oops. I noticed only now that this time, it's the emulated NE2000 NIC
> > that's not detected. This is for a FreeBSD/amd64 guest on
> > FreeBSD/amd64 Host.
> >
>
>
> Scratch that.
>
> This is only because there's no ed in the GENERIC kernel for AMD64.
>
because we dropped support for it?
cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -Wall
-Wredundant-decls -Wnested-externs -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-
arith -Winline -Wcast-qual -fformat-extensions -std=c99 -nostdinc
-I- -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica
-I/usr/src/sys/contrib/a
ltq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf
-I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd
-I/usr/src/sys/con
trib/ngatm -D_KERNEL -include opt_global.h -fno-common
-finline-limit=8000 --param inline-unit-growth=100 --param
large-function-growth=1000 -mcmodel
=kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx
-mno-3dnow -msoft-float -fno-asynchronous-unwind-tables
-ffreestanding -Werror /usr/
src/sys/dev/ed/if_ed.c
/usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_WD80x3_generic':
/usr/src/sys/dev/ed/if_ed.c:508: warning: implicit declaration of
function `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:521: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c:532: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c:539: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c:547: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c:570: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_3Com':
/usr/src/sys/dev/ed/if_ed.c:905: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
/usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_SIC':
/usr/src/sys/dev/ed/if_ed.c:998: warning: nested extern declaration of `kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
/usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
declaration of 'kvtop' was here
*** Error code 1
ugh :-(
> Thanks.
>
>
>
> > Thanks.
> >
> >
> > > > Cheers,
> > > >
> > > > Jung-uk Kim
> > > >
> > > >
> > >
> > >
> >
>
>
>
>
cheers
mars
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-01 9:30 ` Mars G. Miro
@ 2005-08-01 21:54 ` Juergen Lock
2005-08-02 6:53 ` Mars G. Miro
0 siblings, 1 reply; 10+ messages in thread
From: Juergen Lock @ 2005-08-01 21:54 UTC (permalink / raw)
To: Mars G. Miro; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim
On Mon, Aug 01, 2005 at 05:30:47PM +0800, Mars G. Miro wrote:
> On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > On 7/30/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > > On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> > > > > Okay. I finally found a fix. It was actually quite simple. Newer
> > > > > FreeBSD and Linux ATA drivers check whether the PCI ATA controller is
> >
> > > > > in legacy ATA mode (aka PATA mode). The test failed and it was
> > > > > treated like a SATA controller. Of course, IRQ failed to map. ;-)
> > > > > Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest on
> >
> > > > > FreeBSD/amd64 host.
> > > > >
> > > >
> > > >
> > > > You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
> > > > FreeBSD54/amd64 Host.
> > > >
> > > > Any thoughts of including this patch in the ports?
> > > >
> > > >
> > >
> > >
> > > Oops. I noticed only now that this time, it's the emulated NE2000 NIC
> > > that's not detected. This is for a FreeBSD/amd64 guest on
> > > FreeBSD/amd64 Host.
> > >
> >
> >
> > Scratch that.
> >
> > This is only because there's no ed in the GENERIC kernel for AMD64.
> >
>
> because we dropped support for it?
>
> cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -Wall
> -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> -Wmissing-prototypes -Wpointer-
> arith -Winline -Wcast-qual -fformat-extensions -std=c99 -nostdinc
> -I- -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica
> -I/usr/src/sys/contrib/a
> ltq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf
> -I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd
> -I/usr/src/sys/con
> trib/ngatm -D_KERNEL -include opt_global.h -fno-common
> -finline-limit=8000 --param inline-unit-growth=100 --param
> large-function-growth=1000 -mcmodel
> =kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx
> -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables
> -ffreestanding -Werror /usr/
> src/sys/dev/ed/if_ed.c
> /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_WD80x3_generic':
> /usr/src/sys/dev/ed/if_ed.c:508: warning: implicit declaration of
> function `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:521: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c:532: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c:539: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c:547: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c:570: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_3Com':
> /usr/src/sys/dev/ed/if_ed.c:905: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_SIC':
> /usr/src/sys/dev/ed/if_ed.c:998: warning: nested extern declaration of `kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of 'kvtop'
> /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> declaration of 'kvtop' was here
> *** Error code 1
>
> ugh :-(
Aha, amd64 doesnt have kvtop anymore. Try the following patch:
(compiles on i386, it should fix amd64 if you are lucky - as long as
kvtop is the only problem...)
Index: if_ed.c
@@ -205,7 +205,7 @@
int i;
u_int memsize, maddr;
u_char iptr, isa16bit, sum, totalsum;
- u_long conf_maddr, conf_msize, irq, junk;
+ u_long conf_maddr, conf_msize, irq, junk, mphys;
sc->chip_type = ED_CHIP_TYPE_DP8390;
@@ -474,6 +474,7 @@
return (error);
}
sc->mem_start = (caddr_t) rman_get_virtual(sc->mem_res);
+ mphys = rman_get_start(sc->mem_res);
/*
* allocate one xmit buffer if < 16k, two buffers otherwise
@@ -505,7 +506,7 @@
sc->wd_laar_proto = ed_asic_inb(sc, ED_WD_LAAR);
} else {
sc->wd_laar_proto = ED_WD_LAAR_L16EN |
- ((kvtop(sc->mem_start) >> 19) & ED_WD_LAAR_ADDRHI);
+ ((mphys >> 19) & ED_WD_LAAR_ADDRHI);
}
/*
* Enable 16bit access
@@ -518,7 +519,7 @@
(sc->type == ED_TYPE_TOSHIBA4) ||
(sc->type == ED_TYPE_WD8013EBT)) &&
(sc->chip_type != ED_CHIP_TYPE_WD790)) {
- sc->wd_laar_proto = (kvtop(sc->mem_start) >> 19) &
+ sc->wd_laar_proto = (mphys >> 19) &
ED_WD_LAAR_ADDRHI;
ed_asic_outb(sc, ED_WD_LAAR, sc->wd_laar_proto);
}
@@ -530,22 +531,22 @@
if (sc->chip_type != ED_CHIP_TYPE_WD790) {
if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_TOSH_ETHER) {
ed_asic_outb(sc, ED_WD_MSR + 1,
- ((kvtop(sc->mem_start) >> 8) & 0xe0) | 4);
+ ((mphys >> 8) & 0xe0) | 4);
ed_asic_outb(sc, ED_WD_MSR + 2,
- ((kvtop(sc->mem_start) >> 16) & 0x0f));
+ ((mphys >> 16) & 0x0f));
ed_asic_outb(sc, ED_WD_MSR,
ED_WD_MSR_MENB | ED_WD_MSR_POW);
} else {
ed_asic_outb(sc, ED_WD_MSR,
- ((kvtop(sc->mem_start) >> 13) &
+ ((mphys >> 13) &
ED_WD_MSR_ADDR) | ED_WD_MSR_MENB);
}
sc->cr_proto = ED_CR_RD2;
} else {
ed_asic_outb(sc, ED_WD_MSR, ED_WD_MSR_MENB);
ed_asic_outb(sc, ED_WD790_HWR, (ed_asic_inb(sc, ED_WD790_HWR) | ED_WD790_HWR_SWH));
- ed_asic_outb(sc, ED_WD790_RAR, ((kvtop(sc->mem_start) >> 13) & 0x0f) |
- ((kvtop(sc->mem_start) >> 11) & 0x40) |
+ ed_asic_outb(sc, ED_WD790_RAR, ((mphys >> 13) & 0x0f) |
+ ((mphys >> 11) & 0x40) |
(ed_asic_inb(sc, ED_WD790_RAR) & 0xb0));
ed_asic_outb(sc, ED_WD790_HWR, (ed_asic_inb(sc, ED_WD790_HWR) & ~ED_WD790_HWR_SWH));
sc->cr_proto = 0;
@@ -567,7 +568,7 @@
for (i = 0; i < memsize; ++i) {
if (sc->mem_start[i]) {
device_printf(dev, "failed to clear shared memory at %jx - check configuration\n",
- (uintmax_t)kvtop(sc->mem_start + i));
+ (uintmax_t)mphys + i);
/*
* Disable 16 bit access to shared memory
@@ -902,7 +903,7 @@
for (i = 0; i < memsize; ++i)
if (sc->mem_start[i]) {
device_printf(dev, "failed to clear shared memory at %jx - check configuration\n",
- (uintmax_t)kvtop(sc->mem_start + i));
+ (uintmax_t)rman_get_start(sc->mem_res) + i);
return (ENXIO);
}
return (0);
@@ -995,7 +996,7 @@
if (sc->mem_start[i]) {
device_printf(dev, "failed to clear shared memory "
"at %jx - check configuration\n",
- (uintmax_t)kvtop(sc->mem_start + i));
+ (uintmax_t)rman_get_start(sc->mem_res) + i);
return (ENXIO);
}
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-01 21:54 ` Juergen Lock
@ 2005-08-02 6:53 ` Mars G. Miro
2005-08-02 21:22 ` Juergen Lock
0 siblings, 1 reply; 10+ messages in thread
From: Mars G. Miro @ 2005-08-02 6:53 UTC (permalink / raw)
To: Juergen Lock, Jung-uk Kim, freebsd-emulation, qemu-devel
On 8/2/05, Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> On Mon, Aug 01, 2005 at 05:30:47PM +0800, Mars G. Miro wrote:
> > On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > On 8/1/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > > On 7/30/05, Mars G. Miro <marsgmiro@gmail.com> wrote:
> > > > > On 7/30/05, Jung-uk Kim <jkim@freebsd.org> wrote:
> > > > > > Okay. I finally found a fix. It was actually quite simple.
> Newer
> > > > > > FreeBSD and Linux ATA drivers check whether the PCI ATA controller
> is
> > >
> > > > > > in legacy ATA mode (aka PATA mode). The test failed and it was
> > > > > > treated like a SATA controller. Of course, IRQ failed to map. ;-)
>
> > > > > > Try the attached patch. Tested with FreeBSD/amd64 6.0-BETA1 guest
> on
> > >
> > > > > > FreeBSD/amd64 host.
> > > > > >
> > > > >
> > > > >
> > > > > You rock dude! This patch fixes it. FreeBSD54/amd64 Guest on
> > > > > FreeBSD54/amd64 Host.
> > > > >
> > > > > Any thoughts of including this patch in the ports?
> > > > >
> > > > >
> > > >
> > > >
> > > > Oops. I noticed only now that this time, it's the emulated NE2000 NIC
> > > > that's not detected. This is for a FreeBSD/amd64 guest on
> > > > FreeBSD/amd64 Host.
> > > >
> > >
> > >
> > > Scratch that.
> > >
> > > This is only because there's no ed in the GENERIC kernel for AMD64.
> > >
> >
> > because we dropped support for it?
> >
> > cc -c -O2 -frename-registers -pipe -fno-strict-aliasing -Wall
> > -Wredundant-decls -Wnested-externs -Wstrict-prototypes
> > -Wmissing-prototypes -Wpointer-
> > arith -Winline -Wcast-qual -fformat-extensions -std=c99 -nostdinc
> > -I- -I. -I/usr/src/sys -I/usr/src/sys/contrib/dev/acpica
> > -I/usr/src/sys/contrib/a
> > ltq -I/usr/src/sys/contrib/ipfilter -I/usr/src/sys/contrib/pf
> > -I/usr/src/sys/contrib/dev/ath -I/usr/src/sys/contrib/dev/ath/freebsd
> > -I/usr/src/sys/con
> > trib/ngatm -D_KERNEL -include opt_global.h -fno-common
> > -finline-limit=8000 --param inline-unit-growth=100 --param
> > large-function-growth=1000 -mcmodel
> > =kernel -mno-red-zone -mfpmath=387 -mno-sse -mno-sse2 -mno-mmx
> > -mno-3dnow -msoft-float -fno-asynchronous-unwind-tables
> > -ffreestanding -Werror /usr/
> > src/sys/dev/ed/if_ed.c
> > /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_WD80x3_generic':
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: implicit declaration of
> > function `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:521: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c:532: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c:539: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c:547: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c:570: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_3Com':
> > /usr/src/sys/dev/ed/if_ed.c:905: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_SIC':
> > /usr/src/sys/dev/ed/if_ed.c:998: warning: nested extern declaration of
> `kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> 'kvtop'
> > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > declaration of 'kvtop' was here
> > *** Error code 1
> >
> > ugh :-(
>
> Aha, amd64 doesnt have kvtop anymore. Try the following patch:
> (compiles on i386, it should fix amd64 if you are lucky - as long as
> kvtop is the only problem...)
>
Tried this patch. It does seem to work.
But there are other problems in emulated amd64 --- such as segfaults
here and there --- they seem to occur at random. This is for
{5.4/6.01-Beta} AMD64.
Thanks.
> Index: if_ed.c
> @@ -205,7 +205,7 @@
> int i;
> u_int memsize, maddr;
> u_char iptr, isa16bit, sum, totalsum;
> - u_long conf_maddr, conf_msize, irq, junk;
> + u_long conf_maddr, conf_msize, irq, junk, mphys;
>
> sc->chip_type = ED_CHIP_TYPE_DP8390;
>
> @@ -474,6 +474,7 @@
> return (error);
> }
> sc->mem_start = (caddr_t) rman_get_virtual(sc->mem_res);
> + mphys = rman_get_start(sc->mem_res);
>
> /*
> * allocate one xmit buffer if < 16k, two buffers otherwise
> @@ -505,7 +506,7 @@
> sc->wd_laar_proto = ed_asic_inb(sc, ED_WD_LAAR);
> } else {
> sc->wd_laar_proto = ED_WD_LAAR_L16EN |
> - ((kvtop(sc->mem_start) >> 19) & ED_WD_LAAR_ADDRHI);
> + ((mphys >> 19) & ED_WD_LAAR_ADDRHI);
> }
> /*
> * Enable 16bit access
> @@ -518,7 +519,7 @@
> (sc->type == ED_TYPE_TOSHIBA4) ||
> (sc->type == ED_TYPE_WD8013EBT)) &&
> (sc->chip_type != ED_CHIP_TYPE_WD790)) {
> - sc->wd_laar_proto = (kvtop(sc->mem_start) >> 19) &
> + sc->wd_laar_proto = (mphys >> 19) &
> ED_WD_LAAR_ADDRHI;
> ed_asic_outb(sc, ED_WD_LAAR, sc->wd_laar_proto);
> }
> @@ -530,22 +531,22 @@
> if (sc->chip_type != ED_CHIP_TYPE_WD790) {
> if (ED_FLAGS_GETTYPE(flags) == ED_FLAGS_TOSH_ETHER) {
> ed_asic_outb(sc, ED_WD_MSR + 1,
> - ((kvtop(sc->mem_start) >> 8) & 0xe0) | 4);
> + ((mphys >> 8) & 0xe0) | 4);
> ed_asic_outb(sc, ED_WD_MSR + 2,
> - ((kvtop(sc->mem_start) >> 16) & 0x0f));
> + ((mphys >> 16) & 0x0f));
> ed_asic_outb(sc, ED_WD_MSR,
> ED_WD_MSR_MENB | ED_WD_MSR_POW);
> } else {
> ed_asic_outb(sc, ED_WD_MSR,
> - ((kvtop(sc->mem_start) >> 13) &
> + ((mphys >> 13) &
> ED_WD_MSR_ADDR) | ED_WD_MSR_MENB);
> }
> sc->cr_proto = ED_CR_RD2;
> } else {
> ed_asic_outb(sc, ED_WD_MSR, ED_WD_MSR_MENB);
> ed_asic_outb(sc, ED_WD790_HWR, (ed_asic_inb(sc, ED_WD790_HWR) |
> ED_WD790_HWR_SWH));
> - ed_asic_outb(sc, ED_WD790_RAR, ((kvtop(sc->mem_start) >> 13) & 0x0f) |
> - ((kvtop(sc->mem_start) >> 11) & 0x40) |
> + ed_asic_outb(sc, ED_WD790_RAR, ((mphys >> 13) & 0x0f) |
> + ((mphys >> 11) & 0x40) |
> (ed_asic_inb(sc, ED_WD790_RAR) & 0xb0));
> ed_asic_outb(sc, ED_WD790_HWR, (ed_asic_inb(sc, ED_WD790_HWR) &
> ~ED_WD790_HWR_SWH));
> sc->cr_proto = 0;
> @@ -567,7 +568,7 @@
> for (i = 0; i < memsize; ++i) {
> if (sc->mem_start[i]) {
> device_printf(dev, "failed to clear shared memory at %jx - check
> configuration\n",
> - (uintmax_t)kvtop(sc->mem_start + i));
> + (uintmax_t)mphys + i);
>
> /*
> * Disable 16 bit access to shared memory
> @@ -902,7 +903,7 @@
> for (i = 0; i < memsize; ++i)
> if (sc->mem_start[i]) {
> device_printf(dev, "failed to clear shared memory at %jx - check
> configuration\n",
> - (uintmax_t)kvtop(sc->mem_start + i));
> + (uintmax_t)rman_get_start(sc->mem_res) + i);
> return (ENXIO);
> }
> return (0);
> @@ -995,7 +996,7 @@
> if (sc->mem_start[i]) {
> device_printf(dev, "failed to clear shared memory "
> "at %jx - check configuration\n",
> - (uintmax_t)kvtop(sc->mem_start + i));
> + (uintmax_t)rman_get_start(sc->mem_res) + i);
>
> return (ENXIO);
> }
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-02 6:53 ` Mars G. Miro
@ 2005-08-02 21:22 ` Juergen Lock
2005-08-02 21:55 ` Jung-uk Kim
2005-08-03 2:07 ` Mars G. Miro
0 siblings, 2 replies; 10+ messages in thread
From: Juergen Lock @ 2005-08-02 21:22 UTC (permalink / raw)
To: Mars G. Miro; +Cc: freebsd-emulation, qemu-devel, Jung-uk Kim
On Tue, Aug 02, 2005 at 02:53:22PM +0800, Mars G. Miro wrote:
> On 8/2/05, Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> > On Mon, Aug 01, 2005 at 05:30:47PM +0800, Mars G. Miro wrote:
>[...]
> > > /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_SIC':
> > > /usr/src/sys/dev/ed/if_ed.c:998: warning: nested extern declaration of
> > `kvtop'
> > > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> > 'kvtop'
> > > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > > declaration of 'kvtop' was here
> > > *** Error code 1
> > >
> > > ugh :-(
> >
> > Aha, amd64 doesnt have kvtop anymore. Try the following patch:
> > (compiles on i386, it should fix amd64 if you are lucky - as long as
> > kvtop is the only problem...)
> >
>
> Tried this patch. It does seem to work.
>
So you got the network up? ok. (should the patch be included in 6.0
and ed be re-added to GENERIC and the install kernel on amd64, for
amd64 guests to have network with qemu?)
> But there are other problems in emulated amd64 --- such as segfaults
> here and there --- they seem to occur at random. This is for
> {5.4/6.01-Beta} AMD64.
>
with or without kqemu?
cheers,
Juergen
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-02 21:22 ` Juergen Lock
@ 2005-08-02 21:55 ` Jung-uk Kim
2005-08-03 2:07 ` Mars G. Miro
1 sibling, 0 replies; 10+ messages in thread
From: Jung-uk Kim @ 2005-08-02 21:55 UTC (permalink / raw)
To: Juergen Lock; +Cc: freebsd-emulation, Mars G. Miro, qemu-devel
On Tuesday 02 August 2005 05:22 pm, Juergen Lock wrote:
> So you got the network up? ok. (should the patch be included in
> 6.0 and ed be re-added to GENERIC and the install kernel on amd64,
> for amd64 guests to have network with qemu?)
It's already MFC'd and ed(4) will be available in 6.0-BETA2 release:
http://docs.freebsd.org/cgi/mid.cgi?200507291540.j6TFex5N069026
Jung-uk Kim
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Qemu-devel] Re: ata devices on emulated amd64 on qemu
2005-08-02 21:22 ` Juergen Lock
2005-08-02 21:55 ` Jung-uk Kim
@ 2005-08-03 2:07 ` Mars G. Miro
1 sibling, 0 replies; 10+ messages in thread
From: Mars G. Miro @ 2005-08-03 2:07 UTC (permalink / raw)
To: Juergen Lock, Jung-uk Kim, freebsd-emulation, qemu-devel
On 8/3/05, Juergen Lock <nox@jelal.kn-bremen.de> wrote:
> On Tue, Aug 02, 2005 at 02:53:22PM +0800, Mars G. Miro wrote:
> > On 8/2/05, Juergen Lock <qemu-l@jelal.kn-bremen.de> wrote:
> > > On Mon, Aug 01, 2005 at 05:30:47PM +0800, Mars G. Miro wrote:
> >[...]
>
> > > > /usr/src/sys/dev/ed/if_ed.c: In function `ed_probe_SIC':
> > > > /usr/src/sys/dev/ed/if_ed.c:998: warning: nested extern declaration
> of
> > > `kvtop'
> > > > /usr/src/sys/dev/ed/if_ed.c:508: warning: redundant redeclaration of
> > > 'kvtop'
> > > > /usr/src/sys/dev/ed/if_ed.c:508: warning: previous implicit
> > > > declaration of 'kvtop' was here
> > > > *** Error code 1
> > > >
> > > > ugh :-(
> > >
> > > Aha, amd64 doesnt have kvtop anymore. Try the following patch:
> > > (compiles on i386, it should fix amd64 if you are lucky - as long as
> > > kvtop is the only problem...)
> > >
> >
> > Tried this patch. It does seem to work.
> >
> So you got the network up? ok. (should the patch be included in 6.0
> and ed be re-added to GENERIC and the install kernel on amd64, for
> amd64 guests to have network with qemu?)
>
Yep.
But, as I've said I'm experiencing segfaults everywhere (df, dmesg,
ls, etc) --- but I think this might be a qemu problem. Yesterday, I
tried slamd64 (slackware amd64 version), and it crashed in the middle
of installing packages.
> > But there are other problems in emulated amd64 --- such as segfaults
> > here and there --- they seem to occur at random. This is for
> > {5.4/6.01-Beta} AMD64.
> >
> with or without kqemu?
>
w/o kqemu... hmm this looks interesting ;-)
Thanks.
> cheers,
> Juergen
>
cheers
mars
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-08-03 2:37 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <28edec3c0507290000415a350d@mail.gmail.com>
[not found] ` <200507291540.52889.jkim@niksun.com>
[not found] ` <200507291647.49230.jkim@niksun.com>
2005-07-30 0:22 ` [Qemu-devel] Re: ata devices on emulated amd64 on qemu Jung-uk Kim
2005-07-30 11:57 ` Mars G. Miro
2005-08-01 2:57 ` Mars G. Miro
2005-08-01 3:30 ` Mars G. Miro
2005-08-01 9:30 ` Mars G. Miro
2005-08-01 21:54 ` Juergen Lock
2005-08-02 6:53 ` Mars G. Miro
2005-08-02 21:22 ` Juergen Lock
2005-08-02 21:55 ` Jung-uk Kim
2005-08-03 2:07 ` Mars G. Miro
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).