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 X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B800C07E95 for ; Tue, 20 Jul 2021 03:02:43 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id BB53E610CC for ; Tue, 20 Jul 2021 03:02:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB53E610CC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:33808 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5g1p-0004KL-JP for qemu-devel@archiver.kernel.org; Mon, 19 Jul 2021 23:02:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43952) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5g13-0003dw-ST for qemu-devel@nongnu.org; Mon, 19 Jul 2021 23:01:53 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44270) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5g10-0000Lt-EC for qemu-devel@nongnu.org; Mon, 19 Jul 2021 23:01:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626750108; 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=Mw7AqXHhcA3vcmpYIgMorAuF7j0KPEgQFVVUsTw9ouA=; b=abCyh6iqsRwDKKw3UaPk6QFKRQZp8q35wr8EaJ7RsmakRqxPf0pZW6ERwvqEPJtwDT938C v5emF8RjdrNS5Fxhpni+TVp0wqiA2yD7a2dqe1Kp+D0n+c7huecbKtp/H3n/yyaEBsgSJx cwu1oot1GfiNV+OdVZPOyRozkhPUzBw= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-597-44gZRbdONSKdrPCckN-F0g-1; Mon, 19 Jul 2021 23:01:46 -0400 X-MC-Unique: 44gZRbdONSKdrPCckN-F0g-1 Received: by mail-ot1-f69.google.com with SMTP id p13-20020a9d4e0d0000b02904cdb63ceafcso10305096otf.6 for ; Mon, 19 Jul 2021 20:01:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:organization:mime-version:content-transfer-encoding; bh=Mw7AqXHhcA3vcmpYIgMorAuF7j0KPEgQFVVUsTw9ouA=; b=bLXZwugcgQZTj/K87pfwLW1YQ00s8oMZLfFte6AfFsowT/T21HYJG2brQUXUpmKFYC 5Meo/12bSEPGmrvNJvXWQuBdj7OwmqNNUHiIFz5unpcZWRCuBm25ZZhLPAbyWWT4f/k7 fie730b5c5KJWcIrU5D9XVdHc0dm0oYtxe7iUDL4euxgoUyHlvSfOimaGbYdL0zrWG2q pJdMtaVByvdr6Axul3AKHYlxhZZSChy9pBdyE3y9RNhy8onzIbd1Q9NDip5f8kE9et3j Y/A+8HUpP136gqwmZESJ28u2BrbUWUuggdFQ2gze8tP7BvQbtmbKsQ5+GXyPzKiZ3ZZK N7VA== X-Gm-Message-State: AOAM532tnbsw+/2WEPY3Xt5t/gAwnsgzHY+jfWAz61hRhhzZqPGUfqas GnoNP3WqCko2WH/PtR9qLqOk0JvijXXO3QIDJMJWH8OXDI8GjC3xcRQybZ+0vodo42LmKD2oYjZ JdJ4nEe2mYUfQZ/0= X-Received: by 2002:a05:6808:2105:: with SMTP id r5mr23883423oiw.57.1626750106059; Mon, 19 Jul 2021 20:01:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUl5TK/NKZEW2fP0IshixsTlBo2v1PrigJIgZaSVSi3WcNYCKJr4XfBHEiXGuUzxfCjpRxRw== X-Received: by 2002:a05:6808:2105:: with SMTP id r5mr23883407oiw.57.1626750105900; Mon, 19 Jul 2021 20:01:45 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id m83sm22797oig.25.2021.07.19.20.01.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 20:01:44 -0700 (PDT) Date: Mon, 19 Jul 2021 21:01:43 -0600 From: Alex Williamson To: John Johnson Subject: Re: [PATCH RFC 12/19] vfio-user: probe remote device's BARs Message-ID: <20210719210143.7bc9c3ab.alex.williamson@redhat.com> In-Reply-To: <9D721628-1C4A-4710-B2AE-1F4C8E616233@oracle.com> References: <20210719165959.23439f39.alex.williamson@redhat.com> <9D721628-1C4A-4710-B2AE-1F4C8E616233@oracle.com> Organization: Red Hat X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=alex.williamson@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=216.205.24.124; envelope-from=alex.williamson@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1.469, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, 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-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Elena Ufimtseva , Jag Raman , Swapnil Ingle , John Levon , QEMU Devel Mailing List , "stefanha@redhat.com" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, 20 Jul 2021 01:39:21 +0000 John Johnson wrote: > > On Jul 19, 2021, at 3:59 PM, Alex Williamson wrote: > > > > On Sun, 18 Jul 2021 23:27:51 -0700 > > Elena Ufimtseva wrote: > >> @@ -3442,6 +3448,22 @@ static void vfio_user_pci_realize(PCIDevice *pdev, Error **errp) > >> /* QEMU can also add or extend BARs */ > >> memset(vdev->emulated_config_bits + PCI_BASE_ADDRESS_0, 0xff, 6 * 4); > >> > >> + /* > >> + * Local QEMU overrides aren't allowed > >> + * They must be done in the device process > >> + */ > >> + if (pdev->cap_present & QEMU_PCI_CAP_MULTIFUNCTION) { > >> + error_setg(errp, "Multi-function must be specified by device process"); > >> + goto error; > >> + } > >> + if (pdev->romfile) { > >> + error_setg(errp, "Romfile must be specified by device process"); > >> + goto error; > >> + } > > > > For what reason? PCI functions can operate completely independently, > > there could be different servers for different functions, a QEMU user > > may wish to apply a different option ROM image than provided by the > > server. This all creates unnecessary incompatibilities. Thanks, > > > > The idea is to have all the device options specified on the remote > server, and have the vfio client just be a pass-through device. I thought > having them specified in 2 places would cause more confusion. IMO, the server has no business making such configuration restrictions. It's the client's decision if it wants to create multi-function topologies or override the option rom. Same for whether it wants to override or virtualize capabilities. All of this should just work as-is; it's actually additional code required and knowledge through the management stack to prevent it. Thanks, Alex