Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp9013195rwr; Thu, 11 May 2023 08:53:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5vMlcJ8VtMvdLUnymP76MUjqXSEQbXn4tzS1ZTjOFB+RXOarDBFUvhI4C/pQ/U++57gMah X-Received: by 2002:a05:6a20:8f06:b0:ff:e397:a87a with SMTP id b6-20020a056a208f0600b000ffe397a87amr23475614pzk.33.1683820417236; Thu, 11 May 2023 08:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683820417; cv=none; d=google.com; s=arc-20160816; b=W+dnNs/G/m8qv93u8GHnRdpkcsbxZpUurjPNasI0HMPrgMzfc/b+Q6zIh7pB9NcdVq NlfPT99NdZ22iRAQGC56cqYKZJxcp9SiVq/GigTwSGpVS03+eX5cBTfATUOWIbtL+YYA 265VpNk5H2hCm78HQ0BnZmhmep95mEiSxqS57lMjNNyWMNoQn1rU4YbrKrUoeTTOW4oD dPCTQ2zy8OZlDsVMBvhv0YZgdPThBthJ9yQ6KSb29QuIvRGvFmImD9JJqTkxMB0OWFKw tVk2AP+YAGvVn39mYrBloszJUsztWXrAlE3iZn6MqKMPiYmnvRgYztTIIa8AbNWjIMLs sxyg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=k+nuadjdGvBYKEz8d+bC2Q1Utzl6j1ioMWJcV9RWeIQ=; b=ryLmMxTfkuOtkICp+KGzWOaQnWoYs7EnfTdqTiqC2F3pSqkfyqe9J61SGAANlldoPO d+li3KvWvHj86Okg02o1SijGRMshpAA73oBbnTBKVq/Hhta1JsvMIWRb6TgpsTzuZhnH 0nGepBK0Knxkha3AnVAdvp8Lwu/UmiPGZf+Jmk+7fIu7YLSaUrGd5THGi118OQ1vYnbH nBt3qBaebjLWy3Le2QFYBQ5fafOyRtMeGYHbmpjz4b683nsXshvCrFhN+49aIjWZZ9hB aaxo5S78xxf1GuCvwp0jYddTgfxoP8ArPJAk9K7kR4OUiq3SDlsIRTyFuaMyOyn9elJt YwDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IwGfVQLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63eb45000000b00502f0d858e9si7224195pgk.174.2023.05.11.08.53.24; Thu, 11 May 2023 08:53:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=IwGfVQLe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238802AbjEKPpV (ORCPT + 99 others); Thu, 11 May 2023 11:45:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238811AbjEKPpD (ORCPT ); Thu, 11 May 2023 11:45:03 -0400 Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D431B5B93; Thu, 11 May 2023 08:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1683819901; x=1715355901; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=+C6B7H7ve/lwfgUWQi6R33paNDdITx62G7bxEy6HEqA=; b=IwGfVQLezTasKcUFeB3X6ofNyhWDMwl7Mwen1aTIBDAPI03VfL8Zn3ps nRPOfVCwfLPGwERnZhqjwNDEEJHrcSLMQNxpM1Xdzox6aZsMMzCsI4iDY zbmQ/FGtxY1dgsUWJUtjXEmCmYKDch/4lOgSjxErDosLDv/BHuam2hddV kON5Bwlnq6TffAohBBdLd2uj4Jse2Lk3q/JJPvZ3j3jO62bIvwigwcrdx cz9TE0O9NfVC32Gd8pqxEhpYYfGHpvk6CGjeMHvT3JCjhboUL2hBDGAYU htDyA7SSsBErJeDyIO8yxnaPT5cEnJF3NLpNUVYj1WKPRJydHQtBeSxbn w==; X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="335046681" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="335046681" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 08:44:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10707"; a="699776239" X-IronPort-AV: E=Sophos;i="5.99,266,1677571200"; d="scan'208";a="699776239" Received: from rchatre-ws.ostc.intel.com ([10.54.69.144]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 May 2023 08:44:48 -0700 From: Reinette Chatre To: jgg@nvidia.com, yishaih@nvidia.com, shameerali.kolothum.thodi@huawei.com, kevin.tian@intel.com, alex.williamson@redhat.com Cc: tglx@linutronix.de, darwi@linutronix.de, kvm@vger.kernel.org, dave.jiang@intel.com, jing2.liu@intel.com, ashok.raj@intel.com, fenghua.yu@intel.com, tom.zanussi@linux.intel.com, reinette.chatre@intel.com, linux-kernel@vger.kernel.org Subject: [PATCH V5 07/11] vfio/pci: Update stale comment Date: Thu, 11 May 2023 08:44:34 -0700 Message-Id: <5b605ce7dcdab5a5dfef19cec4d73ae2fdad3ae1.1683740667.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In preparation for surrounding code change it is helpful to ensure that existing comments are accurate. Remove inaccurate comment about direct access and update the rest of the comment to reflect the purpose of writing the cached MSI message to the device. Suggested-by: Alex Williamson Link: https://lore.kernel.org/lkml/20230330164050.0069e2a5.alex.williamson@redhat.com/ Signed-off-by: Reinette Chatre --- Changes since V4: - Restore text about backdoor reset as example to indicate that the restore may not be a severe problem but instead done in collaboration with user space. (Kevin) Changes since V2: - New patch. drivers/vfio/pci/vfio_pci_intrs.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/vfio/pci/vfio_pci_intrs.c b/drivers/vfio/pci/vfio_pci_intrs.c index e40eca69a293..867327e159c1 100644 --- a/drivers/vfio/pci/vfio_pci_intrs.c +++ b/drivers/vfio/pci/vfio_pci_intrs.c @@ -428,11 +428,9 @@ static int vfio_msi_set_vector_signal(struct vfio_pci_core_device *vdev, } /* - * The MSIx vector table resides in device memory which may be cleared - * via backdoor resets. We don't allow direct access to the vector - * table so even if a userspace driver attempts to save/restore around - * such a reset it would be unsuccessful. To avoid this, restore the - * cached value of the message prior to enabling. + * If the vector was previously allocated, refresh the on-device + * message data before enabling in case it had been cleared or + * corrupted (e.g. due to backdoor resets) since writing. */ cmd = vfio_pci_memory_lock_and_enable(vdev); if (msix) { -- 2.34.1