From owner-freebsd-virtualization@FreeBSD.ORG Sun Jun 8 02:45:44 2014 Return-Path: Delivered-To: freebsd-virtualization@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3AA4D2A3 for ; Sun, 8 Jun 2014 02:45:44 +0000 (UTC) Received: from mail-qa0-x233.google.com (mail-qa0-x233.google.com [IPv6:2607:f8b0:400d:c00::233]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EE05D29C6 for ; Sun, 8 Jun 2014 02:45:43 +0000 (UTC) Received: by mail-qa0-f51.google.com with SMTP id w8so6347682qac.24 for ; Sat, 07 Jun 2014 19:45:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=clintarmstrong.net; s=google; h=mime-version:date:message-id:subject:from:to:content-type; bh=CINXjsvSMAN9VOPbliQDt+2zCxhOMGOeVFNc3oKpFfw=; b=HJzAzmgFMqHoew5D77m6iPpp3r6kTPHh6Km6u0VIc2e9G+nNPcNu9ddfiW/ak4Q/lW rv6w2w8vBoa8fVXdM6SwoK85UQ+BKe08RqSiNPcix3F2BkoI4UXunYsKV4vCmMTMKZes gMK2Pq72WtcT0nMJan1gd4nQsyqj19FyRali0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:date:message-id:subject:from:to :content-type; bh=CINXjsvSMAN9VOPbliQDt+2zCxhOMGOeVFNc3oKpFfw=; b=Bbwb9IUDqAKYfdk28BwW9D4hXfg69t6dDgLjt+599z7E0beLUMqfzrbU66SkUYzgOo yUX5h+10ZBvWlEiUplvp0jDDSn/y7Fd1cRrKgu8AaxGlDV0df6EQXyHZOhs8oXLvDNK2 vPQMyBx9H43nUiAL/jUcDVO3CU0UbK/WJeO95YJLdbFIscxo2GpEMirJOx9pMvIsUDvh EtuXM7aejcIe52CQ8fj505L9U8/4Klz0BZqa28iWJSHg4ttduQ0O7gN9QXBGpCajmgWB h8e3eguTXRbe6hn56MitWq9fXCl+lbGDrJpn9u8hsbtXZkUgNqrV1ZLGWZkzFLma0vrf cRJQ== X-Gm-Message-State: ALoCoQk3/AjduNSotVTEBEpGru3z9LYL4d+6a199YWCGGQOk8mxDBbt3LRejw1OboQ3kLMPuGskG MIME-Version: 1.0 X-Received: by 10.224.47.77 with SMTP id m13mr22261075qaf.69.1402195542429; Sat, 07 Jun 2014 19:45:42 -0700 (PDT) Received: by 10.140.96.107 with HTTP; Sat, 7 Jun 2014 19:45:42 -0700 (PDT) X-Originating-IP: [2601:4:2a80:2d:75ec:7257:1e6a:70f5] Date: Sat, 7 Jun 2014 22:45:42 -0400 Message-ID: Subject: AMD passthru on bhyve_svm branch From: Clint Armstrong To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 08 Jun 2014 02:45:44 -0000 I'm not sure if this is supposed to be fully functional yet, but it appears to be partially working so there may be a fix for my issue. I'm running bhyve_svm r267218. One reason to think it's not supposed to be working yet is I still get this logged during boot: # dmesg | grep iommu amd_iommu_init: not implemented But trying it anyway it appears to almost work. The device shows up during the boot process, but it hangs 20-30 seconds before giving "polling failed". I'm having trouble finding out if this is supposed to work yet or if AMD passthru is not yet fully implemented. Thanks. # pciconf -vl | grep -A 4 pci0:1:0:0 ppt0@pci0:1:0:0: class=0x010700 card=0x30201000 chip=0x00721000 rev=0x03 hdr=0x00 vendor = 'LSI Logic / Symbios Logic' device = 'SAS2008 PCI-Express Fusion-MPT SAS-2 [Falcon]' class = mass storage subclass = SAS # grep pptdevs /boot/loader.conf pptdevs="1/0/0" # bhyveload -m 4G -d FreeBSD-10.0-RELEASE-amd64-bootonly.iso -c stdio vm [...] # bhyve -c 2 -m 4G -A -H -P -s 0:0,hostbridge -s 1:0,passthru,1/0/0 -s 2:0,lpc -s 3:0,virtio-blk,FreeBSD-10.0-RELEASE-amd64-bootonly.iso -l com1,stdio vm [...] mps0: port 0x2000-0x20ff mem 0xc0000000-0xc0003fff,0xc0040000-0xc007ffff irq 18 at device 1.0 on pci0 mps0: Firmware: 15.00.00.00, Driver: 16.00.00.00-fbsd mps0: IOCCapabilities: 1285c mps0: polling failed mps0: Calling Reinit from mps_request_polled mps0: Reinitializing controller, Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x8 fault code = supervisor write data, page not present instruction pointer = 0x20:0xffffffff805d7ed7 stack pointer = 0x28:0xffffffff817f6260 frame pointer = 0x28:0xffffffff817f62a0 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 0xffffffff808e7dd0 at kdb_backtrace+0x60 #1 0xffffffff808af8b5 at panic+0x155 #2 0xffffffff80c8e692 at trap_fatal+0x3a2 #3 0xffffffff80c8e969 at trap_pfault+0x2c9 #4 0xffffffff80c8e0f6 at trap+0x5e6 #5 0xffffffff80c75392 at calltrap+0x8 #6 0xffffffff805cb9a9 at mps_reinit+0xf9 #7 0xffffffff805cefbb at mps_request_polled+0xab #8 0xffffffff805ced43 at mps_update_events+0x133 #9 0xffffffff805cd3a3 at mps_iocfacts_allocate+0x1383 #10 0xffffffff805cd76c at mps_attach+0x28c #11 0xffffffff805d5d36 at mps_pci_attach+0x196 #12 0xffffffff808df242 at device_attach+0x3a2 #13 0xffffffff808e031d at bus_generic_attach+0x2d #14 0xffffffff8035e1ff at acpi_pci_attach+0x15f #15 0xffffffff808df242 at device_attach+0x3a2 #16 0xffffffff808e031d at bus_generic_attach+0x2d #17 0xffffffff8036024d at acpi_pcib_attach+0x23d Uptime: 1s