From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A90A4C04EBF for ; Mon, 23 Sep 2019 13:35:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 85C7A21906 for ; Mon, 23 Sep 2019 13:35:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2439785AbfIWNfv (ORCPT ); Mon, 23 Sep 2019 09:35:51 -0400 Received: from foss.arm.com ([217.140.110.172]:42372 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2439778AbfIWNfv (ORCPT ); Mon, 23 Sep 2019 09:35:51 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 7FB1C1000; Mon, 23 Sep 2019 06:35:50 -0700 (PDT) Received: from e121566-lin.cambridge.arm.com (e121566-lin.cambridge.arm.com [10.1.196.217]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 7B15B3F694; Mon, 23 Sep 2019 06:35:49 -0700 (PDT) From: Alexandru Elisei To: kvm@vger.kernel.org, will@kernel.org, julien.thierry.kdev@gmail.com Cc: maz@kernel.org, suzuki.poulose@arm.com, julien.grall@arm.com, andre.przywara@arm.com Subject: [PATCH kvmtool 11/16] arm/pci: Remove unused ioports Date: Mon, 23 Sep 2019 14:35:17 +0100 Message-Id: <1569245722-23375-12-git-send-email-alexandru.elisei@arm.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569245722-23375-1-git-send-email-alexandru.elisei@arm.com> References: <1569245722-23375-1-git-send-email-alexandru.elisei@arm.com> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org ARM does not use the PCI_CONFIG_DATA and PCI_CONFIG_ADDRESS I/O ports and has no way of knowing about them, since they are not generated in the DTB file. Do not register these I/O addresses for the ARM architecture. Signed-off-by: Alexandru Elisei --- pci.c | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/pci.c b/pci.c index 689869cb79a3..88ee78ad7d08 100644 --- a/pci.c +++ b/pci.c @@ -68,7 +68,9 @@ static void *pci_config_address_ptr(u16 port) return base + offset; } -static bool pci_config_address_out(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size) +static bool __used pci_config_address_out(struct ioport *ioport, + struct kvm_cpu *vcpu, + u16 port, void *data, int size) { void *p = pci_config_address_ptr(port); @@ -77,7 +79,9 @@ static bool pci_config_address_out(struct ioport *ioport, struct kvm_cpu *vcpu, return true; } -static bool pci_config_address_in(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size) +static bool __used pci_config_address_in(struct ioport *ioport, + struct kvm_cpu *vcpu, + u16 port, void *data, int size) { void *p = pci_config_address_ptr(port); @@ -86,7 +90,7 @@ static bool pci_config_address_in(struct ioport *ioport, struct kvm_cpu *vcpu, u return true; } -static struct ioport_operations pci_config_address_ops = { +static struct ioport_operations __used pci_config_address_ops = { .io_in = pci_config_address_in, .io_out = pci_config_address_out, }; @@ -106,7 +110,9 @@ static bool pci_device_exists(u8 bus_number, u8 device_number, u8 function_numbe return !IS_ERR_OR_NULL(device__find_dev(DEVICE_BUS_PCI, device_number)); } -static bool pci_config_data_out(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size) +static bool __used pci_config_data_out(struct ioport *ioport, + struct kvm_cpu *vcpu, + u16 port, void *data, int size) { union pci_config_address pci_config_address; @@ -122,7 +128,9 @@ static bool pci_config_data_out(struct ioport *ioport, struct kvm_cpu *vcpu, u16 return true; } -static bool pci_config_data_in(struct ioport *ioport, struct kvm_cpu *vcpu, u16 port, void *data, int size) +static bool __used pci_config_data_in(struct ioport *ioport, + struct kvm_cpu *vcpu, + u16 port, void *data, int size) { union pci_config_address pci_config_address; @@ -138,7 +146,7 @@ static bool pci_config_data_in(struct ioport *ioport, struct kvm_cpu *vcpu, u16 return true; } -static struct ioport_operations pci_config_data_ops = { +static struct ioport_operations __used pci_config_data_ops = { .io_in = pci_config_data_in, .io_out = pci_config_data_out, }; @@ -225,6 +233,13 @@ struct pci_device_header *pci__find_dev(u8 dev_num) return hdr->data; } +#if defined(CONFIG_ARM) || defined(CONFIG_ARM64) +int pci__init(struct kvm *kvm) +{ + return kvm__register_mmio(kvm, KVM_PCI_CFG_AREA, PCI_CFG_SIZE, false, + pci_config_mmio_access, kvm); +} +#else int pci__init(struct kvm *kvm) { int r; @@ -250,6 +265,7 @@ err_unregister_data: ioport__unregister(kvm, PCI_CONFIG_DATA); return r; } +#endif dev_base_init(pci__init); int pci__exit(struct kvm *kvm) -- 2.7.4