From owner-freebsd-virtualization@freebsd.org Fri Mar 2 19:01:59 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 73209F3DCBB for ; Fri, 2 Mar 2018 19:01:59 +0000 (UTC) (envelope-from ludovit.koren@gmail.com) Received: from mail-wm0-x233.google.com (mail-wm0-x233.google.com [IPv6:2a00:1450:400c:c09::233]) (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 0044272F7C; Fri, 2 Mar 2018 19:01:58 +0000 (UTC) (envelope-from ludovit.koren@gmail.com) Received: by mail-wm0-x233.google.com with SMTP id z9so4850711wmb.3; Fri, 02 Mar 2018 11:01:58 -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=ccCyWZSyOl/b9PuIxozrpksgYzvBU0ppQPnpbqGHa+0=; b=iYIk/QfotQrf0Alz/O28qTQw8Hz3TGiWBNcrPAZCAuWP3nWdEvbbks5BaNED/K4x5r d16QYMGzyBL2KxTw/46caS30Cm/mLhQ0UU2/YvWn8Lo2FR3BsITTgVKdYU57JhQ//EY3 0Trq0jFZTkXRg22bgPgglROH/G3PRpmFDmRZzvVetignUDvSNQcspy6a8BZg6kxBYoc7 l640mmOByb8xJma7NxxOSddrdYqsnRaIyDnKBuh69PfW6G21m3SZCEG2SbnHLuj+UlkL 6ZxMN/fCNBQnQlbNyJ3TxszRAJfTPIdXIvImRAfnghdRS0zRzWvL96k4elhFyUpHrsjq A70g== 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=ccCyWZSyOl/b9PuIxozrpksgYzvBU0ppQPnpbqGHa+0=; b=nJ+AJXgb3PeoKElBe+q3ZCQt31/V4CbktvZl3mWi4p1O+0IrlMOlVhmCRBkWaazzDo eiEh+xPVdDNmCoMrqZ/B9aqYG/p/hxboJNLfceQ++2MufEcEqeyRRONEPx82P14cBMQZ YVB7P5ju5f9oAUcPJFCteM1PtH/1dUtiJLUFMeF0k28qObPMv3a4Sq5nuR7LmEmQcw1T 3towkUhpghZ1EhPvPUbMYDvdy4AjgAds5YXe9lmSLtvVApC8VUdzKcfnnRlNolH0WQSk rzjksmgKk0A1KEgYNFIsSl386jgBuln4iGynR8qpKLuWwdAM/BqFyjjfryRAsIjXz+28 K9xg== X-Gm-Message-State: AElRT7G2mCBQhJNtR/iyiEwD+N59eTyxUNVYmR/KA2tT/MsvoTWYwT4A 4EFma6kheJNiJd2+HEJSe9sRuQ== X-Google-Smtp-Source: AG47ELtkQu1SDItbWhRpBskNoxHUncsDLuLz2n+KsXH02isrWsK4SQ3fqXny6I1SPIuGPIgr18qJ9g== X-Received: by 10.28.84.26 with SMTP id i26mr2310587wmb.129.1520017317588; Fri, 02 Mar 2018 11:01:57 -0800 (PST) Received: from jedi.localdomain (adsl-dyn-247.95-102-174.t-com.sk. [95.102.174.247]) by smtp.gmail.com with ESMTPSA id c47sm1315524wrg.22.2018.03.02.11.01.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Mar 2018 11:01:56 -0800 (PST) Received: by jedi.localdomain (Postfix, from userid 1001) id B3E6911DA; Fri, 2 Mar 2018 20:01:55 +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 20:01:55 +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: <86h8py1eu4.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 19:01:59 -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. > 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 */ Hi, I applied the patch and I got the following error for usb in windows: This device cannot find enough free resources that it can use. (Code 12) If you want to use this device, you will need to disable one of the other devices on this system. I don't know how to proceed.... thanks regards, lk