Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp4034495rwb; Tue, 6 Sep 2022 01:09:33 -0700 (PDT) X-Google-Smtp-Source: AA6agR6dLHT3pTCQ1j+Jfn4OaNjOrvM1GvH0Yt9CiR1qNEjxt8QtVKfJknElQHo5ZFRwu9AbUxOh X-Received: by 2002:a17:907:86aa:b0:741:a0d5:43bc with SMTP id qa42-20020a17090786aa00b00741a0d543bcmr27675629ejc.100.1662451773518; Tue, 06 Sep 2022 01:09:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662451773; cv=pass; d=google.com; s=arc-20160816; b=JTZ2d/qGFbqeBCBZ5sJjCT4btxAqtsgDDgmyYsYGrS4Jc2KZyjb4cxn0dcV3f/ad4J F6DPv7oMgiFIGpSyDvfIhVIzKtnK4tNRDWxq1UU3uwZkRlmedxOpoMAdRbmt8EVfjYgh nwBEy/YMJKBFBHKCBnZKwyBiob+JFJlPwT9YhY6ngu4fqBVv0PFn1wvaeTr035gAaqb4 M9q3Ki2v44yaylvH5TkJ3gPBSZ8QLIeJtnGWAhxK2qJK2+yGVD81/M/5njk9j+Vl7H2K yTnWb0GyIESLQqqTd6rwdyzUJCK6zSyJ3c1WouHE19QrpDP3EbJthTksuROeLRRIQezK wGAg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :message-id:date:subject:cc:to:from:dkim-signature; bh=tVqjBGkFgXrs31AA2OHw7MU01gBpvRs6t5y6CM6f2Tg=; b=Pdxu8j4A0Jh1xpbObLX2BGiwKvztcwxU9Rlj5JigyBAuClPcWHtxCzZLrgjyeSWH8m t6p7bNbUqWO6w3gHSThjGBtiyjwU0q0eyCRFG2K+xja9q+Sgy3ToBbfBYw3EJjPkoks/ iHuuspkeAb2tJUufweBDDHOnw43R+dZqz0zzJdtfbMIy2tA6eToo9TOJHveiRyy81MZB Ck1rvmR8oQw8xjUwvlzXe48WbuQk5LpUrKaTEmQb2Mg0qRg4G/zykh2rmUWwBLiG21gZ gvVjQH9mnCMbHFOmmZhCK3WRQCJBLDnhSMI7lqm+jffy/vtH6w0kb6mMeK3hCxFipr30 ZUAA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=zn+MsRJl; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa35-20020a17090786a300b00734b66a6d0dsi9735045ejc.3.2022.09.06.01.09.07; Tue, 06 Sep 2022 01:09:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=zn+MsRJl; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233473AbiIFHJT (ORCPT + 99 others); Tue, 6 Sep 2022 03:09:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbiIFHJP (ORCPT ); Tue, 6 Sep 2022 03:09:15 -0400 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2075.outbound.protection.outlook.com [40.107.94.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0297565663; Tue, 6 Sep 2022 00:09:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dY1wPXHnrMEnxZciiGfS4XSgRUh/IXWahcmOFtN/+OdybMsqd+W9x/lxWaIUsqZoTHsH4rsItI3kf/WVJyG9N4L1/3650PE0b5ekY7q7/TkyYk1kaFTRV71pcqZg0cYrsNOH50wqJfo+3oaq1+hLEdabZ+g0ZXt8ot9tZR/4nLnlzrX7nNcByzU06t59VYkKLaeR5Ca7notRErd3djgctnEd0RhZjM82yjSahbJ+wXD8lh6GP3XvVrWWQZ0NK6ie5ynRxZ4jtoffE5znaOCBXc1E5adrXc9H20HBkP+h+M2P4AsoPbXJZVz0STnp89ZuoKucMcF56QktfLboXeanuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=tVqjBGkFgXrs31AA2OHw7MU01gBpvRs6t5y6CM6f2Tg=; b=lOjDBVufiEWaMCHFThqVBpo69/Ca31qNmAVV5ydA1N/za1AnL70f597eaeTUBLXh7c5GOQ8Cx1iP3NgeHOT/gpLn9pkmeyCzmcVRxIDxq3GRLtBeaYyTT+bQZt4vVfZGcjnMHn5XMX5nisIerqCYxNqztaQBm686q3OA1EwFNuEh4Uo0fxQoJN1wvBrLQcVSnIaEJZLsd+aYS94sZ8qLcjGPPwAKg/8L83hf9DmRz+kTHdVJEaVbrIdJxk9/TIuA21lA8Db30Mp7jWNW0m40fbeWAT4dB4iZbyzWe270UXcfEKsTJfKpSGMP7n8rD821EzIvoB4/5Vw7pE3xM0srww== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tVqjBGkFgXrs31AA2OHw7MU01gBpvRs6t5y6CM6f2Tg=; b=zn+MsRJlDS55rB9koppwTf9JIKLqRyfwc9/3fsa+EyQq1LsG/Ej88qKLWxqlQ9HMBg9TQdzHm5bHYB8dNb5HZ77UVn+5BWw2vEp6rM6MeB/yDVsMEcgd9VZRx+u8GRb4FhMwPCoBW+1jbfjxu8akK3rfxsEI3r68Bek3vxInxPI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; Received: from PH0PR05MB8703.namprd05.prod.outlook.com (2603:10b6:510:bd::5) by DM6PR05MB4970.namprd05.prod.outlook.com (2603:10b6:5:31::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5612.5; Tue, 6 Sep 2022 07:09:11 +0000 Received: from PH0PR05MB8703.namprd05.prod.outlook.com ([fe80::95af:33a4:b350:c335]) by PH0PR05MB8703.namprd05.prod.outlook.com ([fe80::95af:33a4:b350:c335%8]) with mapi id 15.20.5612.012; Tue, 6 Sep 2022 07:09:11 +0000 From: Ajay Kaher To: helgaas@kernel.org, bhelgaas@google.com, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com Cc: x86@kernel.org, hpa@zytor.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, rostedt@goodmis.org, srivatsab@vmware.com, srivatsa@csail.mit.edu, amakhalov@vmware.com, vsirnapalli@vmware.com, er.ajay.kaher@gmail.com, willy@infradead.org, namit@vmware.com, linux-hyperv@vger.kernel.org, kvm@vger.kernel.org, jailhouse-dev@googlegroups.com, xen-devel@lists.xenproject.org, acrn-dev@lists.projectacrn.org Subject: [PATCH v2] x86/PCI: Prefer MMIO over PIO on VMware hypervisor Date: Tue, 6 Sep 2022 12:38:37 +0530 Message-Id: <1662448117-10807-1-git-send-email-akaher@vmware.com> X-Mailer: git-send-email 2.7.4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-ClientProxiedBy: BYAPR05CA0061.namprd05.prod.outlook.com (2603:10b6:a03:74::38) To PH0PR05MB8703.namprd05.prod.outlook.com (2603:10b6:510:bd::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR05MB8703:EE_|DM6PR05MB4970:EE_ X-MS-Office365-Filtering-Correlation-Id: 361688ab-6f30-4422-58aa-08da8fd6b2f1 X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rpEmG/ZTZD41ci8rzga319nfcfWs6F4whtCEkJI1igtHShj/5o1VLFdArTGqtjMdJUQ3j1333o5vV/Px1O0GG2Uj3zj4cq7EBbEGguwtuYnG5WIzK014XG1a0SNRRgHxy+QGhgx78DPW/4hP/rPKdkm46Fq32f/JlnYXfu9fAgz3YWw6gWVRZ1uLE9Wk41ANTglPoqfvyd1FcExNpN3JePJe4sH7NLghX6okgRdiytGbNtziY91ftsvWi29UMKDMINRi6zUmWJZpuv5MPmedTsHEu0m1L1QttboRINoi06f0XUdZXfLYw5MTbIsktHtLW33/6Y46vb4nt2jCe269qOC9cXOy4nQHmZTBL7j4jq4mYUEtRuiKN51HVsLHxts5DVJxTmG3pK/89SJKCisLEDJ6zIC/ib/p3bZ2vvQyJKUfxzcfkErOwElh4SEXu5yJ7swQ8PiEghfIm0g2kc8nFLG3skw8+p01cV3BkoKkxArc7qtWQUDYczpG+TJEs+gZXNp2TfgFvX69zGcuhV16L05T83k9fi5MHBweme39oWZYLD1PXSJ4DBHvkTEXmMrK+OPt6NjIbuCdWOty8rltMwG+zYD4+ZaCzZobICxj/++mWLqADs7AixCOHeN9sNIplsC374NGmwCnH1vmWGSVj29LORst5AuIwRxWUKbF92Q4ee4VRAjEGZOlb+Qd5wTOhuAtFMiJrTWcvOMzkK/VbE/ocOYSloUCw7SUZd4AUcgfrKYFhnkJgpTdnwMIh3oVz6eR6dz2TT9zucNl6YOmTGKhfQFshJnL4y0VEi1NzK3XWey4TwqPevATsZhAuBHb X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR05MB8703.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(4636009)(39860400002)(346002)(366004)(376002)(136003)(396003)(38350700002)(38100700002)(4326008)(8676002)(66946007)(66556008)(66476007)(316002)(2906002)(7416002)(26005)(5660300002)(8936002)(6512007)(52116002)(83380400001)(2616005)(186003)(6666004)(41300700001)(6486002)(6506007)(86362001)(36756003)(478600001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?cmthdHdLNFUwaVhQU08zS2ZzaUQwd3ppUUpKM3BFeVVnTDZYTzRjZGQ5NHcy?= =?utf-8?B?Y0kyRWhmVkY3dTZyd1VnWVEyNkNBM3VnU1ZvZE1ZMmFTWDM5Q2l0dGs1WWk0?= =?utf-8?B?UU5zWTVGMU1ianJsdldkNHk2elk0K0xHcEZEWXNrQndlZFV1cmhyeHhVcGhR?= =?utf-8?B?NjRjQnh2MUhkKzRFSThZT093M0U1MUR3OVZhUkFTWmdaSTg1SmUrT3EzYWpz?= =?utf-8?B?cE9oaUdJWjZtb2IrZ1h6SERzSDI2Ni9oaGVaNHBIS1RRNC9YNHAyamNSSjIw?= =?utf-8?B?cHpNaXpsU25RaFJBY0lZcGFkS2JIU2x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SHdWRDV5ZDh0?= =?utf-8?Q?3d+euH4uv/iBa1JTsHAqiuoX8?= X-OriginatorOrg: vmware.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR05MB4970 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During boot-time there are many PCI config reads, these could be performed either using Port IO instructions (PIO) or memory mapped I/O (MMIO). PIO are less efficient than MMIO, they require twice as many PCI accesses and PIO instructions are serializing. As a result, MMIO should be preferred when possible over PIO. Virtual Machine test result using VMware hypervisor 1 hundred thousand reads using raw_pci_read() took: PIO: 12.809 seconds MMIO: 8.517 seconds (~33.5% faster then PIO) Currently, when these reads are performed by a virtual machine, they all cause a VM-exit, and therefore each one of them induces a considerable overhead. This overhead can be further improved, by mapping MMIO region of virtual machine to memory area that holds the values that the “emulated hardware” is supposed to return. The memory region is mapped as "read-only” in the NPT/EPT, so reads from these regions would be treated as regular memory reads. Writes would still be trapped and emulated by the hypervisor. Virtual Machine test result with above changes in VMware hypervisor 1 hundred thousand read using raw_pci_read() took: PIO: 12.809 seconds MMIO: 0.010 seconds This helps to reduce virtual machine PCI scan and initialization time by ~65%. In our case it reduced to ~18 mSec from ~55 mSec. MMIO is also faster than PIO on bare-metal systems, but due to some bugs with legacy hardware and the smaller gains on bare-metal, it seems prudent not to change bare-metal behavior. Signed-off-by: Ajay Kaher --- v1 -> v2: Limit changes to apply only to VMs [Matthew W.] --- arch/x86/pci/common.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index ddb7986..1e5a8f7 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -20,6 +20,7 @@ #include #include #include +#include unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2 | PCI_PROBE_MMCONF; @@ -57,14 +58,58 @@ int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, return -EINVAL; } +#ifdef CONFIG_HYPERVISOR_GUEST +static int vm_raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 *val) +{ + if (raw_pci_ext_ops) + return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, val); + if (domain == 0 && reg < 256 && raw_pci_ops) + return raw_pci_ops->read(domain, bus, devfn, reg, len, val); + return -EINVAL; +} + +static int vm_raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 val) +{ + if (raw_pci_ext_ops) + return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, val); + if (domain == 0 && reg < 256 && raw_pci_ops) + return raw_pci_ops->write(domain, bus, devfn, reg, len, val); + return -EINVAL; +} +#endif /* CONFIG_HYPERVISOR_GUEST */ + static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { +#ifdef CONFIG_HYPERVISOR_GUEST + /* + * MMIO is faster than PIO, but due to some bugs with legacy + * hardware, it seems prudent to prefer MMIO for VMs and PIO + * for bare-metal. + */ + if (!hypervisor_is_type(X86_HYPER_NATIVE)) + return vm_raw_pci_read(pci_domain_nr(bus), bus->number, + devfn, where, size, value); +#endif /* CONFIG_HYPERVISOR_GUEST */ + return raw_pci_read(pci_domain_nr(bus), bus->number, devfn, where, size, value); } static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { +#ifdef CONFIG_HYPERVISOR_GUEST + /* + * MMIO is faster than PIO, but due to some bugs with legacy + * hardware, it seems prudent to prefer MMIO for VMs and PIO + * for bare-metal. + */ + if (!hypervisor_is_type(X86_HYPER_NATIVE)) + return vm_raw_pci_write(pci_domain_nr(bus), bus->number, + devfn, where, size, value); +#endif /* CONFIG_HYPERVISOR_GUEST */ + return raw_pci_write(pci_domain_nr(bus), bus->number, devfn, where, size, value); } -- 2.7.4