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=-15.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,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 A1CFCC12002 for ; Mon, 19 Jul 2021 18:11:23 +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 1DECC6120D for ; Mon, 19 Jul 2021 18:11:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1DECC6120D 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]:52394 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m5Xjd-00005F-Sq for qemu-devel@archiver.kernel.org; Mon, 19 Jul 2021 14:11:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Xio-0007kV-My for qemu-devel@nongnu.org; Mon, 19 Jul 2021 14:10:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:49796) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m5Xil-0007Qc-5p for qemu-devel@nongnu.org; Mon, 19 Jul 2021 14:10:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1626718226; 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=7E75RurH3Abt1mNVao2b/WRX7Gc289+50W2lN6Q3xDk=; b=f8xvSUueKk+pHZLINnaw9FdTopdmxs9twFFnCIipUfqHeYR8pWXH2T9SsMKBZYinlf5MGm eXrhHOXS7LKC4eeu+UZF7Kx0YP/iwFrLgVpj4GdCceEkCm5IPGL1NZvfI6jpWj2G+/+gy4 wIGr07D3v/0onwP+5uzShhbF9R+3kyI= Received: from mail-ot1-f70.google.com (mail-ot1-f70.google.com [209.85.210.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-142-w3MWbR1FPuCqrvGmN64iqQ-1; Mon, 19 Jul 2021 14:10:23 -0400 X-MC-Unique: w3MWbR1FPuCqrvGmN64iqQ-1 Received: by mail-ot1-f70.google.com with SMTP id g4-20020a9d6b040000b02904cdecce70a8so8991369otp.22 for ; Mon, 19 Jul 2021 11:10:23 -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=7E75RurH3Abt1mNVao2b/WRX7Gc289+50W2lN6Q3xDk=; b=nzU84zWNMy1cmojn0CIyFriCLD2QDk6ppXCSsCCVkXn2so6t7e6Zc56EjsjXfJ5ACN UXCGUbWZHXxGFzH3o5V9Ncp40tlDE40eqlRvNibl12b/SpwgsflMBLRB3MR/ahuFSHh1 8yIe6vwlfqsKljWUnKoXeq/whRRfd76Fg+215uZw7ZcsemOmNsh34JM7xVRXlz9C9VKV L8Tj2Gwot19P2OIf9cvbXr63UMmDuCK/bjvL2hFV9DSIC5lEZAbEO5IkWFW+TY2k+K2P R+/yoLN/cgRMejD1AOGF+FN4+IodG3Hw4MZNFD4gvuTUL3fRhEvZpEQvvoC2Z6Vk5auS 0Rzg== X-Gm-Message-State: AOAM533Uv4a8SRiRcXF916UAML33LQ1GleFQxhGa3xJbyo/KLJYdrqW2 zCuBWZLi0BIBII31tCbmL97EslAEUkcXwmjYf/PWve72vcMjV9R71PC7omKszPwLZ8kGXhCRfxW qGp8f8F2sXlhgNOU= X-Received: by 2002:a05:6830:2a0f:: with SMTP id y15mr2941124otu.198.1626718223124; Mon, 19 Jul 2021 11:10:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQX56qbaR3Hio/F/NRsWm73vQn8+BOYEL+6ntjhm3Xiw6174vRYjqC70izyylrtRVzzL95qQ== X-Received: by 2002:a05:6830:2a0f:: with SMTP id y15mr2941097otu.198.1626718222945; Mon, 19 Jul 2021 11:10:22 -0700 (PDT) Received: from redhat.com ([198.99.80.109]) by smtp.gmail.com with ESMTPSA id v203sm3975848oib.37.2021.07.19.11.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Jul 2021 11:10:22 -0700 (PDT) Date: Mon, 19 Jul 2021 12:10:21 -0600 From: Alex Williamson To: Steven Sistare Subject: Re: [PATCH V5 17/25] vfio-pci: cpr part 2 Message-ID: <20210719121021.6babb9ff.alex.williamson@redhat.com> In-Reply-To: References: <1625678434-240960-1-git-send-email-steven.sistare@oracle.com> <1625678434-240960-18-git-send-email-steven.sistare@oracle.com> <20210716145133.4aa3f341.alex.williamson@redhat.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=170.10.133.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: "Daniel P. Berrange" , "Michael S. Tsirkin" , Jason Zeng , Alex =?UTF-8?B?QmVubsOpZQ==?= , Juan Quintela , qemu-devel@nongnu.org, Eric Blake , "Dr. David Alan Gilbert" , Stefan Hajnoczi , =?UTF-8?B?TWFyYy1BbmRyw6k=?= Lureau , Paolo Bonzini , Philippe =?UTF-8?B?TWF0aGlldS1EYXVkw6k=?= , Markus Armbruster Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Mon, 19 Jul 2021 13:44:08 -0400 Steven Sistare wrote: > On 7/16/2021 4:51 PM, Alex Williamson wrote: > > On Wed, 7 Jul 2021 10:20:26 -0700 > > Steve Sistare wrote: > > > >> Finish cpr for vfio-pci by preserving eventfd's and vector state. > >> > >> Signed-off-by: Steve Sistare > >> --- > >> hw/vfio/pci.c | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++- > >> 1 file changed, 116 insertions(+), 2 deletions(-) > >> > >> diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c > >> index 0f5c542..07bd360 100644 > >> --- a/hw/vfio/pci.c > >> +++ b/hw/vfio/pci.c > > ... > >> @@ -3295,14 +3329,91 @@ static void vfio_merge_config(VFIOPCIDevice > > *vdev) > >> g_free(phys_config); > >> } > >> > >> +static int vfio_pci_pre_save(void *opaque) > >> +{ > >> + VFIOPCIDevice *vdev = opaque; > >> + PCIDevice *pdev = &vdev->pdev; > >> + int i; > >> + > >> + if (vfio_pci_read_config(pdev, PCI_INTERRUPT_PIN, 1)) { > >> + error_report("%s: cpr does not support vfio-pci INTX", > >> + vdev->vbasedev.name); > >> + } > > > > You're not only not supporting INTx, but devices that support INTx, so > > this only works on VFs. Why? Is this just out of scope or is there > > something fundamentally difficult about it? > > > > This makes me suspect there's a gap in INTx routing setup if it's more > > than just another eventfd to store and setup. If we hot-add a device > > using INTx after cpr restart, are we going to find problems? Thanks, > > It could be supported, but requires more code (several event fd's plus other state in VFIOINTx > to save and restore) for a case that does not seem very useful (a directly assigned device that > only supports INTx ?). It's not testing that the device *only* supports INTx, it's testing that the device supports INTx _at_all_. That effectively means this excludes anything other than an SR-IOV VF. There are plenty of valid and useful cases of assigning PFs, most of which support INTx even if we don't expect that's their primary operational mode. Thanks, Alex