From nobody Wed Nov 27 04:36:58 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1700719436; cv=none; d=zohomail.com; s=zohoarc; b=NHa4KgDUcVe1AbQxl6zVRxD+ElJ+DH3iQqwKNqFdhHJSA79l7K5xAXYkV1YKK2Wx6bfpCzD3UJjDtiTxmXbbJbQ0NfiCD+c1ln+AtzsmmRCBGVTeYz/2KI3AQM6wa0saoltSUr9USyPKDFIRcMXxKVJe58qFXXI6kDiNOWXAPNM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1700719436; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=UBxu/+UajA89qbAes83BzktL3+44LZpIk3RSo6XZDxI=; b=KJvPvLBG4QRz5bAzVMbYU0/AvsgNZCMeY+yNVicIW9l3o/jeokschoOu9OwPUzgt3P1dxaAu+ox5YT/29n7RtuNSiAZP8dkg5leBE6h1s19qOVvWZZRjKFJAzBTStQ5xPRYUAz6OUA+9ZYM3hrzAiQtGCqJPm+YA0cY/3rv6I3Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=@intel.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1700719436271156.02171015710917; Wed, 22 Nov 2023 22:03:56 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r62nv-0002ku-5h; Thu, 23 Nov 2023 01:03:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r62nr-0002dF-Am; Thu, 23 Nov 2023 01:03:08 -0500 Received: from mgamail.intel.com ([134.134.136.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r62np-00005N-A9; Thu, 23 Nov 2023 01:03:07 -0500 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 22:03:01 -0800 Received: from spr-s2600bt.bj.intel.com ([10.240.192.124]) by fmsmga003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Nov 2023 22:02:56 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700719385; x=1732255385; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=XiDgQsyO8IfBEOqRpZwGMATykEtrpSFdKJ11FmST9aU=; b=AbFV6hOl4ZHBH0uCDkkiErRmkaH2c6QHFsBem9gefO7DP+9QVm5tkja5 YiczyyV11SoqIH3S4HwEXpTdnE2gDXrZrz6SdsYJtb01ztAllapFU3BUN abLchGOBN/MO6giv1WjysTbAjZgSR06WzEsFyrRmyo6gTCG3wLf57ac5t 3p5lOX7RivueuKmueFAhP7jGFu1ndHO4DolLYqa1l/Xww+yskKE9pN2Zi 6ORH7A062X2+jcQJZ61osItRnIG40DMEo+PuRkAlRT2BTzJz3MWpozmJZ qqq7Vpo0JS6B71WebQ5mWdNVUWPPb2ZYQCJ8KU+K5dW2cff6cHxMYnbhE A==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="382604288" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="382604288" X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="858024149" X-IronPort-AV: E=Sophos;i="6.04,220,1695711600"; d="scan'208";a="858024149" From: Zhenzhong Duan To: qemu-devel@nongnu.org Cc: chao.p.peng@intel.com, Zhenzhong Duan , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Paolo Bonzini , Nicholas Piggin , Daniel Henrique Barboza , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , David Gibson , Harsh Prateek Bora , qemu-ppc@nongnu.org (open list:PowerPC TCG CPUs) Subject: [PATCH] hw/ppc: Improve build for PPC VFIO Date: Thu, 23 Nov 2023 14:01:09 +0800 Message-Id: <20231123060109.131904-1-zhenzhong.duan@intel.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=134.134.136.20; envelope-from=zhenzhong.duan@intel.com; helo=mgamail.intel.com X-Spam_score_int: -44 X-Spam_score: -4.5 X-Spam_bar: ---- X-Spam_report: (-4.5 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.058, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @intel.com) X-ZM-MESSAGEID: 1700719437936100003 VFIO is not a required subsystem for the pseries machine but it's force enabled currently. When --without-default-devices is used to drop some default devices including vfio-pci, vfio core code is still kept which is unnecessary. Introduce a stub file to hold stub functions of VFIO EEH hooks, then vfio core could be compiled out. Suggested-by: C=C3=A9dric Le Goater Signed-off-by: Zhenzhong Duan Reviewed-by: C=C3=A9dric Le Goater --- Based on vfio-next/vfio-8.2 hw/ppc/spapr_pci_vfio_stub.c | 33 +++++++++++++++++++++++++++++++++ hw/ppc/Kconfig | 2 +- hw/ppc/meson.build | 6 +++--- 3 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 hw/ppc/spapr_pci_vfio_stub.c diff --git a/hw/ppc/spapr_pci_vfio_stub.c b/hw/ppc/spapr_pci_vfio_stub.c new file mode 100644 index 0000000000..adb3fb5e35 --- /dev/null +++ b/hw/ppc/spapr_pci_vfio_stub.c @@ -0,0 +1,33 @@ +#include "qemu/osdep.h" +#include "hw/pci-host/spapr.h" + +bool spapr_phb_eeh_available(SpaprPhbState *sphb) +{ + return false; +} + +void spapr_phb_vfio_reset(DeviceState *qdev) +{ +} + +int spapr_phb_vfio_eeh_set_option(SpaprPhbState *sphb, + unsigned int addr, int option) +{ + return RTAS_OUT_NOT_SUPPORTED; +} + +int spapr_phb_vfio_eeh_get_state(SpaprPhbState *sphb, int *state) +{ + return RTAS_OUT_NOT_SUPPORTED; +} + +int spapr_phb_vfio_eeh_reset(SpaprPhbState *sphb, int option) +{ + return RTAS_OUT_NOT_SUPPORTED; +} + +int spapr_phb_vfio_eeh_configure(SpaprPhbState *sphb) +{ + return RTAS_OUT_NOT_SUPPORTED; +} + diff --git a/hw/ppc/Kconfig b/hw/ppc/Kconfig index edc6d2d139..b8dabdbfbe 100644 --- a/hw/ppc/Kconfig +++ b/hw/ppc/Kconfig @@ -3,11 +3,11 @@ config PSERIES imply PCI_DEVICES imply TEST_DEVICES imply VIRTIO_VGA + imply VFIO if LINUX # needed by spapr_pci_vfio.c select NVDIMM select DIMM select PCI select SPAPR_VSCSI - select VFIO_PCI if LINUX # needed by spapr_pci_vfio.c select XICS select XIVE select MSI_NONBROKEN diff --git a/hw/ppc/meson.build b/hw/ppc/meson.build index ea44856d43..2df5db2eef 100644 --- a/hw/ppc/meson.build +++ b/hw/ppc/meson.build @@ -34,9 +34,9 @@ ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_TCG'], if_tru= e: files( 'spapr_softmmu.c', )) ppc_ss.add(when: 'CONFIG_SPAPR_RNG', if_true: files('spapr_rng.c')) -ppc_ss.add(when: ['CONFIG_PSERIES', 'CONFIG_LINUX'], if_true: files( - 'spapr_pci_vfio.c', -)) +ppc_ss.add(when: [ 'CONFIG_VFIO_PCI', 'CONFIG_PSERIES', 'CONFIG_LINUX'], + if_true: files('spapr_pci_vfio.c'), + if_false: files('spapr_pci_vfio_stub.c')) =20 # IBM PowerNV ppc_ss.add(when: 'CONFIG_POWERNV', if_true: files( --=20 2.34.1