From patchwork Wed Apr 19 10:43:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Beulich X-Patchwork-Id: 13216627 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 7874EC6FD18 for ; Wed, 19 Apr 2023 10:43:45 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.523313.813248 (Exim 4.92) (envelope-from ) id 1pp5Hj-0004CV-9Y; Wed, 19 Apr 2023 10:43:35 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 523313.813248; Wed, 19 Apr 2023 10:43:35 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp5Hj-0004CO-70; Wed, 19 Apr 2023 10:43:35 +0000 Received: by outflank-mailman (input) for mailman id 523313; Wed, 19 Apr 2023 10:43:34 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1pp5Hi-0003M4-62 for xen-devel@lists.xenproject.org; Wed, 19 Apr 2023 10:43:34 +0000 Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on20614.outbound.protection.outlook.com [2a01:111:f400:7e1b::614]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id 077a0a5c-de9f-11ed-8611-37d641c3527e; Wed, 19 Apr 2023 12:43:32 +0200 (CEST) Received: from VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) by AS8PR04MB7671.eurprd04.prod.outlook.com (2603:10a6:20b:299::6) 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:43:30 +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:43:30 +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: 077a0a5c-de9f-11ed-8611-37d641c3527e ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=nWZusUWWS4XnvYn3sYaFSAyrB+noZ9zD46RCHxst2erhSvm6/hC1vRBx4Z/7w6TR+OitJit7Nc8C+289fZ6aZAWg36NqqyA6ysDNBKMV3MmtoGE4rckUPa7pXUYT0reudupigBsGkVXVPylaK7vN+3zqbWpbLJ5/jbppOa4H2XWj2rCtPKQ2oDBVUNb9bnbj/TEfM/qu8LcXAWLuHhwvHX2spoVcerE/9tmtbJK+tcFTGGcOWkN9vjLZgJILZBWxD7HSSi1XivKrnXZqlBoZYEAxUfm4GJ4e6aXOLWtTiZ7PmbSq260+ZphxC7gr2eKX+erzgB34wWiKxTOXLWvP7g== 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=1WLiDF52gwlGsA56jTGQEg+iCy+r7F/0Tm2Kl2/K1xA=; b=IgNZaSQkmnY7xhBhJQPJxsy6rO1B9sx999f5NrHyOWIaYzWEdOgstJc1roINwTtvshnCC1jZN0VhbEqnzjJXTg/F6402olEJ4C9wNLbdMzF/raX/2dQNmQm85qV+EVIlWWyc/UOkDYl/YVBd6lWQiVNT2i9iNtgbZoACCB1fSlg9XwnGsO7sKW0/+UOvmNRuiYTPOO4NtZJyt9FPliDL8TMPM6zgEkimGRkoox7oTYSA5a/+HNbO6YsgUWgSgH5UpEx5aXNNv/ZkzEwOUaacYlvmKKqC5VvKMq/nScZKzx8LkNVriFdVjBlzmFUgkLZWMGY+kLXq4HKDLKOlKrfbGA== 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=1WLiDF52gwlGsA56jTGQEg+iCy+r7F/0Tm2Kl2/K1xA=; b=t0HsMPW6fVjuf7p2ADgLhNu5QlgJLQnxfOChS6WCr6zzohDWLobOlRz0CpruFyu7EDNXL2f05/OR1XF0mqqbi1XLNx8EOhNuRAyRAlwU7mEtxoeRBajpCXZ1TtLfQ165L7xPSW3KoYreTD1mG0xcgpN7ZJ++y2PzV0Jkx+knMBeBBllT1R9Tgat5DDAv12De17SD85dq27TxhxZOIkL1gj8+UboTkZpim/DEod1ADTR8zmGvOIdO7CuIWlkOg/8CWpZ6a05WFz991Wsjg5fIFI6VhpAlUaDDxIt6CACW0V2rkpqsmAqU6N6cpTKuQaoL54m23/VxVfpWNqM3in08+Q== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com; Message-ID: <4b42e920-f007-186c-d838-a0294bfa86b5@suse.com> Date: Wed, 19 Apr 2023 12:43:28 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.9.1 Content-Language: en-US To: "xen-devel@lists.xenproject.org" Cc: Andrew Cooper , Wei Liu , =?utf-8?q?Roger_Pau_Monn=C3=A9?= From: Jan Beulich Subject: [PATCH 0/5] x86: reduce cache flushing overhead X-ClientProxiedBy: FR3P281CA0161.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:a2::20) To VE1PR04MB6560.eurprd04.prod.outlook.com (2603:10a6:803:122::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VE1PR04MB6560:EE_|AS8PR04MB7671:EE_ X-MS-Office365-Filtering-Correlation-Id: 00dcff7c-defb-4db7-7c5b-08db40c2ea35 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: WFyGo7IyS7NTh2vE7ainYgSzvDmcOgt6C6z4GpZ78Yx0DAXCCAE0tlPXCxqYoan9d5bto5ceINwyQXnXPplqibVsRW0GanumBSNDEkaKmcCIpuGl8rDNcHQB+OlNaTg5HXnpK3e1kXd+vKTs5IkW5lza85i+71zzmx7LUds9fP/81LmAPUPhys6JH0/UDaC07eMcH2vUicI4j/rR6sdXWccqFGclHy5F1oCQamPVpSHzjdQyLiJDJazr5Nlyn9qgT1qUUs8aZs8LMYix3HNET7J4J+tVp1HnUBqtH0voOf9h/P/ovyIMXgRWkllskJqhfU6O7tTS/3AxRRoYfs3F3GMnV/f3OS0ISqTxgiHdPP/5rHTP4U25kiGLZqHg6pPkE/VPaH8QQXcTc/xgp8ex6bhJ53xJFgcpiFhblIkLhk0lrR2MFBlKFPOZn2lBeVczi8xQe07mqsQwje4h/YH08HGl/ftfo9GN/Ac+10StXG+sC8Mm0zCW0F8CYeXBUIypCPn9o5PU+Y6RFc1JC18xvM8EuLrzxVbPld7jXLXkxlEO3HQBTHrPI58CjXldaI5C3ZZP6iMiDGkyy7wgHixMUYdKTVBXwzwrfghRQzr6/lN8mxThCLma14pb/mqIYUYo12RiQ0TNMsmrFtGo4CO7jQ== 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)(396003)(346002)(39860400002)(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?kfy05fble/O+yuz9wE3MOsUE6M4E?= =?utf-8?q?nrVDGA4+OXAQOOxKMKwDsJKSX0vOXohW8QItVxVrzjHicJpvdM7ZQ+ude0NN35H9f?= =?utf-8?q?99SWOv6zfJUozeUnkWaJN1N9lewDLBqcpfqS/48CT9UQIf3yvXLPlhdKAINu23bs6?= =?utf-8?q?bwubN4NYiTwod/X0+TfPMLGSBUnSc6i4+gvUfc+o1QhzPmuPE47uypJ8AmRszK4if?= =?utf-8?q?zZQXzrsc7p4igV5pwL6TsGXPqDk5/ACnlkY1YtOELyIpzTqLwDTFBtzV4Jnl5HYxX?= =?utf-8?q?vDuROdPgbANoJfwZj/Ehn4L1k3Wg/ibK19rnpMCVpaY4McdgUQ5AV9AhGVNvDKHR4?= =?utf-8?q?Hk5i8KmUqBia3Lw4iiJfpkHKZxSPrI2p3Q6PmnDJ2JdUs8ao8Jo971gau10p6VZlt?= =?utf-8?q?pVidM7+ig4LVrG/hFwdXyoMjDegjFPYpVnmwti3sgPBwp1xV5CAVhrigpz/7khbT2?= =?utf-8?q?S6wLCblwGdM88uU/uz6xQEpuZJ/M1B5i8QGLyhhompSeW4/gG6LTzP8Vj8XEsUjbW?= =?utf-8?q?45ad5m2e4w4xCldxR+5NLVcHzoe8OqKlLB7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jybqBY8gNp48Nu0YmdQpknb?= =?utf-8?q?g3OLSMnrcvHacbZJYTFsNOyn6p+yPmbsTCF6vTH2ZkDKHsBSLa7JGW1nrg0LKPiX1?= =?utf-8?q?+JV8vQWs+z2Z?= X-OriginatorOrg: suse.com X-MS-Exchange-CrossTenant-Network-Message-Id: 00dcff7c-defb-4db7-7c5b-08db40c2ea35 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:43:30.2466 (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: YDbfOIhRX8IbIUUWytVwqrW39cqScV8DTIl5Uacri0uSMy0gCvPAqwX+CkmZtbNEdEbqMwmiWUFLU5Cttkptmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR04MB7671 ..., first and foremost by using cache write-back operations instead of flushing ones when available (and sufficient for the purpose). In the context of making the last patch I started wondering whether for PV we don't flush (write back) too little for MMUEXT_FLUSH_CACHE: Just like for HVM, pCPU-s a vCPU has run on before could still hold data in their caches. (We clearly still flush / write back too much in MMUEXT_FLUSH_CACHE_GLOBAL even with this series in place.) We also can't call this the guest's responsibility, as it may not have any means to have one of its vCPU-s run on the intended pCPU. 1: x86: support cache-writeback in flush_area_local() et al 2: x86/HVM: restrict guest-induced WBINVD to cache writeback 3: x86/PV: restrict guest-induced WBINVD (or alike) to cache writeback 4: VT-d: restrict iommu_flush_all() to cache writeback 5: x86/HVM: limit cache writeback overhead Jan