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 D8BDC1DE2D7; Wed, 19 Feb 2025 08:48:54 +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=1739954934; cv=none; b=YKPXny7M+ELCt/qkquuH9tsPq62do+rpB0DpGchELmPDoazXakcmjgOf5GnolhXD9om+DKj3E+6J0cqeKDB9oLvbqo47B8s+JHvwiz3Qt4taoiksfSWswHzqxuZBxJqjL8FPFfUNbgDmPpwwTMF95QSIO+e+/w6YEPgW+/GYnO4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1739954934; c=relaxed/simple; bh=+W60Dpnb0I+NL8nOhcFg7wREbv+iB342XJmT3sYFG6s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bkyH9GPLvLUh5/8EL/iw7lf7y17xfFi1fNMCG+ulNPybvtHdslhbzqWEPvZKkTdTuhSJ4X1CS957gERq1rUDE0jx+Rk69XdR6+Ql91XNJRhtw0S51xYRABiuWHs+EqbfFaWaY6u4nbvA2gzlEprpQkgVlL+eDe+UyMMPe3Kq89U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jhMo/4ZI; 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="jhMo/4ZI" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4BCD4C4CEE6; Wed, 19 Feb 2025 08:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739954934; bh=+W60Dpnb0I+NL8nOhcFg7wREbv+iB342XJmT3sYFG6s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jhMo/4ZIRRP5cGvLPmOT5066E7YzYehLnksSjtk0rValSz08vAdKOj5upX/FJ2xwV Tl5cTeJPGrf0TwxyuxemCRPye0AACcDYLig5uoPwE4lRCRy2dtG8OBITY8PKE5AejJ 9ni3Y30gc6G5xW6m7bl9Bet907/+NTfQiMeKiufI= 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 6.12 081/230] vfio/pci: Enable iowrite64 and ioread64 for vfio pci Date: Wed, 19 Feb 2025 09:26:38 +0100 Message-ID: <20250219082604.870685583@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250219082601.683263930@linuxfoundation.org> References: <20250219082601.683263930@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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 66b72c2892841..a0595c745732a 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_priv.h" -- 2.39.5