From patchwork Tue Jul 2 20:20:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1955689 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=e+nWs8uu; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WDF0K0kk8z1xpc for ; Wed, 3 Jul 2024 06:30:25 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOk01-0005S3-AZ; Tue, 02 Jul 2024 16:21:14 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOjzS-0004kv-Qe for qemu-ppc@nongnu.org; Tue, 02 Jul 2024 16:20:38 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOjzR-0001ej-0p for qemu-ppc@nongnu.org; Tue, 02 Jul 2024 16:20:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719951635; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=actUboiQ+IrTgCsdz18KhXUIoDAvYkrEhXUsAIxh/Nc=; b=e+nWs8uu/GQnKgicwctVVNsRT8m4m+avyX5mI1uHl1WVcbrcC/X/gDM8cZERmmXuJqu23+ N4ma8TVe8qWrDmsrrsOqbrcPCkAtNUeOZhqVSp9Nqzt1/i/XzberUhG5/c8t2mHkFo9P/J WuWNmglGbODyWHCM474c12LsIkE/sPM= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-191-s1pmWNWVMCSIBif7jlGOCw-1; Tue, 02 Jul 2024 16:20:34 -0400 X-MC-Unique: s1pmWNWVMCSIBif7jlGOCw-1 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4256718144dso42275525e9.1 for ; Tue, 02 Jul 2024 13:20:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719951634; x=1720556434; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=actUboiQ+IrTgCsdz18KhXUIoDAvYkrEhXUsAIxh/Nc=; b=KzEiJ/LrYnSOJjv9LeebqhXeD2L+KPZQytmN+C5qglLzE4X6ns29ad4iH0OztSWMmo rfiFb9ZCvw9ShmxTDIq7L+ivhm6sePD+LZ7DFi4p7gvGCoYKf4F+f8AebMZjEkQTWfy7 NROGMOZsYmGatnvMwUNRSh35JR5aCQcYX08C/h4K6Co+ESrPUlTkiEwNdCZhSlRsVmw/ pHAPO3L0/duRvuTOH7AKo4lpZvUqswWBPj+vJCr3j2VMzfV82I7ehMgOjoTwEQd+dOB3 TFeH+E2JyXu/FGXelpcvQl0Urxqwt3lNs06ArmPGr9j37uGfLpdM8uNWTmJbn/9lAAbH c+UA== X-Forwarded-Encrypted: i=1; AJvYcCXpJnDXHpgceSHGvf2z6b8Ks1JicJyc5GEEBVjPT+ahER2LLjTz6eu0ufekvDs1mYLKhEa0pR4iOqo7zddFv9w21DzD X-Gm-Message-State: AOJu0YxXZIUHJNnOgKsVhDjwgUwcKabRi4ueXi6nlU8yRm3cM70I2vTB byXTMg47ErOU17OO4/Y6i28kK4gncD6lOlKMJHvoB9gM70WjqK47WWkus726/4DmO7PMotdeTUV g9BoN8ci+Ya9HexVI5p8ITu3mUp6HyJ9bdc1depcO0g3nFp/5yA== X-Received: by 2002:adf:f18b:0:b0:361:dd0c:678 with SMTP id ffacd0b85a97d-367756bc471mr7294501f8f.36.1719951633790; Tue, 02 Jul 2024 13:20:33 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElwaApP0XIJ4pjyGb7BSj59w+Y8v1dEKdAKZhiQ4vH4/PKwktwFYx+c/wz1REhd0gpEnEjUQ== X-Received: by 2002:adf:f18b:0:b0:361:dd0c:678 with SMTP id ffacd0b85a97d-367756bc471mr7294488f8f.36.1719951633340; Tue, 02 Jul 2024 13:20:33 -0700 (PDT) Received: from redhat.com ([2a02:14f:1f5:eadd:8c31:db01:9d01:7604]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0e1412sm14091632f8f.53.2024.07.02.13.20.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 13:20:32 -0700 (PDT) Date: Tue, 2 Jul 2024 16:20:29 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Akihiko Odaki , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , qemu-ppc@nongnu.org Subject: [PULL v2 80/88] hw/ppc/spapr_pci: Do not create DT for disabled PCI device Message-ID: <1367c24db02afde209d307d653313351bf774b07.1719951168.git.mst@redhat.com> References: MIME-Version: 1.0 In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki Disabled means it is a disabled SR-IOV VF or it is powered off, and hidden from the guest. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-2-7ca0b8ed3d9f@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ppc/spapr_pci.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index 7cf9904c35..f63182a03c 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1296,6 +1296,10 @@ static void spapr_dt_pci_device_cb(PCIBus *bus, PCIDevice *pdev, return; } + if (!pdev->enabled) { + return; + } + err = spapr_dt_pci_device(p->sphb, pdev, p->fdt, p->offset); if (err < 0) { p->err = err; From patchwork Tue Jul 2 20:20:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 1955715 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=UCZ4bdvn; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=patchwork.ozlabs.org) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WDF8Q5L5bz1xpN for ; Wed, 3 Jul 2024 06:37:26 +1000 (AEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sOjzx-0005IM-MN; Tue, 02 Jul 2024 16:21:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOjze-00055B-Qw for qemu-ppc@nongnu.org; Tue, 02 Jul 2024 16:20:54 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sOjzW-0001gr-Q0 for qemu-ppc@nongnu.org; Tue, 02 Jul 2024 16:20:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1719951642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=DMkazJvXlCFuPVFo5zwsqgTLcz0EAKKfqUw3BcILaOs=; b=UCZ4bdvnwUv36eQCKTypFfrCVwR9iwYuE5rjC4KPQuvXFxR6b4yKu1oauPhvYg/sguRZ9N UkKZM1N8lLwVqGvUDS2x1mrml7UcIyUarNHPdJxWLIgt9p7Xy7mia8+fMt/DMHiWe1XNfe w/Cb0BOUsMWPyWVJDpos7Nthi6JSsv4= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-453-Ac8DwV__Ms2bL2LFhEQvqw-1; Tue, 02 Jul 2024 16:20:40 -0400 X-MC-Unique: Ac8DwV__Ms2bL2LFhEQvqw-1 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-362a0c1041dso2522268f8f.1 for ; Tue, 02 Jul 2024 13:20:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719951639; x=1720556439; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=DMkazJvXlCFuPVFo5zwsqgTLcz0EAKKfqUw3BcILaOs=; b=Ez254qgNH8UI3K4Gd6y46j1cCvt9itvLF6d99kzZsCAS0afeaT5YqHzgFzCSubBzGF +8948pyWybeMS2Kdd5mrqJcjpPsHWQQcpWykCDpt1TmHbYN5oTr+xN4FfjmBlBIn38/E MKAm+y4k7OsGtTSBnycBzNj1fZhiq7nAgHsvMQPEOKpgp9ocWMGZH0azFE3a197rbZub L5LBMLpcsPQ2Xd/2Gc4W8CWTsW86aEBbY1jfIVyIA35oPsQD0/vEnzf56KIpnokm/kTe rOpPLb039YyVrJ+C9AdrwMezL6aZOguZygLOX9B3YRY7sWiazqW3l9kgys01fKMJU1bF wrYg== X-Forwarded-Encrypted: i=1; AJvYcCWP+F9kIf/rlrdIZFUrzFS0MjpPAX4NeO7BgtS3H8t0rAGBh4SGnPL/tytAcq9oWKCIv3kJxKbQpkaI+MhGTbVvOret X-Gm-Message-State: AOJu0Yyo+Eq8/6DFQbiJFwOK/ZB81JM187U6IrSjuBtF3XmntpiakCv3 oOgzCFsrtrKbfy+d+nmDBoEgtIAGscRNapFyUvJvKCLFrb8+Vpbr5daSNRajpGbZG8LXhgpYN3w Gzd3Aiy9MnxDOrK0wfW/RzmLX642APskNMrneVLQVsN8cl1ebwA== X-Received: by 2002:adf:ef4a:0:b0:367:92b3:f6b0 with SMTP id ffacd0b85a97d-36792b3fb91mr26191f8f.21.1719951638895; Tue, 02 Jul 2024 13:20:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAF+SlkAFzGwtURNvVdFbF9BNL5XgDH8lttnUMErgQlryZynmCV6YMMTleK4DTI+VRjSbS1A== X-Received: by 2002:adf:ef4a:0:b0:367:92b3:f6b0 with SMTP id ffacd0b85a97d-36792b3fb91mr26178f8f.21.1719951638424; Tue, 02 Jul 2024 13:20:38 -0700 (PDT) Received: from redhat.com ([2a02:14f:1f5:eadd:8c31:db01:9d01:7604]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3675a0e12d7sm14135571f8f.51.2024.07.02.13.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jul 2024 13:20:37 -0700 (PDT) Date: Tue, 2 Jul 2024 16:20:33 -0400 From: "Michael S. Tsirkin" To: qemu-devel@nongnu.org Cc: Peter Maydell , Akihiko Odaki , Nicholas Piggin , Daniel Henrique Barboza , David Gibson , Harsh Prateek Bora , qemu-ppc@nongnu.org Subject: [PULL v2 81/88] hw/ppc/spapr_pci: Do not reject VFs created after a PF Message-ID: <620ed810335bb71279404d1c197d5a15c7201b79.1719951168.git.mst@redhat.com> References: MIME-Version: 1.0 In-Reply-To: X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-ppc@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-ppc-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Akihiko Odaki A PF may automatically create VFs and the PF may be function 0. Signed-off-by: Akihiko Odaki Message-Id: <20240627-reuse-v10-3-7ca0b8ed3d9f@daynix.com> Reviewed-by: Michael S. Tsirkin Signed-off-by: Michael S. Tsirkin --- hw/ppc/spapr_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index f63182a03c..ed4454bbf7 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1573,7 +1573,9 @@ static void spapr_pci_pre_plug(HotplugHandler *plug_handler, * hotplug, we do not allow functions to be hotplugged to a * slot that already has function 0 present */ - if (plugged_dev->hotplugged && bus->devices[PCI_DEVFN(slotnr, 0)] && + if (plugged_dev->hotplugged && + !pci_is_vf(pdev) && + bus->devices[PCI_DEVFN(slotnr, 0)] && PCI_FUNC(pdev->devfn) != 0) { error_setg(errp, "PCI: slot %d function 0 already occupied by %s," " additional functions can no longer be exposed to guest.",