From nobody Tue Jun 30 05:29:27 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC037C433EF for ; Mon, 24 Jan 2022 23:55:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2365689AbiAXXv3 (ORCPT ); Mon, 24 Jan 2022 18:51:29 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:29842 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1845207AbiAXXLo (ORCPT ); Mon, 24 Jan 2022 18:11:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643065902; 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=+xq1dvb+auyrR+UeLJpXMeONNpkCtEYu5jUsqN8ZMlw=; b=cwVVkXKmm5myp4R+HpJuRBRpJX/qHbBEQcp3KO3NSpntY1c7NWX3S7229L88Aei/B89UA2 bdzV3Ny4VXeewTSI31FDPH1iikwyNARN+/UI/Xsx0hzuKADKQ3cF/uVpLTPQ1F8lR4HY1H 0b14Cwh6Gb6OaSKB77yQsnMDAOC6MJ8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-220-ld2GHqSqO42Wyt0MthM2yA-1; Mon, 24 Jan 2022 18:11:39 -0500 X-MC-Unique: ld2GHqSqO42Wyt0MthM2yA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 26F90835B47; Mon, 24 Jan 2022 23:11:38 +0000 (UTC) Received: from [172.30.41.16] (unknown [10.2.18.27]) by smtp.corp.redhat.com (Postfix) with ESMTP id B49C5108B4; Mon, 24 Jan 2022 23:11:37 +0000 (UTC) Subject: [PATCH] vfio/pci: Stub vfio_pci_vga_rw when !CONFIG_VFIO_PCI_VGA From: Alex Williamson To: alex.williamson@redhat.com Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org Date: Mon, 24 Jan 2022 16:11:37 -0700 Message-ID: <164306582968.3758255.15192949639574660648.stgit@omen> User-Agent: StGit/1.0-8-g6af9-dirty MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Resolve build errors reported against UML build for undefined ioport_map() and ioport_unmap() functions. Without this config option a device cannot have vfio_pci_core_device.has_vga set, so the existing function would always return -EINVAL anyway. Link: https://lore.kernel.org/r/20220123125737.2658758-1-geert@linux-m68k.o= rg Signed-off-by: Alex Williamson --- drivers/vfio/pci/vfio_pci_rdwr.c | 2 ++ include/linux/vfio_pci_core.h | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/drivers/vfio/pci/vfio_pci_rdwr.c b/drivers/vfio/pci/vfio_pci_r= dwr.c index 57d3b2cbbd8e..82ac1569deb0 100644 --- a/drivers/vfio/pci/vfio_pci_rdwr.c +++ b/drivers/vfio/pci/vfio_pci_rdwr.c @@ -288,6 +288,7 @@ ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vd= ev, char __user *buf, return done; } =20 +#ifdef CONFIG_VFIO_PCI_VGA ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, char __user *bu= f, size_t count, loff_t *ppos, bool iswrite) { @@ -355,6 +356,7 @@ ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vd= ev, char __user *buf, =20 return done; } +#endif =20 static void vfio_pci_ioeventfd_do_write(struct vfio_pci_ioeventfd *ioevent= fd, bool test_mem) diff --git a/include/linux/vfio_pci_core.h b/include/linux/vfio_pci_core.h index ef9a44b6cf5d..ae6f4838ab75 100644 --- a/include/linux/vfio_pci_core.h +++ b/include/linux/vfio_pci_core.h @@ -159,8 +159,17 @@ extern ssize_t vfio_pci_config_rw(struct vfio_pci_core= _device *vdev, extern ssize_t vfio_pci_bar_rw(struct vfio_pci_core_device *vdev, char __u= ser *buf, size_t count, loff_t *ppos, bool iswrite); =20 +#ifdef CONFIG_VFIO_PCI_VGA extern ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, char __u= ser *buf, size_t count, loff_t *ppos, bool iswrite); +#else +static inline ssize_t vfio_pci_vga_rw(struct vfio_pci_core_device *vdev, + char __user *buf, size_t count, + loff_t *ppos, bool iswrite) +{ + return -EINVAL; +} +#endif =20 extern long vfio_pci_ioeventfd(struct vfio_pci_core_device *vdev, loff_t o= ffset, uint64_t data, int count, int fd);