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 93A9C25BAD4; Tue, 11 Mar 2025 15:30:04 +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=1741707004; cv=none; b=GrUDG6rugMnWi3Efh0kjgP9946kLfSCXO/TLi0ud2rseX6uWiZ0fCkaiLGbKUSv2/SMjAvdaNJQAKZN2+Nh/I3Dqtz5wfbZnKPZFO9IdZ4HuVSPpdcXwFzUbEJW0w0ohaiRz1CJ4iuaq9pVW8HO5u9UTdR2WRt7sZW3wGnVJ9Hs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741707004; c=relaxed/simple; bh=UccYOdO88y4mklDKQePx/znbpI06yPTaujsClgfoPkk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uxL2BbYbLN/pOxuJa9klFE5+Sp068CnFVbFccyeHwPVjRBcqvMxS6kdirzSgEF58Vz6yebCrPPyZmoxhA/fQ6oExWSFHBSrs1iStR1MUVU1tj6gOzjJfDE1zO2wvcrB6BON7X8JoEUomlMSxpdKqdAcPFjnmwYSOq5ZBDDRq3Bk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=qIjsLQAe; 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="qIjsLQAe" Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7868C4CEE9; Tue, 11 Mar 2025 15:30:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741707004; bh=UccYOdO88y4mklDKQePx/znbpI06yPTaujsClgfoPkk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qIjsLQAeDYdiLyH9fCyTezff1bF7iWuvaxfyxvkLKTdEzVmQfk7BCOGeF5980VL3Q HyI2O2I+hlFtLVuIToLqmWGI+vjKsZnNQOdbxxqCP8etbr2lcTX5LMvzlCTqNmQIEJ TZhVDPivliTXeUTqgCWkBgQv9gR5pKb+05p1kVNM= 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.10 240/462] vfio/pci: Enable iowrite64 and ioread64 for vfio pci Date: Tue, 11 Mar 2025 15:58:26 +0100 Message-ID: <20250311145807.848279917@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145758.343076290@linuxfoundation.org> References: <20250311145758.343076290@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.10-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 a0b5fc8e46f4d..fdcc9dca14ca9 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 "vfio_pci_private.h" -- 2.39.5