From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7FE3F17A2E8; Mon, 10 Mar 2025 18:00:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629652; cv=none; b=QE5um5KTtpJ/5lPukElO6pDxK2TG/FJSjfs+UhlIaAVw2wi+oStKk2ykpc1b1+hmSYTQSEB0SwC47RD1rp6gONBsFcmybE9LCoA73ChUYIO7F9kIQMNULV4v2tAhAT3gJe+x5loSG++yGiCaaabhKDyhDG6PsMvwMaaG1Q1LGvs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741629652; c=relaxed/simple; bh=bd8uJWOCu4NySSRMf33j7vpGeVcquDS8cv5UHc9+hHM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kGd21gdJitOU0gJd5LK4BI7+3RB21QHuja3VyCEG4ERthSTh3RNLxFRXWuTKp7DWqZlCfK3qZsrGaQGeWTwWVW2uL4f/xBu6aIkSYpyqUCZrny/JEJHYhi6yJeg7LZV029YYrYj5O08fQlDmXE+j0XSE0rl88iP7XHErKtX/kIU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=PKTwMKuR; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="PKTwMKuR" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09E00C4CEE5; Mon, 10 Mar 2025 18:00:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741629652; bh=bd8uJWOCu4NySSRMf33j7vpGeVcquDS8cv5UHc9+hHM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PKTwMKuRiBiZxhPtPkwA7XJOCm4hErBcMSTkxABGianqEK7KNrciBhuesI6tydfL9 PSYzX+x8E71Me+yLR71muXROX0fDNLWr9hD6QgiiA/+VJpUGwVBFe4htsZKcXVJVtB 9RpDaIP8idtQTvheutm0qc4q20pqu/ZR5kOoJkjE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ramesh Thomas , Jason Gunthorpe , Alex Williamson , Sasha Levin Subject: [PATCH 5.15 351/620] vfio/pci: Enable iowrite64 and ioread64 for vfio pci Date: Mon, 10 Mar 2025 18:03:17 +0100 Message-ID: <20250310170559.464805967@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250310170545.553361750@linuxfoundation.org> References: <20250310170545.553361750@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ramesh Thomas [ Upstream commit 2b938e3db335e3670475e31a722c2bee34748c5a ] Definitions of ioread64 and iowrite64 macros in asm/io.h called by vfio pci implementations are enclosed inside check for CONFIG_GENERIC_IOMAP. They don't get defined if CONFIG_GENERIC_IOMAP is defined. Include linux/io-64-nonatomic-lo-hi.h to define iowrite64 and ioread64 macros when they are not defined. io-64-nonatomic-lo-hi.h maps the macros to generic implementation in lib/iomap.c. The generic implementation does 64 bit rw if readq/writeq is defined for the architecture, otherwise it would do 32 bit back to back rw. Note that there are two versions of the generic implementation that differs in the order the 32 bit words are written if 64 bit support is not present. This is not the little/big endian ordering, which is handled separately. This patch uses the lo followed by hi word ordering which is consistent with current back to back implementation in the vfio/pci code. Signed-off-by: Ramesh Thomas Reviewed-by: Jason Gunthorpe Link: https://lore.kernel.org/r/20241210131938.303500-2-ramesh.thomas@intel.com Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/vfio/pci/vfio_pci_rdwr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_rdwr.c index 82ac1569deb05..e45c15e210ffd 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c @@ -16,6 +16,7 @@ #include #include #include +#include #include -- 2.39.5