Date: Sat, 20 Apr 2013 01:39:41 +0800 From: Bei Guan <gbtju85@gmail.com> To: "Justin T. Gibbs" <gibbs@freebsd.org> Cc: soc-status <soc-status@freebsd.org> Subject: =?GB2312?Q?Re=3A_Mentor_of_the_Project_=22PCI_frontend_XEN_PV_drive?= =?GB2312?Q?r=22=A3=BF?= Message-ID: <CAEQjb-QrkQ=YonzE8UZ==ikhYajTykoK9%2Bmy7S9NXXypw5fGSA@mail.gmail.com> In-Reply-To: <ED92E995-92D0-430B-BF0F-5795C534B63D@freebsd.org> References: <CAEQjb-RV30H9h8_tO%2BC0SkWAOi0DNF3G9xzpNFkj1_OKR%2ByLkw@mail.gmail.com> <920A79FE-8C56-4D26-8611-3CD48602FC3B@freebsd.org> <CAEQjb-QGktoBNHAF4JqwyzJy01dO49b59chJ4k6WCrs_8FYnhQ@mail.gmail.com> <7AB96913-9118-4298-B183-A3D5EBC6F209@freebsd.org> <CAEQjb-R1C17f4t_eoe5gYkqSv%2BJD%2Bmahr%2Bx9qXBJ%2BNKsJLSJ5A@mail.gmail.com> <ED92E995-92D0-430B-BF0F-5795C534B63D@freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 2013/4/19 Justin T. Gibbs <gibbs@freebsd.org> > On Apr 18, 2013, at 7:14 AM, Bei Guan <gbtju85@gmail.com> wrote: > > 2013/4/16 Justin T. Gibbs <gibbs@freebsd.org> > >> On Apr 12, 2013, at 3:02 AM, Bei Guan <gbtju85@gmail.com> wrote: >> >> > Thank you for your reply. >> > >> > I think it's also a good project for me to write a SCSI or USB PV >> frontend for FreeBSD. I'm interest in Xen and have done some development >> about Xen PV and HVM, but I didn't do any development on FreeBSD. As to >> this project, where should I start? Is there any other similar FreeBSD >> project I can refer to? >> >> Front-end drivers for network, block, and control already exist and >> should serve as a good starting point for the creation of another PV driver. >> >> I've also updated the ideas page to include more information about our >> existing XEN implementation and what will be required for these projects. >> >> > In order to write a SCSI or USB PV driver, do we need the Xen PV >> drivers in FreeBSD, such as event channel, hypercalls, xenbus, and so on? >> >> Yes, FreeBSD already has support for all XenBus APIs needed to write >> these drivers. See "sys/xen" and "sys/dev/xen" in the FreeBSD kernel >> source tree. >> >> > You said the "drivers can be developed using an HVM guest", can you >> give me more information about it? >> >> Typically, you install FreeBSD using standard install media as a full HVM >> guest on a system running Xen. Then compile a custom kernel using the >> XENHVM config file in order to activate the existing PV drivers. >> > Hi Justin, > > Does this project need to provide USB/SCSI PV drivers to both 32-bit and > 64-bit FreeBSD? > > > Idealy, yes. > > I've compiled the FreeBSD 8.3 (i386) as Xen DomU with the XENHVM config. > But, It cannot boot successfully. The screenshot is attached. > According to the page https://wiki.freebsd.org/FreeBSD/Xen , 32-bit > FreeBSD should work when compiled with XENHVM config. > > > I have never tried a 32bit XENHVM configuration, but I know of no reasons > why it should not work. The issue shown by your screen shot (in your other > email) is probably due to a PV driver failing to fully attach, or a mistake > in the merge of SVN changeset 211236 to releng-8. I would suggest > instrumenting sys/xen/xenbus/xenbusb.c to determine the driver that is > still holding up the root mount process and then go from there. See > xenbusb_attach() and xenbusb_nop_confighook_cb() for details. > > You may also want to invest in changing your Xen configuration to use a > serial console. This will allow you to properly log and examine all kernel > messages emitted during your test runs. > Hi Justin, The 64bit FreeBSD 8.3 with the XENHVM configure also cannot boot. I have got the boot log using a serial console. All the two logs are attached. My environment is Xen-4.2 + ubuntu10.04 (Dom0 installed with the package : linux-image-2.6.32-5-xen-amd64_2.6.32-35_amd64.deb). I will inspect it more tomorrow. Thanks for your information. > I will try the 64-bit FreeBSD. However, if the FreeBSD boot successfully > (compiled with XENHVM config), how can we know it really uses the PV > drivers instead of the native drivers? > > > Your configuration is definitely using PV drivers. xenbusb_front, xn, and > xbd, are all PV drivers. > > -- > Justin > -- Best Regards, Bei Guan [-- Attachment #2 --] Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.3-RELEASE #0: Sat Apr 20 01:29:31 CST 2013 root@freebsd.iscas:/usr/obj/usr/src/sys/XENHVM amd64 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz (3392.31-MHz K8-class CPU) Origin = "GenuineIntel" Id = 0x206a7 Family = 6 Model = 2a Stepping = 7 Features=0x1783fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE,SSE2,HTT> Features2=0x97ba2203<SSE3,PCLMULQDQ,SSSE3,CX16,PCID,SSE4.1,SSE4.2,x2APIC,POPCNT,TSCDLT,AESNI,XSAVE,AVX,HV> AMD Features=0x28100800<SYSCALL,NX,RDTSCP,LM> AMD Features2=0x1<LAHF> TSC: P-state invariant real memory = 1065353216 (1016 MB) avail memory = 1008078848 (961 MB) ACPI APIC Table: <Xen HVM> ioapic0: Changing APIC ID to 1 MADT: Forcing active-low polarity and level trigger for SCI ioapic0 <Version 1.1> irqs 0-47 on motherboard kbd1 at kbdmux0 acpi0: <Xen> on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi0: Sleep Button (fixed) Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: <ACPI CPU> on acpi0 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0 pci0: <ACPI PCI bus> on pcib0 isab0: <PCI-ISA bridge> at device 1.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <Intel PIIX3 WDMA2 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc220-0xc22f at device 1.1 on pci0 ata0: <ATA channel> at channel 0 on atapci0 ata0: [ITHREAD] ata1: <ATA channel> at channel 1 on atapci0 ata1: [ITHREAD] uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc200-0xc21f irq 23 at device 1.2 on pci0 uhci0: [ITHREAD] usbus0: controller did not stop usbus0: <Intel 82371SB (PIIX3) USB controller> on uhci0 pci0: <bridge> at device 1.3 (no driver attached) vgapci0: <VGA-compatible display> mem 0xf0000000-0xf1ffffff,0xf3000000-0xf3000fff at device 2.0 on pci0 xenpci0: <Xen Platform Device> port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 28 at device 3.0 on pci0 xenstore0: <XenStore> on xenpci0 acpi_hpet0: <High Precision Event Timer> iomem 0xfed00000-0xfed003ff on acpi0 Timecounter "HPET" frequency 62500000 Hz quality 900 atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0 atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0 atkbd0: <AT Keyboard> irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4 fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: does not respond device_attach: fdc0 attach returned 6 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: [FILTER] uart0: console (9600,n,8,1) ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0 ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode ppc0: [ITHREAD] ppbus0: <Parallel port bus> on ppc0 plip0: <PLIP network interface> on ppbus0 plip0: [ITHREAD] lpt0: <Printer> on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 3392308745 Hz quality 800 Timecounters tick every 10.000 msec usbus0: 12Mbps Full Speed USB v1.0 acd0: CDROM <QEMU DVD-ROM/0.10.2> at ata1-master WDMA2 xenbusb_front0: <Xen Frontend Devices> on xenstore0 Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0xffffff010167d95f fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff80885d38 stack pointer = 0x28:0xffffffff80f9d9f0 frame pointer = 0x28:0xffffffff80f9da30 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 0 (swapper) trap number = 12 panic: page fault cpuid = 0 KDB: stack backtrace: #0 0xffffffff8063ed9e at kdb_backtrace+0x5e #1 0xffffffff8060c247 at panic+0x187 #2 0xffffffff80922fe0 at trap_fatal+0x290 #3 0xffffffff80923331 at trap_pfault+0x201 #4 0xffffffff809237ef at trap+0x3df #5 0xffffffff8090ad14 at calltrap+0x8 #6 0xffffffff80887bda at xs_directory+0x7a #7 0xffffffff80887e35 at xs_exists+0x15 #8 0xffffffff80883fdc at xenbusb_add_device+0x9c #9 0xffffffff8088525b at xenbusb_front_enumerate_type+0x5b #10 0xffffffff8088501e at xenbusb_attach+0xfe #11 0xffffffff806388c9 at device_attach+0x69 #12 0xffffffff8063a09a at bus_generic_attach+0x1a #13 0xffffffff80885d01 at xs_attach_deferred+0x21 #14 0xffffffff80633ebb at run_interrupt_driven_config_hooks+0xab #15 0xffffffff8063422c at boot_run_interrupt_driven_config_hooks+0x2c #16 0xffffffff805c4097 at mi_startup+0x77 #17 0xffffffff801a107c at btext+0x2c Uptime: 1s Cannot dump. Device not defined or unavailable. Automatic reboot in 15 seconds - press a key on the console to abort --> Press a key on the console to reboot, --> or switch off the system now. [-- Attachment #3 --] Using config file "./freebsd.hvm". Started domain freebsd-8.3 (id=42) Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994 The Regents of the University of California. All rights reserved. FreeBSD is a registered trademark of The FreeBSD Foundation. FreeBSD 8.3-RELEASE #0: Fri Apr 19 16:34:50 CST 2013 root@freebsd.iscas:/usr/obj/usr/src/sys/XENHVM i386 Timecounter "i8254" frequency 1193182 Hz quality 0 CPU: Intel(R) Core(TM)2 Quad CPU Q9400 @ 2.66GHz (2659.74-MHz 686-class CPU) Origin = "GenuineIntel" Id = 0x1067a Family = 6 Model = 17 Stepping = 10 Features=0x1781fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,MMX,FXSR,SSE,SSE2,HTT> Features2=0x81282201<SSE3,SSSE3,CX16,SSE4.1,x2APIC,TSCDLT,HV> AMD Features=0x100000<NX> TSC: P-state invariant real memory = 1073741824 (1024 MB) avail memory = 1032122368 (984 MB) ACPI APIC Table: <Xen HVM> ioapic0: Changing APIC ID to 1 MADT: Forcing active-low polarity and level trigger for SCI ioapic0 <Version 1.1> irqs 0-47 on motherboard kbd1 at kbdmux0 acpi0: <Xen> on motherboard acpi0: [ITHREAD] acpi0: Power Button (fixed) acpi0: Sleep Button (fixed) Timecounter "ACPI-safe" frequency 3579545 Hz quality 850 acpi_timer0: <32-bit timer at 3.579545MHz> port 0xb008-0xb00b on acpi0 cpu0: <ACPI CPU> on acpi0 pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0 pci0: <ACPI PCI bus> on pcib0 isab0: <PCI-ISA bridge> at device 1.0 on pci0 isa0: <ISA bus> on isab0 atapci0: <Intel PIIX3 WDMA2 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xc220-0xc22f at device 1.1 on pci0 ata0: <ATA channel> at channel 0 on atapci0 ata0: [ITHREAD] ata1: <ATA channel> at channel 1 on atapci0 ata1: [ITHREAD] uhci0: <Intel 82371SB (PIIX3) USB controller> port 0xc200-0xc21f irq 23 at device 1.2 on pci0 uhci0: [ITHREAD] usbus0: controller did not stop usbus0: <Intel 82371SB (PIIX3) USB controller> on uhci0 pci0: <bridge> at device 1.3 (no driver attached) vgapci0: <VGA-compatible display> mem 0xf0000000-0xf1ffffff,0xf3000000-0xf3000fff at device 2.0 on pci0 xenpci0: <Xen Platform Device> port 0xc000-0xc0ff mem 0xf2000000-0xf2ffffff irq 28 at device 3.0 on pci0 xenstore0: <XenStore> on xenpci0 re0: <RealTek 8139C+ 10/100BaseTX> port 0xc100-0xc1ff mem 0xf3001000-0xf30010ff irq 32 at device 4.0 on pci0 re0: Chip rev. 0x74800000 re0: MAC rev. 0x00000000 miibus0: <MII bus> on re0 rlphy0: <RealTek internal media interface> PHY 0 on miibus0 rlphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto, auto-flow re0: Ethernet address: 00:16:3e:55:db:fd re0: [FILTER] atrtc0: <AT realtime clock> port 0x70-0x71 irq 8 on acpi0 atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0 atkbd0: <AT Keyboard> irq 1 on atkbdc0 kbd0 at atkbd0 atkbd0: [GIANT-LOCKED] atkbd0: [ITHREAD] psm0: <PS/2 Mouse> irq 12 on atkbdc0 psm0: [GIANT-LOCKED] psm0: [ITHREAD] psm0: model IntelliMouse Explorer, device ID 4 fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0 fdc0: does not respond device_attach: fdc0 attach returned 6 uart0: <16550 or compatible> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0 uart0: [FILTER] uart0: console (9600,n,8,1) ppc0: <Parallel port> port 0x378-0x37f irq 7 on acpi0 ppc0: Generic chipset (NIBBLE-only) in COMPATIBLE mode ppc0: [ITHREAD] ppbus0: <Parallel port bus> on ppc0 plip0: <PLIP network interface> on ppbus0 plip0: [ITHREAD] lpt0: <Printer> on ppbus0 lpt0: [ITHREAD] lpt0: Interrupt-driven port ppi0: <Parallel I/O> on ppbus0 pmtimer0 on isa0 orm0: <ISA Option ROM> at iomem 0xc9000-0xc97ff pnpid ORM0000 on isa0 sc0: <System console> at flags 0x100 on isa0 sc0: VGA <16 virtual consoles, flags=0x300> vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0 Timecounter "TSC" frequency 2659738602 Hz quality 800 Timecounters tick every 10.000 msec usbus0: 12Mbps Full Speed USB v1.0 ad0: 25000MB <QEMU HARDDISK 0.10.2> at ata0-master WDMA2 ugen0.1: <Intel> at usbus0 uhub0: <Intel UHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus0 acd0: CDROM <QEMU DVD-ROM/0.10.2> at ata1-master WDMA2 xenbusb_front0: <Xen Frontend Devices> on xenstore0 xn0: <Virtual Network Interface> at device/vif/0 on xenbusb_front0 xn0: Ethernet address: 00:16:3e:55:db:fd xenbusb_back0: <Xen Backend Devices> on xenstore0 xctrl0: <Xen Control Device> on xenstore0 xn0: backend features: feature-sg feature-gso-tcp4 xbd0: 25000MB <Virtual Block Device> at device/vbd/768 on xenbusb_front0 xbd0: attaching as ad0 can't re-use a leaf (led)! GEOM: ad0s1: geometry does not match label (16h,63s != 255h,63s). uhub0: 2 ports with 2 removable, self powered ugen0.2: <QEMU 0.10.2> at usbus0 ums0: <Endpoint1 Interrupt Pipe> on usbus0 ums0: 3 buttons and [Z] coordinates ID=0 run_interrupt_driven_hooks: still waiting after 60 seconds for xenbusb_nop_confighook_cb run_interrupt_driven_hooks: still waiting after 120 seconds for xenbusb_nop_confighook_cb run_interrupt_driven_hooks: still waiting after 180 seconds for xenbusb_nop_confighook_cb run_interrupt_driven_hooks: still waiting after 240 seconds for xenbusb_nop_confighook_cb run_interrupt_driven_hooks: still waiting after 300 seconds for xenbusb_nop_confighook_cbhome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEQjb-QrkQ=YonzE8UZ==ikhYajTykoK9%2Bmy7S9NXXypw5fGSA>
