From owner-freebsd-virtualization@freebsd.org Sat Mar 23 21:35:56 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 DC757155D802 for ; Sat, 23 Mar 2019 21:35:55 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: from mail-ot1-f43.google.com (mail-ot1-f43.google.com [209.85.210.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DE44083E9C for ; Sat, 23 Mar 2019 21:35:54 +0000 (UTC) (envelope-from ctuffli@gmail.com) Received: by mail-ot1-f43.google.com with SMTP id d24so4879501otl.11 for ; Sat, 23 Mar 2019 14:35:54 -0700 (PDT) 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; bh=u6lOTcyNnam9+Vs17xD2NKpN3YAhECJThGzDBAVSE6g=; b=CAeZ4IQyhEWipspTQCRPZf2vdr5LLzSd13VUJ6WJKye4Va2ytQS5DgwsmCFVx1p/VP esceUxDjLKYXH121AZpjFlImMMfWbbr9mhPHSimkIoN1+Hs7FCbzIXREGR6HsA4AvExV /QigjOlzxBOF7YCcpbU4P3sGo3Cyoc8dOsfvrPprKm+/MgswkQtox5OzPM3yhPqTFSQ1 /7lkmTmr29kp199iLHwkLNcQ3IlMtXnBbl/WFV2qqp0srLMqSWDWa+elqytzbDBuQWL3 Y88wRj13a7N9q5e5jljjXe5oBC9HPr57NP+M48aE1k65DCN/Z7dP8ydj13sdFb7wxCkC DbiA== X-Gm-Message-State: APjAAAUJ7xkZ4hXktxaFVZWX4lbWi+ySykcg/8VRwQhcEpuZN41PEfqW w5MFBt2Iz0Tygv4KPc/6W34NM5yp X-Google-Smtp-Source: APXvYqznNVLEHkmmgRqypHH/LGME6qIpS9vy2OpRl8uWOJvDIa5pZYZPZN2fo8UyhV9vp2oL+1TuUw== X-Received: by 2002:a9d:1b2f:: with SMTP id l44mr11984620otl.217.1553376947901; Sat, 23 Mar 2019 14:35:47 -0700 (PDT) Received: from mail-ot1-f44.google.com (mail-ot1-f44.google.com. [209.85.210.44]) by smtp.gmail.com with ESMTPSA id q6sm4504167oia.4.2019.03.23.14.35.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Mar 2019 14:35:47 -0700 (PDT) Received: by mail-ot1-f44.google.com with SMTP id m10so4930945otp.2 for ; Sat, 23 Mar 2019 14:35:47 -0700 (PDT) X-Received: by 2002:a9d:75cc:: with SMTP id c12mr8057084otl.77.1553376947435; Sat, 23 Mar 2019 14:35:47 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Chuck Tuffli Date: Sat, 23 Mar 2019 14:35:36 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: emulated PCI device BAR size To: freebsd-virtualization@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: DE44083E9C X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of ctuffli@gmail.com designates 209.85.210.43 as permitted sender) smtp.mailfrom=ctuffli@gmail.com X-Spamd-Result: default: False [-4.32 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.99)[-0.989,0]; FORGED_SENDER(0.30)[chuck@freebsd.org,ctuffli@gmail.com]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[chuck@freebsd.org,ctuffli@gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(-1.32)[ip: (-0.55), ipnet: 209.85.128.0/17(-3.86), asn: 15169(-2.13), country: US(-0.07)]; RCVD_IN_DNSWL_NONE(0.00)[43.210.85.209.list.dnswl.org : 127.0.5.0]; RCVD_TLS_LAST(0.00)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[43.210.85.209.rep.mailspike.net : 127.0.0.17] 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, 23 Mar 2019 21:35:56 -0000 On Mon, Mar 18, 2019 at 10:15 AM Chuck Tuffli wrote: > > In debugging why Windows doesn't like bhyve's NVMe device emulation, > another developer mentioned that the NVMe specification defines the > minimum size of BAR[0] to be 16K bytes. And while most OS don't > enforce this requirement, evidently, Windows does. > > On the surface, a "minimum BAR size" sounds odd, but the MMIO BAR in > NVMe includes the doorbell registers for each queue. And since the > maximum number of queues is implementation specific, there isn't a > fixed size for the BAR. > > So my question is how to best fix this. The easiest would be to add a > check to the BAR size calculation in pci_nvme.c along the lines of: > #define NVME_MMIO_SPACE_MIN (1 << 14) > ... > pci_membar_sz = MAX( , > NVME_MMIO_SPACE_MIN); I went down this route and have a patch up for review (https://reviews.freebsd.org/D19676) if anyone is interested. --chuck