Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3741035pxy; Tue, 4 May 2021 08:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQjQoIlmB+OCEj02MbyZPTj5Afz6fzAFqr5G48ZEKCOLfU99mRnLIVYKBNWPJKSqj28ZZJ X-Received: by 2002:a17:906:5652:: with SMTP id v18mr22911254ejr.457.1620143745939; Tue, 04 May 2021 08:55:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620143745; cv=none; d=google.com; s=arc-20160816; b=P6LZbHHDX8eX9alj4E93mBuPC67C3+pEfZa8s/B6q/qZqdd2CYWQsfmYQN2xBhhrur l6zBRm0E85hJ8WFKxPQNfDc86ZOexOsilSMpaDmvXiNzxAcCeGVSvQEs/nMvRtzhX7Mf A71XGDartxIuSZEsz4i2VZCwDwgKqOLFbjpatw9q1biYIFq3zAiAjOkq2qSBMOAR8Y8C xUC1vxDjqg4zeqJVAiU8Gt4CRt8D1lgYtRJikD4Vu9XKKXqye3KzOxivvUM+qbb1z84S 2WWAt6z8PFFolN+ofjp8ILApbt2Flwg8AqRYzENhDRvsfKab/NgAVyv7EAC8Hxh+YH4z WZ4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:date:cc:to:from:subject:dkim-signature; bh=+a+ZchBSphuAXQvcuIUOn9Rh82lP2Y2KDctoB7uZ/q8=; b=X514LfsLPeLXyDcgf2npHTgOPDPt8CkeUlL/WymPe0G0u1P5okqwF79o+mmrmvc5I6 EEkdvANOwpuKRqMjnM6SM75xi6pLML+DduW99tTlp2EpBIx7bd5Y1eN6OA9xXU0hCFzx Ee+8OENCiHZtjsze/TNUqa4hyH/vHGIsvmOVS1xzPIytBE96PV2L9Qju2Q16KW1h0/ZH X/ecUd2UA4fUwnX4zAW7L2BDAlj89vAz5qap+/mgfAdZveTiZV1f/jTf8M64JnaxN4ts VnQrFZ1aLOkF4dIEMgRo8aRMYi5nFnHgrTIXbLrfp8vBXNiwislhgWfNiEB0ukDXWbYQ 1zIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KLRIX7aL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t12si2846502edc.179.2021.05.04.08.55.22; Tue, 04 May 2021 08:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=KLRIX7aL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbhEDPxJ (ORCPT + 99 others); Tue, 4 May 2021 11:53:09 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:31202 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231237AbhEDPxI (ORCPT ); Tue, 4 May 2021 11:53:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620143533; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+a+ZchBSphuAXQvcuIUOn9Rh82lP2Y2KDctoB7uZ/q8=; b=KLRIX7aLiytCRWHF9Sfw1Qw0q9QMCNghSQdT8c7vxUCHHNH40Ci4zIlhBFaX4lENtkHsrM cTGNke9J1JQkUs/aLo520POmVr/A7PR4xdoBJxB/qwgj0Md4n2Aj/qFDCH+mYvOcKnTGEh RQz1J+3bo+mB00FjRoBgOxZBWLZ5xDA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-406-NU7xVnh-M1OmVkmm_ha7eA-1; Tue, 04 May 2021 11:52:11 -0400 X-MC-Unique: NU7xVnh-M1OmVkmm_ha7eA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 0CD041074640; Tue, 4 May 2021 15:52:10 +0000 (UTC) Received: from [172.30.42.188] (ovpn-113-225.phx2.redhat.com [10.3.113.225]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0064C60C0F; Tue, 4 May 2021 15:52:02 +0000 (UTC) Subject: [PATCH] vfio/pci: Revert nvlink removal uAPI breakage From: Alex Williamson To: kvm@vger.kernel.org, groug@kaod.org, hch@lst.de, gregkh@linuxfoundation.org, daniel@ffwll.ch Cc: linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, qemu-devel@nongnu.org, linuxppc-dev@lists.ozlabs.org, qemu-ppc@nongnu.org Date: Tue, 04 May 2021 09:52:02 -0600 Message-ID: <162014341432.3807030.11054087109120670135.stgit@omen> User-Agent: StGit/1.0-8-g6af9-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Revert the uAPI changes from the below commit with notice that these regions and capabilities are no longer provided. Fixes: b392a1989170 ("vfio/pci: remove vfio_pci_nvlink2") Reported-by: Greg Kurz Signed-off-by: Alex Williamson --- Greg (Kurz), please double check this resolves the issue. Thanks! include/uapi/linux/vfio.h | 46 +++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h index 34b1f53a3901..ef33ea002b0b 100644 --- a/include/uapi/linux/vfio.h +++ b/include/uapi/linux/vfio.h @@ -333,10 +333,21 @@ struct vfio_region_info_cap_type { #define VFIO_REGION_SUBTYPE_INTEL_IGD_LPC_CFG (3) /* 10de vendor PCI sub-types */ -/* subtype 1 was VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM, don't use */ +/* + * NVIDIA GPU NVlink2 RAM is coherent RAM mapped onto the host address space. + * + * Deprecated, region no longer provided + */ +#define VFIO_REGION_SUBTYPE_NVIDIA_NVLINK2_RAM (1) /* 1014 vendor PCI sub-types */ -/* subtype 1 was VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD, don't use */ +/* + * IBM NPU NVlink2 ATSD (Address Translation Shootdown) register of NPU + * to do TLB invalidation on a GPU. + * + * Deprecated, region no longer provided + */ +#define VFIO_REGION_SUBTYPE_IBM_NVLINK2_ATSD (1) /* sub-types for VFIO_REGION_TYPE_GFX */ #define VFIO_REGION_SUBTYPE_GFX_EDID (1) @@ -630,9 +641,36 @@ struct vfio_device_migration_info { */ #define VFIO_REGION_INFO_CAP_MSIX_MAPPABLE 3 -/* subtype 4 was VFIO_REGION_INFO_CAP_NVLINK2_SSATGT, don't use */ +/* + * Capability with compressed real address (aka SSA - small system address) + * where GPU RAM is mapped on a system bus. Used by a GPU for DMA routing + * and by the userspace to associate a NVLink bridge with a GPU. + * + * Deprecated, capability no longer provided + */ +#define VFIO_REGION_INFO_CAP_NVLINK2_SSATGT 4 + +struct vfio_region_info_cap_nvlink2_ssatgt { + struct vfio_info_cap_header header; + __u64 tgt; +}; -/* subtype 5 was VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD, don't use */ +/* + * Capability with an NVLink link speed. The value is read by + * the NVlink2 bridge driver from the bridge's "ibm,nvlink-speed" + * property in the device tree. The value is fixed in the hardware + * and failing to provide the correct value results in the link + * not working with no indication from the driver why. + * + * Deprecated, capability no longer provided + */ +#define VFIO_REGION_INFO_CAP_NVLINK2_LNKSPD 5 + +struct vfio_region_info_cap_nvlink2_lnkspd { + struct vfio_info_cap_header header; + __u32 link_speed; + __u32 __pad; +}; /** * VFIO_DEVICE_GET_IRQ_INFO - _IOWR(VFIO_TYPE, VFIO_BASE + 9,