From owner-freebsd-virtualization@freebsd.org Fri Mar 2 07:18:00 2018 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 EE6D5F2A6CC for ; Fri, 2 Mar 2018 07:17:59 +0000 (UTC) (envelope-from ludovit.koren@gmail.com) Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 674A6713D6; Fri, 2 Mar 2018 07:17:59 +0000 (UTC) (envelope-from ludovit.koren@gmail.com) Received: by mail-wm0-x22d.google.com with SMTP id t74so1245705wme.3; Thu, 01 Mar 2018 23:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:user-mail-address:date:in-reply-to :message-id:user-agent:mime-version; bh=VpUGv7GjajGLzxcid8HlO8roi4DeEkAFJF2NYpNPoss=; b=EM7gwwp0qmh3LZLX0JVT+KkaC9iLR6IFzOfY9X0WN3iGZ4rW79gGIS8xBUSZBUoijf djN3QNaAr+jnpy0EYY16zXoPlMUznuXBV4BVKbixopdpQPpIeuNSSyLWrP+wHMUqqq1I sLzgJ1m8pCBBAadwHXbXG94PchqS28SkG+wV5e84shYXmPiCmgh231vmaoH7rtRlSGzv VXxwAZaB5SEm49Tpg+ZCulNQGOgZkcBNoJxLsKtFIhUS/ywsafhmnLhwgTh7L87sXAHd m8+hK1xcyBEJ67OX7P7UohNjUUBgakjvfiLORkluz4Ai5NOtr8GxEf2zKyib65SL2lku 2nkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:user-mail-address :date:in-reply-to:message-id:user-agent:mime-version; bh=VpUGv7GjajGLzxcid8HlO8roi4DeEkAFJF2NYpNPoss=; b=bi0MVCk/1ouhIkE3p2ajHL+2qen87ewtT4p+0k3EQQuiC41ZsnAh+yoJh+38b2OgVi lCKGpL9ZiuJsfzy82kUMwcv0Vg4zVyFQgzzgHFtmI7RB2RRWZrAerSTKKApUnX5zXaZx Pd3w0sqGe8fL0bdJaakO9Yjjv22AzfykuKxPgVbeeURYf8BRQ61hu76j1+MzfCp+PGe8 89Vdcu/NpAEo5BfUXK59Bw+HDVzJ7WbwZ+p+7RvNTFuEjUqbNGZ2UdvOPbKnhnL+MY3k 9UYcbFBV4c38AiDRPv6bXScEew/pGd+VNyszoHbWXSGNzfmIrthqdDhS3A6MAkJ6hs3i JGuA== X-Gm-Message-State: AElRT7EVeIsk0ttDsP+oS6dKq+zn0597gqOreS/BTaVneDzD6W58VJLl qNGgz0BPjouPtJRAFWBa91nhqA== X-Google-Smtp-Source: AG47ELuvd83yWKVtdLw6pxwa3xO1jk0mtvAyb3qe9ZfdmGPpGbw0OMSMlGp0syuZAgTIyyV9ldYmjA== X-Received: by 10.28.216.82 with SMTP id p79mr713318wmg.8.1519975078165; Thu, 01 Mar 2018 23:17:58 -0800 (PST) Received: from jedi.localdomain (178-143-48-243.dynamic.orange.sk. [178.143.48.243]) by smtp.gmail.com with ESMTPSA id b136sm640397wme.34.2018.03.01.23.17.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Mar 2018 23:17:57 -0800 (PST) Received: by jedi.localdomain (Postfix, from userid 1001) id A2FE6104C; Fri, 2 Mar 2018 08:17:56 +0100 (CET) From: Ludovit Koren To: Andriy Gapon Cc: "Rodney W. Grimes" , freebsd-virtualization@freebsd.org Subject: Re: bhyve - windows7 installation References: <86efl3j4y5.fsf@gmail.com> <201803011406.w21E62La025815@pdx.rh.CN85.dnsmgr.net> <3ab0c15f-afb5-c880-91d1-ba09a5c8bbc9@FreeBSD.org> User-Mail-Address: ludovit.koren@gmail.com Date: Fri, 02 Mar 2018 08:17:56 +0100 In-Reply-To: <3ab0c15f-afb5-c880-91d1-ba09a5c8bbc9@FreeBSD.org> (Andriy Gapon's message of "Fri, 2 Mar 2018 00:19:01 +0200") Message-ID: <86woyvgd3v.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.25 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: Fri, 02 Mar 2018 07:18:00 -0000 >>>>> Andriy Gapon writes: > On 01/03/2018 16:06, Rodney W. Grimes wrote: >> Due to the design of the IOMMU you can only manage IO space in page >> (4096 on x86) granually sizes. The device your trying to pass in >> has a 1024 byte memory region that is part of a 4096 byte page that >> may have other things in it. >> >> At this time bhyve does not have any way to deal with this, though some >> other hypervisors have techniques that make this work. >> >> I do not have or know of any list of USB controller cards that >> have 4k aligned and 4k sized BAR's. > I have this local hack for that problem. > It comes without any warranty and its use is completely at your own risk. Thank you. I will try it. lk > commit 74e0a8d1ae01c7aaabd7d965958b735c7cf18871 > Author: Andriy Gapon > Date: Fri Nov 17 20:17:57 2017 +0200 > bhyve: allow BAR sizes that are not page aligned by rounding them up > This is based on the assumption that drivers won't access the added space. > diff --git a/usr.sbin/bhyve/pci_passthru.c b/usr.sbin/bhyve/pci_passthru.c > index f314679d912b0..14c1384c6c8f8 100644 > --- a/usr.sbin/bhyve/pci_passthru.c > +++ b/usr.sbin/bhyve/pci_passthru.c > @@ -563,13 +563,20 @@ cfginitbar(struct vmctx *ctx, struct passthru_softc *sc) > size = bar.pbi_length; > if (bartype != PCIBAR_IO) { > - if (((base | size) & PAGE_MASK) != 0) { > + if ((base & PAGE_MASK) != 0) { > warnx("passthru device %d/%d/%d BAR %d: " > - "base %#lx or size %#lx not page aligned\n", > + "base %#lx not page aligned\n", sc-> psc_sel.pc_bus, sc->psc_sel.pc_dev, > - sc->psc_sel.pc_func, i, base, size); > + sc->psc_sel.pc_func, i, base); > return (-1); > } > + if ((size & PAGE_MASK) != 0) { > + warnx("passthru device %d/%d/%d BAR %d: " > + "size %#lx not page aligned\n", > + sc->psc_sel.pc_bus, sc->psc_sel.pc_dev, > + sc->psc_sel.pc_func, i, size); > + size = round_page(size); > + } > } > /* Cache information about the "real" BAR */ > -- > Andriy Gapon -- A: Because it fouls the order in which people normally read text. Q: Why is top-posting such a bad thing? A: Top-posting. Q: What is the most annoying thing on usenet and in e-mail?