From nobody Thu Jun 08 16:20:37 2023 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QcTw63QS5z4bwsb for ; Thu, 8 Jun 2023 16:20:38 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QcTw55v5Gz3Cjn for ; Thu, 8 Jun 2023 16:20:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1686241237; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Hxrxv4V/KEZUCl5qxEjyvYHodcagMbDJJ+wAcNcTL28=; b=IUy85sR3NUxdiILrIj1SMYQsBLIBsUnOfJMdFFFdTcnFFa665TIs2N2gyJK8+RMqbegR2J yL4KODcQlnLK6KLY3//uwffOUXxtrUAu15V/dTJHqklKIAG6i90VqPVpd0WmToBCjNxGPJ XZO161kBK+NgvdkMZ5UY1aEIGrWEqWKvOUAv8ebXc7V1vLwGYBxR4rBb7pmfZCZsU5oQcs WGo6Z+n2Iw3pP8zKWPey18/hG+sN+17fiJ4sDE0CNrSGdOTRYXwbMRsHxwJbU7naNKtlnQ 05+rSHxfFICdjFrimaHI9Snp9DtJTDsKY3M0ATxxpqyo4Jt1mbdv1Zt0nWgzxA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1686241237; a=rsa-sha256; cv=none; b=lBagNjxAlQdXyYErgmivu0GVFXpgGKZidWC4lfvK0kDwxrUSUyj76d6gVmk/QTZiCdAZr8 BrnyFpxmUw05G0w5NXeFzlLgN3SOoPu/lcZcY8QYhWp6M78T5jXpN2unfV49ND5k8dzMhy tzsQ0yGmSIdlItOFBCtnFywIaMiNMmrGay2EnlkTn08DprcPYscTJP92ERqA2PGRV5k5Lm IvRSFOtSphRlAjuYprfj8IcwuHQMum4i7EFhTtU8UAvvgfB2GpXA/eFIOchr5lJ5KmzISf HHXc6sRi5OlUob0/2cV2Emf9ZEvC6zcipQ6jFFk1+R925wfcSx3NrbwUryhYXQ== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QcTw54yPBz1108 for ; Thu, 8 Jun 2023 16:20:37 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 358GKbYg024642 for ; Thu, 8 Jun 2023 16:20:37 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 358GKbaY024641 for bugs@FreeBSD.org; Thu, 8 Jun 2023 16:20:37 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 271785] PCI: HotPlug: no BAR mapping after attaching a virtual function to the VM Date: Thu, 08 Jun 2023 16:20:37 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: jhb@FreeBSD.org X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271785 John Baldwin changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jhb@FreeBSD.org --- Comment #2 from John Baldwin --- I'm not quite sure I follow exactly. Are you creating the VFs in a FreeBSD bare metal machine, or have you created a VF on a host and are then passing that VF through to the guest as a PCI-e hot-plug event? Generally speaking, FreeBSD's PCI bus driver does not try to assign resourc= es to a device when it discovers it. When a device is enumerated, if the BARs already have a resource that has been assigned by firmware (e.g. during boo= t), then this existing resource allocations are preserved and the address space= is reserved when enumerating the device. However, if a BAR doesn't have a firmware-assigned address range when a qdevice is enumerated, the BAR is st= ill sized but left unallocated. If a device driver attaches and calls bus_alloc_resource to reserve a BAR, at that point resources are allocated = for the BAR. For HotPlug, BARs are always unassigned when the device appears, so they are only assigned resources when you attach a driver. Thus, if you create a VF= on the host and pass through to the FreeBSD guest and the guest doesn't have a driver for the VF device loaded, I would expect to see all the BARs unassig= ned. However, once you load a driver the BARs should be assigned resources duri= ng the attach of the device driver. --=20 You are receiving this mail because: You are the assignee for the bug.=