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 5F75125DB0D; Tue, 11 Mar 2025 15:10:40 +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=1741705840; cv=none; b=ajkuSLXpWKDQzQPyxcQ3hTxqPZcznctt4wk5HA+wbkYqEKwdX5HOLLnAkhtSoUzmlvCPLGimxSG6RdO4UZSMgDs1OINrZWkk/wcCrUDE8KAHXpK/MONzIhf1FFMcj8zGf+iPzkzg+7JngfWEY+YVoqK+blbIdF30RRlCw6obMM0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741705840; c=relaxed/simple; bh=y5OHewpNqtP78jxV+GuSTeK2PGP0qXuoPMS+qbAlotI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=l8rTy1VN2nRiMF8gVIRD9OrlA+HCSfprHSGZ+dvavoM9XzfjlW9b7m4Fc5yQKULpCWAKngdZFWVnRiHz5W6OHn01wSrgrk2qzi6sYF3XalTj/jydSD7oJnqj8w5B8rC1cyPokBLyZcm1sJArN6QzNpzH91+EldIx20y9xuk6jm8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2DPrxYQb; 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="2DPrxYQb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CF732C4CEEF; Tue, 11 Mar 2025 15:10:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1741705840; bh=y5OHewpNqtP78jxV+GuSTeK2PGP0qXuoPMS+qbAlotI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2DPrxYQbnqaI5+6h/vB79/4zb1HTZW+scDwFvT09Pqx8u3qzETvjOL4nf6b5jPUSr jP0W3kuLWNqxzs4SyHqkVoJDcp45z4rrsgSMNNljPJOh8SmleBLnA6SIC4ODsqKDNg F1PUG1WwlQ6nJ0FZWOTsNJToohz6hRth3fpSsMgM= 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.4 173/328] vfio/pci: Enable iowrite64 and ioread64 for vfio pci Date: Tue, 11 Mar 2025 15:59:03 +0100 Message-ID: <20250311145721.784355672@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250311145714.865727435@linuxfoundation.org> References: <20250311145714.865727435@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.4-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 83f81d24df78e..94e3fb9f42243 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