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 E57AC1B4250; Wed, 29 Jan 2025 14:02:59 +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=1738159380; cv=none; b=h2fMIEqANQITvCM+59LnWEpEpNXdqP3MFhXUNGG1FRrOinfY+A3YhlCMWh64230kNarT3WYw9WPCGoExfe2I1f8JP0S0pXi/IsJ+PrhmL4QhWlUukcTHzbH2RzDsZSrWr6QMzvYCWu4uApyDoe/cBo6JV0Aj7+n+0llkWhKYK38= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738159380; c=relaxed/simple; bh=29j8ZbfZZys3Tq+aYvAEHgAt0+YHfEqx21MhQu6YHcM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kiovyup2yq5RCpUm4OziUeQrY4Y41dGDVCxyM08W51VP4sqRdln0qhkyyuuT/YMjYxdz/KqunlSHkjDrZ+GWMnGSVTwSZt+iOAJRvzwCDEcpLmLjU1/O4QdlXah0NsYGYGiNZ97cZ++tFw4W8LwT2m7HNn3MuG3/Sdj9c4RYsoY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=hOwT9Gmj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="hOwT9Gmj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 191A0C4CEDF; Wed, 29 Jan 2025 14:02:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1738159379; bh=29j8ZbfZZys3Tq+aYvAEHgAt0+YHfEqx21MhQu6YHcM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hOwT9GmjcE/NiujkdpQDSVCD1mqQ8VZZ/2eyP7xPgPWVZX1lcBQtutz4GHLmUniVf yMiUuB/2LqlgtNiO2+jA5XItqfcICGBicyy31tJBN3UwqkKq92ngMP1nBPhL8yFwFi 7yx/unwcKaKI66jr+lD+Me5XsvNqj2eZAYWN65+IIGi19+tNcTpvkvkLNyC7qfMKOi 5emC5vjpdFBrSK3sxAKrqi2b/tUYzOfcm/Hpb2m3l34xyyMjcYV/ttDeqfcafN76LB kyo2LjW6F0dm/U3f261lWFXz0XnGCvOozm0QGwtXAKk7Pne8kRC20w9PF37OBlPbeq Ms/PDBjJ91sLw== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ramesh Thomas , Jason Gunthorpe , Alex Williamson , Sasha Levin , gbayer@linux.ibm.com, Yunxiang.Li@amd.com, jgg@ziepe.ca, bpsegal@us.ibm.com, ankita@nvidia.com, kvm@vger.kernel.org Subject: [PATCH AUTOSEL 6.13 5/8] vfio/pci: Enable iowrite64 and ioread64 for vfio pci Date: Wed, 29 Jan 2025 07:58:58 -0500 Message-Id: <20250129125904.1272926-5-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250129125904.1272926-1-sashal@kernel.org> References: <20250129125904.1272926-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13 Content-Transfer-Encoding: 8bit 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