Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp858139pxb; Tue, 29 Mar 2022 11:46:03 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvNSnnmrNKqrnq8HoDgcJ69HCwaxOx5tM2lHOTZeS7i0zMMXABPk4vKt6vk1X2jbTv84uX X-Received: by 2002:a05:6a00:130c:b0:4bd:118:8071 with SMTP id j12-20020a056a00130c00b004bd01188071mr29288229pfu.28.1648579562245; Tue, 29 Mar 2022 11:46:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648579562; cv=none; d=google.com; s=arc-20160816; b=vYeLapJ2QJqNMb5Jk8WPh4vdWJl/k4buwF2dGflRoqU02SkUfpCYKHbhQWfORCEezc 1KGFlnnco+v0IKjVdDa5HdCfP3xmaDEdgiLnskFuw+VFfVbKJfUMLT5RJvtSf9kCAH+9 cZFZ6l21KkE1wKwP/v2DEghwvAJk+8VjZtYW0JpZh6OXHp6ZhlyhCp6zD3jkFa2nLqza Vkh4kObP5cDVQ+1bpVTsMeWpxqQ7tXMK+DSyfQJJSj6qAsXCgH20r/3BFaNTJqiW27f2 lAuuYXE8T3+vT5yCcHYBJx6idUtyL9RvXuYjPeBpihObxHTFZwKaWS9sJ8nsm2X8vzkh ZHsA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=T2jLrwWe1iSHMc5kpeBG3DQY2pIuRegpnsz85M8uusM=; b=y4pNOXwtiW62wgzhIuqj3G9hEcW4GkgRLRmtszaszcJORkwza0l+iCgRM5vGfg1IgQ fqDWXhyLCs3YWgX27TouJ1wAh+cPgTbWESdMPUsQR/EGZifKb3oA6vx+kOqfjb9RzkpY Ku+oiMWLnnAoA0BbHvB+QhvPoc8iNFmSBT9gsRVujotK1kRJOoa4Mp7TEKfUOXNINMsb aqXP2asLWblqUjky+iqKUwn/MuEHbn/Md5H3GcrX1mvMmN1UKV5KvocUzQaz/uv2W2rC 2yiJKbbYOr99RlB1V5IhSyu6GS8U5Xn259fMsxFsIcqDHUnQnEsmvGlrENUf8tj5THIc RHOw== ARC-Authentication-Results: i=1; mx.google.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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a17090322c900b00153b2d164c2si20125532plg.202.2022.03.29.11.45.45; Tue, 29 Mar 2022 11:46:02 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236223AbiC2MRQ (ORCPT + 99 others); Tue, 29 Mar 2022 08:17:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232767AbiC2MRP (ORCPT ); Tue, 29 Mar 2022 08:17:15 -0400 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F02A234558; Tue, 29 Mar 2022 05:15:32 -0700 (PDT) Received: by mail-wm1-f46.google.com with SMTP id h16so10166965wmd.0; Tue, 29 Mar 2022 05:15:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=T2jLrwWe1iSHMc5kpeBG3DQY2pIuRegpnsz85M8uusM=; b=W1MpE2ttN/acM+zNpdMUgN21uUTsn2ELEePtgInxF33vAy5ddUq/sQYhlLifeWTEdH wQLQcbm9Vq3dv6hCn9lw5vGKDw6VRB7JTS/fiLYvUqMnIwPxB4w2EI9zFXS6fLwb6Jsm 2la0ADxXxOq4EXTrnQSaWT4h8fcyYPPb0IQ8Mls1vHFp00HbJ7lFpGjyqcEwvUI/PI5h cQ3UrWR0RnaO25IMwqyjx4MvoNb/P95WmYkd07ofCZrH8zCBqe23q2CWSqbP42Qv2imj AYeI5IwjpDatUltr5yhn5+WvrajsrchtiQ2HfJ8Ahofgi2wY2KXN/v/BOllo99gO0PwR dccw== X-Gm-Message-State: AOAM533YwnvETz6S0/KoAkkmiy8jSrrT8sKjXvM7k91C4mfMVVbpp2R2 3Y8Cj+w//qWrQPGnBM/zYpc= X-Received: by 2002:a05:600c:4ec9:b0:38c:9146:563 with SMTP id g9-20020a05600c4ec900b0038c91460563mr6670263wmq.198.1648556130816; Tue, 29 Mar 2022 05:15:30 -0700 (PDT) Received: from liuwe-devbox-debian-v2 ([51.145.34.42]) by smtp.gmail.com with ESMTPSA id c1-20020a5d4141000000b00205d3d37dcdsm904568wrq.103.2022.03.29.05.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Mar 2022 05:15:30 -0700 (PDT) Date: Tue, 29 Mar 2022 12:15:28 +0000 From: Wei Liu To: Michael Kelley Cc: sthemmin@microsoft.com, kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, rafael@kernel.org, lenb@kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, bhelgaas@google.com, hch@lst.de, m.szyprowski@samsung.com, robin.murphy@arm.com, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, iommu@lists.linux-foundation.org Subject: Re: [PATCH v3 0/2] Fix coherence for VMbus and PCI pass-thru devices in Hyper-V VM Message-ID: <20220329121528.lrk4fjfgpw3yg3bg@liuwe-devbox-debian-v2> References: <1648138492-2191-1-git-send-email-mikelley@microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1648138492-2191-1-git-send-email-mikelley@microsoft.com> X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 On Thu, Mar 24, 2022 at 09:14:50AM -0700, Michael Kelley wrote: > Hyper-V VMs have VMbus synthetic devices and PCI pass-thru devices that are added > dynamically via the VMbus protocol and are not represented in the ACPI DSDT. Only > the top level VMbus node exists in the DSDT. As such, on ARM64 these devices don't > pick up coherence information and default to not hardware coherent. This results > in extra software coherence management overhead since the synthetic devices are > always hardware coherent. PCI pass-thru devices are also hardware coherent in all > current usage scenarios. > > Fix this by propagating coherence information from the top level VMbus node in > the DSDT to all VMbus synthetic devices and PCI pass-thru devices. While smaller > granularity of control would be better, basing on the VMbus node in the DSDT > gives as escape path if a future scenario arises with devices that are not > hardware coherent. > > Changes since v2: > * Move coherence propagation for VMbus synthetic devices to a separate > .dma_configure function instead of the .probe fucntion [Robin Murphy] > > Changes since v1: > * Use device_get_dma_attr() instead of acpi_get_dma_attr(), eliminating the > need to export acpi_get_dma_attr() [Robin Murphy] > * Use arch_setup_dma_ops() to set device coherence [Robin Murphy] > * Move handling of missing _CCA to vmbus_acpi_add() so it is only done once > * Rework handling of PCI devices so existing code in pci_dma_configure() > just works > > Michael Kelley (2): > Drivers: hv: vmbus: Propagate VMbus coherence to each VMbus device > PCI: hv: Propagate coherence from VMbus device to PCI device Patch 2 will not be very useful without patch 1 so I've applied the whole series to hyperv-fixes. Thanks.