Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp177037rwb; Tue, 4 Oct 2022 02:22:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ANkvvWzNAG5kk3LoF9c9Fyd2Ph+Xr/E7iiBfkSH611ofT1uONBAV/InvWwia20h5rSsL/ X-Received: by 2002:a17:90a:9a82:b0:20a:ac62:beb2 with SMTP id e2-20020a17090a9a8200b0020aac62beb2mr8117610pjp.191.1664875361546; Tue, 04 Oct 2022 02:22:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664875361; cv=none; d=google.com; s=arc-20160816; b=W+ies53ph+wi/vF4hr/CugKDOIcfYUVYrEGD+r4ahGkOyTB1nXe+NO8Y3SP1RYLfwt E8xo+/jLde31jlFLI35qRZCHwkw+vmEdBEu8cBOW+iUbPz4Vi5RuR7kSrW1xy9ztEyA+ 6MPxELrT98Ea6d/jI9a7BHd44SCumwQnCDiiwfXOT8fn6LVTCrYwbmWo6WnTMeid7MnP 7yFIm2mNx9brA+5LbZaE7tFyJ7SSC6v6MQDcg/on3cnT0d2TLLxgcgGPyLjpDB9Odd43 sEyHkLoD3zvVRFxo5KABMqGP8RTQL6AlBFbRE5f4OuVfhN3IYjIu8ocUOhsFSlMTcP4d 5sFg== 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 :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=kChJ5YXyR55NqzsspcQL6vhugqTTUyXdwpS+PG+Hins=; b=txLWOcI5REj/s+zSaur92icWeZLDn+xFK/p6D/TWuRNrCpTA2CTxU03+t2Qfs4V2UC agkm95la1GaFWRw2blPYq702y5GE5390emvfE8Is4WQVzbOWYGGKulV1hZEjiEDRVgQ7 i7ZY6OmwjHN6scQK0tKQt8oQpvqPP9/yZCwDJs35F9p4yXSr7BXgmVmaMfKEt/ns6PvE WKzLrr7HqjDX0fe2F8BcDLeG176wnaNmjklKnrveQMMVV7o53ZUIr+sHAoE2XyMOWjbr BSXjPV+GOPVzlZSMqS5c5flElObffTwk5v0OntVer33GFE1L2p/XmdiGQNHlR6dmBjNa Gsjg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Kw3r1QGt; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 1-20020a17090a0a8100b0020ab232487fsi2249544pjw.62.2022.10.04.02.22.29; Tue, 04 Oct 2022 02:22:41 -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=@redhat.com header.s=mimecast20190719 header.b=Kw3r1QGt; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230124AbiJDIaT (ORCPT + 99 others); Tue, 4 Oct 2022 04:30:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229994AbiJDIaQ (ORCPT ); Tue, 4 Oct 2022 04:30:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3091F1B9F2 for ; Tue, 4 Oct 2022 01:30:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664872215; 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: in-reply-to:in-reply-to:references:references; bh=kChJ5YXyR55NqzsspcQL6vhugqTTUyXdwpS+PG+Hins=; b=Kw3r1QGtzzhZ35c/9Zi8Rv0Ekgzwp9oFMTLNmk/ghIaiSYWROlgguAh0VClghWCuyBkUkt EDXih7xDwahOFuPpIBzvMZ/fj5pLiisy/HKwfW5upYQfCfaRTppFdI8o/F3/MZ+YiZqN+B ORwpCMd5FL8tDUTt31RsF6zG8Cqqc3Q= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-277-dHpftQ3tO1CejMOQxSKHdw-1; Tue, 04 Oct 2022 04:30:13 -0400 X-MC-Unique: dHpftQ3tO1CejMOQxSKHdw-1 Received: by mail-ed1-f70.google.com with SMTP id m10-20020a056402430a00b0045968bb0874so415759edc.10 for ; Tue, 04 Oct 2022 01:30:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=kChJ5YXyR55NqzsspcQL6vhugqTTUyXdwpS+PG+Hins=; b=yoqt78ZNRwm9lhVGSA5A5ItSBlF1KSDYSM+ut8i49NsJgultiCsDSGlGoYEHHGlzKo EBAElej+EKuDn8OLq7Q+WGXzi1daRa2ri7ZcvJ+qPqRTh7rI1wPjXGiD2Brv07Me+KoW z8A0r4kTJxYKijNiamOxYSPNDN0wq3lSf9Y0Ll0yXTfcy2BxqxFRm/Pi0vmqyqhZJrUG glOisOtBqzfqzijK6TLUF48RGKn/taLWVmgoeAx5QHjU0vDdIP2tgrQPlbWHIPcc5Xfg DKGw7hWGka+QKJWvr5LXNY1jJXC4mzxYmrQ7jhUECCC8SoS3rAORwtGf4d6Z6GcAfzDY I5ZQ== X-Gm-Message-State: ACrzQf1Rokk5jrde17a2K7/GB03pqk/cNScOIOV/xu7DRWwxR8eR5kIz pqqwtPg5uRWqQGbiYdDfyCDajC6AQETJchd90O6TxTk7aUD5BsUlEcFH5vPDWsmCYbT5DKgyp1V MOgVCtTldS5sPyyo7W7BPMdFb X-Received: by 2002:a17:907:1626:b0:782:e490:4f4 with SMTP id hb38-20020a170907162600b00782e49004f4mr18347588ejc.464.1664872212801; Tue, 04 Oct 2022 01:30:12 -0700 (PDT) X-Received: by 2002:a17:907:1626:b0:782:e490:4f4 with SMTP id hb38-20020a170907162600b00782e49004f4mr18347564ejc.464.1664872212563; Tue, 04 Oct 2022 01:30:12 -0700 (PDT) Received: from fedora (nat-2.ign.cz. [91.219.240.2]) by smtp.gmail.com with ESMTPSA id by30-20020a0564021b1e00b004590d4e35cdsm1198745edb.54.2022.10.04.01.30.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Oct 2022 01:30:11 -0700 (PDT) From: Vitaly Kuznetsov To: Nadav Amit , Alexander Graf , Ajay Kaher Cc: "x86@kernel.org" , "hpa@zytor.com" , "linux-pci@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "rostedt@goodmis.org" , Srivatsa Bhat , "srivatsa@csail.mit.edu" , Alexey Makhalov , Vasavi Sirnapalli , "er.ajay.kaher@gmail.com" , "willy@infradead.org" , "linux-hyperv@vger.kernel.org" , "kvm@vger.kernel.org" , "jailhouse-dev@googlegroups.com" , "xen-devel@lists.xenproject.org" , "acrn-dev@lists.projectacrn.org" , "helgaas@kernel.org" , "bhelgaas@google.com" , Thomas Gleixner , "mingo@redhat.com" , "bp@alien8.de" , "dave.hansen@linux.intel.com" Subject: Re: [PATCH v2] x86/PCI: Prefer MMIO over PIO on all hypervisor In-Reply-To: <04F550C5-786A-4B8E-9A88-EBFBD8872F16@vmware.com> References: <9FEC6622-780D-41E6-B7CA-8D39EDB2C093@vmware.com> <87zgf3pfd1.fsf@redhat.com> <87tu4l9cfm.fsf@redhat.com> <04F550C5-786A-4B8E-9A88-EBFBD8872F16@vmware.com> Date: Tue, 04 Oct 2022 10:30:10 +0200 Message-ID: <87lepw9ejx.fsf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 Nadav Amit writes: > On Oct 3, 2022, at 8:03 AM, Vitaly Kuznetsov wrote: > >> Not my but rather PCI maintainer's call but IMHO dropping 'const' is >> better, introducing a new global var is our 'last resort' and should be >> avoided whenever possible. Alternatively, you can add a >> raw_pci_ext_ops_preferred() function checking somethin within 'struct >> hypervisor_x86' but I'm unsure if it's better. >>=20 >> Also, please check Alex' question/suggestion. > > Here is my take (and Ajay knows probably more than me): > > Looking briefly on MCFG, I do not see a clean way of using the ACPI table. > The two options are either to use a reserved field (which who knows, might > be used one day) or some OEM ID. I am also not familiar with > PCI_COMMAND.MEMORY=3D0, so Ajay can hopefully give some answer about that. > > Anyhow, I understand (although not relate) to the objection for a new glo= bal > variable. How about explicitly calling this hardware bug a =E2=80=9Cbug= =E2=80=9D and using > the proper infrastructure? Calling it explicitly a bug may even push whoe= ver > can to resolve it. > > IOW, how about doing something along the lines of (not tested): > Works for me. Going forward, the intention shoud be to also clear the bug on other x86 hypervisors, e.g. we test modern Hyper-V versions and if MMIO works well we clear it, we test modern QEMU/KVM setups and if MMIO works introduce a feature bit somewhere and also clear the bug in the guest when the bit is set. --=20 Vitaly