From owner-freebsd-virtualization@freebsd.org Sat May 18 20:15:05 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C42B21597298 for ; Sat, 18 May 2019 20:15:05 +0000 (UTC) (envelope-from nap@ixsystems.com) Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0EBFB8F31E for ; Sat, 18 May 2019 20:15:04 +0000 (UTC) (envelope-from nap@ixsystems.com) Received: by mail-ed1-x533.google.com with SMTP id p27so16548544eda.1 for ; Sat, 18 May 2019 13:15:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ixsystems-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Da71bDfStw4aXpypfS5BgezS5WOLqT6wN9bk4SxhDWA=; b=0aHj10l3ZhKt9BeuxzG6Ue3nWkJBSkp334hPtJiasB3UfXGaPqhhir8ptsergnqI6V mz7gn0ObW9bBI2QPxvp3J72eR1JQdJJgJuNdLHGYCEv5VIa8pxXR6hiIeW1vIG2uPesx Fd8+dClHqSqm+beeJSfOMiPhv/ZbwKN6YHCaajDWVYDnsjseUqMRcLs60lUUFhNjMXVC BDncGom1SgAXJGBO5YSr0T/MuJS/0/aQTCXnSPVyBVIqfwPB5X/oTj9AQMDMy99P4J51 nXM3DIXxiF8roCKCI9fNMw1HqGiGwd/HbGnLJpoTogWF2HyRATzswuM8SERJWsknqHqm b6Sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Da71bDfStw4aXpypfS5BgezS5WOLqT6wN9bk4SxhDWA=; b=OTc6A/lV4GaxZ4n+wJLWbuPyc1wD0t+5zWveiIcm79osxejlPUACHmZFsfx/FOdeP1 nc/1Nd2boPZCG0tVRNjcP0dKLyTVBTWh7qBAJ4LDFdO29Yf57BM3bP0OTZW9hGbUmcV6 q1GvL6NbxFmPL6vxiPsmWf2ja6/Wum/AIKueGU6x3u30EjmQ3FGqY+mPorpHQ+By2R4q 2bm5GKo8iyY+CDwwxAksHvgTw5LRQ+rgWc8kNz5ahVlQ56pLQ5dAVD88qK/R8+aeReAw ZnJ5hzFAu6KzsERoXczaUnFx5aDoUwiZ5CTVb0Jjy9n3Jn3bX/oeh6laOIly1JZo884X fjUA== X-Gm-Message-State: APjAAAUL1YfgrVQmZGdKVZfMm2XZnc44SDUezWfXrR6jJZT4Gr9PnMpf w7xOkuT6RDqOwSO3qvMYza/ac4CKMwaQJ37m96gisLxtFG2L9DWP X-Google-Smtp-Source: APXvYqxSJj8L7LCtqzNG1tI6HO6tbvNI16GOyKMOzWHWUqGwiZXxYFHjAYCX/iR+jjdm0lF3fWvZf5GjuNwOZwlkKLg= X-Received: by 2002:a50:9184:: with SMTP id g4mr54980818eda.65.1558210502077; Sat, 18 May 2019 13:15:02 -0700 (PDT) MIME-Version: 1.0 References: <201905182006.x4IK6euM066455@gndrsh.dnsmgr.net> In-Reply-To: <201905182006.x4IK6euM066455@gndrsh.dnsmgr.net> From: Nick Principe Date: Sat, 18 May 2019 16:14:28 -0400 Message-ID: Subject: Re: Windows 10 guests fail to boot when attempting to passthrough network card To: "Rodney W. Grimes" Cc: freebsd-virtualization@freebsd.org X-Rspamd-Queue-Id: 0EBFB8F31E X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=ixsystems-com.20150623.gappssmtp.com header.s=20150623 header.b=0aHj10l3; dmarc=pass (policy=none) header.from=ixsystems.com; spf=pass (mx1.freebsd.org: domain of nap@ixsystems.com designates 2a00:1450:4864:20::533 as permitted sender) smtp.mailfrom=nap@ixsystems.com X-Spamd-Result: default: False [-6.71 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[ixsystems-com.20150623.gappssmtp.com:s=20150623]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[ixsystems-com.20150623.gappssmtp.com:+]; MX_GOOD(-0.01)[cached: ALT3.ASPMX.L.GOOGLE.com]; RCVD_IN_DNSWL_NONE(0.00)[3.3.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; NEURAL_HAM_SHORT(-0.96)[-0.963,0]; RCPT_COUNT_TWO(0.00)[2]; IP_SCORE(-2.73)[ip: (-9.13), ipnet: 2a00:1450::/32(-2.20), asn: 15169(-2.27), country: US(-0.06)]; DMARC_POLICY_ALLOW(-0.50)[ixsystems.com,none]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 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: Sat, 18 May 2019 20:15:06 -0000 Yeah, that triggers a barf with error 2: mmio_rb_lookup: barf ENOENTerror is 2 mr.name is passthru-pci-5 mr.flags is 0 mr.arg2 is 0 mr.base is 18446744073709027328 mr.size is 524288 Assertion failed: (error == 0), function modify_bar_registration, file /usr/src/usr.sbin/bhyve/pci_emul.c, line 510. Interestingly enough, after we talked I simply commented out the assert at 504 in pci_emul.c and Windows booted fine and can see the Chelsio card with both interfaces. I'm not sure if it would fall over once I started actually using it or not. `nap On Sat, May 18, 2019 at 4:06 PM Rodney W. Grimes < freebsd-rwg@gndrsh.dnsmgr.net> wrote: > > I have noticed that Windows 10 guests fail to boot when attempting to > pass > > through a network card. I believe I have observed this with both cxgbe > > (t580) and mlx5en cards, but only have a cxgbe to test with now. Without > > passthrough, the Windows 10 guest boots and operates normally. > > > > FreeBSD guests (12.0-RELEASE) have no issue when booting with the cxgbe > > card passed through - I can kldload cxgbe and I get both cxl ports > showing > > up in the FreeBSD guest. > > > > I have tested this with both 12.0-RELEASE and head (13-CURRENT r347883) > as > > the host OS with no change in behavior. The bhyve output is: > > Unhandled ps2 keyboard command 0x02 > > Unhandled ps2 keyboard command 0x02 > > Assertion failed: (error == 0), function modify_bar_registration, file > > /usr/src/usr.sbin/bhyve/pci_emul.c, line 504. > > fbuf frame buffer base: 0x943600000 [sz 16777216] > > > > Two main suggestions from discussions at BSDCan this week were: > > - Capture pciconf -lvb from the FreeBSD guest > > - Add some printf to pci_emul.c to capture some values when there is an > > error > > > > I've captured the above, and a lot of other relevant info, in a Google > Doc > > here (too big to post directly): > > > https://docs.google.com/document/d/1t-UVIO9Aq0TPUFHyo1nVscqaW1LoPuNhfLPitL8oeTs/edit?usp=sharing > > > > `nap > > To confirm what I see from looking at your data could you tell me if this > patch triggers a barf? > > --- mem.c.orig 2019-05-18 20:04:26.707995000 +0000 > +++ mem.c 2019-05-18 20:04:02.205119000 +0000 > @@ -97,6 +97,7 @@ > return (0); > } > > +printf("mmio_rb_lookup: barf ENOENT"); > return (ENOENT); > } > > -- > Rod Grimes > rgrimes@freebsd.org > -- Nick Principe Performance Engineering Supervisor iXsystems, Inc. Ph: (408) 943-4100 x341 Fx: (408) 943-4101