From patchwork Wed Apr 19 10:46:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13216633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2994FC6FD18 for ; Wed, 19 Apr 2023 10:46:37 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.523330.813299 (Exim 4.92) (envelope-from ) id 1pp5KU-000738-Vr; Wed, 19 Apr 2023 10:46:26 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 523330.813299; Wed, 19 Apr 2023 10:46:26 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp5KU-000731-Re; Wed, 19 Apr 2023 10:46:26 +0000 Received: by outflank-mailman (input) for mailman id 523330; Wed, 19 Apr 2023 10:46:25 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp5KS-0006CV-VX for xen-devel@lists.xenproject.org; Wed, 19 Apr 2023 10:46:24 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-vi1eur04on061e.outbound.protection.outlook.com [2a01:111:f400:fe0e::61e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 6dd92642-de9f-11ed-b21f-6b7b168915f2; Wed, 19 Apr 2023 12:46:24 +0200 (CEST) Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AM7PR04MB7013.eurprd04.prod.outlook.com (2603:10a6:20b:116::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6298.45; Wed, 19 Apr 2023 10:46:23 +0000 Received: from VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae]) by VE1PR04MB6560.eurprd04.prod.outlook.com ([fe80::52b2:f58:e19:56ae%2]) with mapi id 15.20.6298.045; Wed, 19 Apr 2023 10:46:23 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 6dd92642-de9f-11ed-b21f-6b7b168915f2 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iZHNvWxjZhlshU9FWzDmjFI4NCjQyVdHO4eLwswL7ROeDq9qxakyyvzc5dvg4d6oxutn+8gplwj/9JkVgrpKmsm0aYCVB38XkAJ2KU0jBxIe1l3PM39iIqDmuj8rq6kIH/10lGYVChY734k5dMacRP2XsH17rABEBIsdZpVBJf22ToMYpRDkGzVWSFMVQBie5tT69r+Fhuoou101TmrWYO+oEk5iYjBhhhZAX9Nd1GsugV1L5ab2VgbMzOMxTFskWzD56ko7sbGsqjIm6jEpJiAcuuTLc2KieN62BgBuRxZqDC14wT+e6/wBTYeu/2Iz2nYfs80RTVrGoMyoPch8nA== 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=tq9WHKGqRr1z/PValrjLOh415pqYopf5CMM1Py5K+Iw=; b=NwHfGoCRIHh3pURNKg2sXz5jlvVPWcKrwTuM2vrKsKU6P6JTaeKslJGmfYnDdhkEr3I2UqNnlx9fpED7quBExRlAA3bnG8zLXaT248TerrSxEUH1VUCq2OHzc7LShM7ljq66mDpZ3xhkoyVA1nWHgUmS0qW7fl2Nr0FcsAjH6mcc54/VnWbleS6yxw1k2XHuo42Lb6NY2qyUsqJky2vnXjJML3MywCsDY8liqx3/HO2Ws91vnbpNSypHkPr4wSRbC4FyXKRngUokgCyg4itznc7t/niZc2k1tynstiGNqbXWmoBiR9LZFa0B0h8M5vMqGfMEKlqZO1DdrERq6x6WGA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=tq9WHKGqRr1z/PValrjLOh415pqYopf5CMM1Py5K+Iw=; b=igKjTYW6eq1St33CBa9YYBklQHM8GsLA7uraQFVMRKOWpFyaXtAgNGioi7L4YGo4N/4t2yv1wRYbnbnS5HZrzo5CUxWZxKFHp44I8Qo4vsicnepMSmev3YvnjsefRCJJo6CY356pLzyx2Xg3v6ble/jsfDzuVtunvi4xU/ASSE3lEEkeDrcELw3eStCxfP1pv5jYiJjv4QSWDhDsTWmB59+epSoUCerIC9pL3zNaWl8NpJ8B+RaylbabxwEuLNayYLTKfzd4PYk6K4f0I7L3fokJt7cLzeudlyrclcUtk8cY9a6xQfBShHOSz22f5W+/ObG2JvkRc9gZazQI2NXKng== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: Date: Wed, 19 Apr 2023 12:46:21 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Subject: [PATCH 4/5] VT-d: restrict iommu_flush_all() to cache writeback Content-Language: en-US From: Jan Beulich To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= , Kevin Tian References: <4b42e920-f007-186c-d838-a0294bfa86b5@suse.com> In-Reply-To: <4b42e920-f007-186c-d838-a0294bfa86b5@suse.com> X-ClientProxiedBy: FR0P281CA0263.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b5::6) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AM7PR04MB7013:EE_ X-MS-Office365-Filtering-Correlation-Id: 22352383-79f2-464a-ab91-08db40c35158 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Qh1WnuqT5me8oDW6t0ajcZaYYk9SsQUn1+Cm8vAzfayfAXimO4Rs6csHRjNnkE9i0rXDf0MJrPV7+Ew0hvaRYOadp0MwKL/4YU8hfoEZMxII16F1Mo5zsOYfMqN2FWwJoi/0cVpshgYE6Anp1oxsw4TMY+owUdz2jWd3T4MyQ2LghDjX9QdD/nGLeeM2P4E8L3DJoqlxAgUGZgAbUmRMyawN98Es6MZtYDfGyNlAB8It+Jdo60qiUb7tvL/keivTYQshsa4D1H9B222urZLQkyIY2JsTNWAAyB08OnGZNkVHDylUSfzhF0WPFfuGyjkFMlGm02G/ekg04rOU9zDOyBlOGaDh1M3Vd1bl8Urrw+h90z+YljPKpZDloYOxwap8si9gKrNoXnqJtIGtKhygKqA1pOu9zeAiDJx/rhiizFpmsa9wsA+U+z1juSe/W4ADkGCYj9OrwmSckm47zS4DUAf7p+fS4hEpv67ek3I7h+gLoJLjRttnmIKarHCK6+/paRu0N9id4suI8TBO39CphPiwa/l+QY71GehRcvgEINoq8Oh2FdhAq4k1SJBMn2yCqz+odW99piBesiESGFYTE/X9yQGqI78qa+xlHTmke8EmJSJmueXOAmdPtIqBFA/wgGEq++Ap65GUKS4pBQfAAg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VE1PR04MB6560.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(136003)(39850400004)(396003)(346002)(376002)(366004)(451199021)(5660300002)(86362001)(2616005)(83380400001)(31696002)(6512007)(186003)(6506007)(26005)(38100700002)(8676002)(8936002)(54906003)(478600001)(6486002)(316002)(41300700001)(36756003)(4326008)(6916009)(66946007)(66556008)(31686004)(66476007)(2906002)(4744005)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?k/trYYeMaX2Q1ecvRwpExHeBD3Mg?= =?utf-8?q?XlVzWcWgb4iWBHjrJc5ST+UE0s4y5Y5ofawedYYy+IV6XUZ5lJJZlFg6/FI6ReurF?= =?utf-8?q?ApSexuaEO8Bug6PVZB5A/KFIA5tLRYz/E9I1x7LQo47LuXpasvqIWzycA2/nHROaH?= =?utf-8?q?5Pe6taIWTRdunC/z80nUOkiweX7Dz7QBM4mPxynTDfiPzCyNsEyWdqQ1BbykPjpxY?= =?utf-8?q?vlXkSNLyQISTcn9sq+YN63BgQ81al6eksRSaqEge8N04ILYPefnUp2hajrDLBJHnE?= =?utf-8?q?NHUoka4r6UcUzWDA0p4Z5Nt2llnoCbOMk3WRuSJUIh4WgJcrlqUjO5FqQlKha5AAB?= =?utf-8?q?iFdWyWcC8g6K88aB7ThcVMys8qMycJXjUX4V0j7hO1vCnjbLsGxejNLwDouoEkQNS?= =?utf-8?q?AdsG5tn+Z2beIZz5DXhISEuN/BWKhKbULhG1ZZszlrjOWxnlyvU3MLl8jWPfA+mtg?= =?utf-8?q?NWSGIMlVoKot2v/Xa8fmKEzYiWP1WqwdTkrrYzXlGM66ozG4hK+hf0Uvga4IoVefA?= =?utf-8?q?heNiWTV2/76O2YaLrEO/vhw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EqzcNgSklrZHlu?= =?utf-8?q?kdKhc+slosRu9IDOowkAy7zt0IwFRxIc859E2llMbOLrqL2h2MwRMDvc4/qKTLEhL?= =?utf-8?q?/dJUADLFFWfW?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22352383-79f2-464a-ab91-08db40c35158 X-MS-Exchange-CrossTenant-AuthSource: VE1PR04MB6560.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Apr 2023 10:46:23.1947 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f7a17af6-1c5c-4a36-aa8b-f5be247aa4ba X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: PhMQsbeKyzqu18/ZP+15HtTiIOfYZr0nFxJLaPK+J74gfTKfyjfEcTswglgDw2pyt3S+2hH68bHw99RMgfQzFw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7013 We don't need to invalidate caches here; all we're after is that earlier writes have made it to main memory (and aiui even that just in case). Signed-off-by: Jan Beulich --- This, aiui, being an analogue to uses of iommu_sync_cache() (just not range restricted), I wonder whether it shouldn't be conditional upon iommu_non_coherent. Then again I'm vaguely under the impression that we had been here before, possibly even as far as questioning the need for this call altogether. --- a/xen/drivers/passthrough/vtd/iommu.c +++ b/xen/drivers/passthrough/vtd/iommu.c @@ -693,7 +693,7 @@ static int __must_check iommu_flush_all( bool_t flush_dev_iotlb; int rc = 0; - flush_local(FLUSH_CACHE); + flush_local(FLUSH_WRITEBACK); for_each_drhd_unit ( drhd ) {