From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DD772C4167B for ; Thu, 30 Nov 2023 16:13:48 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r8jey-0005JR-Jp; Thu, 30 Nov 2023 11:13:04 -0500 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 1r8jew-0005Im-OL for qemu-devel@nongnu.org; Thu, 30 Nov 2023 11:13:02 -0500 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 1r8jev-0003mA-1O for qemu-devel@nongnu.org; Thu, 30 Nov 2023 11:13:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701360778; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bxkAbcD+QZ+lUPEt/bYoZphhQA5DUXqdFu18EF1pDQA=; b=HwDKp+pxa0ul6cARKMnLSv39ftGCMQFb2z9kbleArTBqrlPVTquvLdsLQlH+F2AvHDm9Nm 3PmNdJBf9LI9Z03gsto7WLeyjIjHqmfBlhglqTwY4LpM4YnEI3UCMPxTMMBC1zc271ZkK8 9uROp9hW+iAoXxWD1/wFq4kgKyfk2SA= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-339-RgLcYhs3NceE_9CNKItDVg-1; Thu, 30 Nov 2023 11:12:57 -0500 X-MC-Unique: RgLcYhs3NceE_9CNKItDVg-1 Received: by mail-wr1-f69.google.com with SMTP id ffacd0b85a97d-332e82bb756so808853f8f.1 for ; Thu, 30 Nov 2023 08:12:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701360776; x=1701965576; h=in-reply-to:content-transfer-encoding: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=bxkAbcD+QZ+lUPEt/bYoZphhQA5DUXqdFu18EF1pDQA=; b=QBKVC8QP6uy7DdJqx+22eLPmvPteDRUO5Qx/yuOEfokKtoYkoVckhxsWXJDFlZD7YS ZD1FTsTAoA397kmgxdrUIdjrpnj/4Fzz524MzbzUC4QW0pi+yHiO5cTnlqXjxoQTBmsJ 1DfdOyVm/Jf8yR7OQZcFBFSsrBMIWYbs6NUh4v8hyraE8IHrN9bzeLW4VV3Ef8a8nR21 vIxVawacFXZaBfUNmLKBXHdgqcv4fA/CLkoi/lWXevlAlJZZRw5IJ7J+ElDW44J4Z1Xx bKryDLKWBwFD6s53E6gmCT9oVvnt4VQiRnzdvfyec2YJEruUq0gXx8NQpmayEGYRZ1AA yZVQ== X-Gm-Message-State: AOJu0Yx6netGpuMnAZPGgKgRfkS62kHyf22bGyzBvUtMRh317ffFeZH1 vJL70eZ4SV1fY8/ksmO02mijtYrv6o2UhC5UaMKDqHMZE2WBlNZoqW8f7NNOooqjRbm2DbnssNO eskBsf55j0vck1NQ= X-Received: by 2002:a5d:570a:0:b0:333:2ec2:6717 with SMTP id a10-20020a5d570a000000b003332ec26717mr309166wrv.34.1701360776050; Thu, 30 Nov 2023 08:12:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFukir5HaUvHCqs4u162MWYxXpDMoJ3PRYRH67RJ7zyY2xcQx6V7CNOIkMijxxh+950HS8VLA== X-Received: by 2002:a5d:570a:0:b0:333:2ec2:6717 with SMTP id a10-20020a5d570a000000b003332ec26717mr309151wrv.34.1701360775754; Thu, 30 Nov 2023 08:12:55 -0800 (PST) Received: from redhat.com ([109.253.210.168]) by smtp.gmail.com with ESMTPSA id p11-20020a05600c468b00b0040b561924bbsm4155410wmo.21.2023.11.30.08.12.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 08:12:55 -0800 (PST) Date: Thu, 30 Nov 2023 11:12:17 -0500 From: "Michael S. Tsirkin" To: =?iso-8859-1?Q?C=E9dric?= Le Goater Cc: YangHang Liu , Akihiko Odaki , Marcel Apfelbaum , qemu-devel@nongnu.org, Alex =?iso-8859-1?Q?Benn=E9e?= Subject: Re: [PATCH] pcie_sriov: Remove g_new assertion Message-ID: <20231130111211-mutt-send-email-mst@kernel.org> References: <20231123075630.12057-1-akihiko.odaki@daynix.com> <53966853-640a-4581-a08d-8b452afc4c2a@redhat.com> <1d43153f-215a-4e2f-810f-553e4192c27f@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1d43153f-215a-4e2f-810f-553e4192c27f@redhat.com> 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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@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-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org On Thu, Nov 30, 2023 at 04:37:43PM +0100, Cédric Le Goater wrote: > On 11/30/23 10:52, YangHang Liu wrote: > > After applying this patch, the VM with a igbvf will not crash during reboot. > > > > Tested-by: Yanghang Liu> > > Michael, do you have plans to send a PR for -rc3 ? > > Thanks, > > C. Yes. > > > > > > On Mon, Nov 27, 2023 at 5:12 PM Cédric Le Goater > wrote: > > > > On 11/23/23 08:56, Akihiko Odaki wrote: > > > g_new() aborts if the allocation fails so it returns NULL only if the > > > requested allocation size is zero. register_vfs() makes such an > > > allocation if NumVFs is zero so it should not assert that g_new() > > > returns a non-NULL value. > > > > > > Fixes: 7c0fa8dff8 ("pcie: Add support for Single Root I/O Virtualization (SR/IOV)") > > > Buglink: https://issues.redhat.com/browse/RHEL-17209 > > > Signed-off-by: Akihiko Odaki > > > > > > > Reviewed-by: Cédric Le Goater > > > > > Thanks, > > > > C. > > > > > > > --- > > >   hw/pci/pcie_sriov.c | 1 - > > >   1 file changed, 1 deletion(-) > > > > > > diff --git a/hw/pci/pcie_sriov.c b/hw/pci/pcie_sriov.c > > > index 5ef8950940..a1fe65f5d8 100644 > > > --- a/hw/pci/pcie_sriov.c > > > +++ b/hw/pci/pcie_sriov.c > > > @@ -178,7 +178,6 @@ static void register_vfs(PCIDevice *dev) > > >       num_vfs = pci_get_word(dev->config + sriov_cap + PCI_SRIOV_NUM_VF); > > > > > >       dev->exp.sriov_pf.vf = g_new(PCIDevice *, num_vfs); > > > -    assert(dev->exp.sriov_pf.vf); > > > > > >       trace_sriov_register_vfs(dev->name, PCI_SLOT(dev->devfn), > > >                                PCI_FUNC(dev->devfn), num_vfs); > > > >