Received: by 2002:ac2:5a04:0:0:0:0:0 with SMTP id q4csp388145lfn; Wed, 2 Mar 2022 09:27:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJydm0xqIrMB0hB/J3B9wqcDf31+yGCs9/hbnJipi+btLHJsqOnJlhEMKweZmc7RmAH1qYhL X-Received: by 2002:a17:90a:d0c4:b0:1bc:b02e:ed75 with SMTP id y4-20020a17090ad0c400b001bcb02eed75mr887294pjw.104.1646242042005; Wed, 02 Mar 2022 09:27:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646242041; cv=none; d=google.com; s=arc-20160816; b=0I9BPJNKGZPnS1fjP2j+V62E6saWI6simNYdDr7iAZ8AOglRzRgIczO5WrhMBrow6h bUQsUoEsiLYlUBMgXOqT0Oj+r/0QuOXszpe8gTX4bNWfs1ONYVhL3FHl51MvUrDwRAqE /zbdi8Zn1r3Q/io+J1Ya7gSogSYd20QACgep+7B3PUZBb7tML5d14FvalyyJf1YnJ5La +Gtso0g559pbAJ3vbSOu+rzgtaDgmQo1ll/wsOz6/83gCLqTt2xNWC4WSfjyGo/hc1B1 m33P7uMJRP36CQ1udBxyFhoYOpI1XCOHCW3m0rwyAZ+HbLsVr+CERJhERHNdI4hNmPWj 0xQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=n1sj86b59iu9bNEKeM9TJNWPtdaS8+JumVKQjHmv3eA=; b=xfr6jqkagSdvGptIJ/sgCllyv+85AP5vPVisd9gk0cbdD5XbXZmhxctgs6+MAPFYYt nddFUbXcBOjZlq2VO8/oP0VqSKgk6Jf3258zDaUlXGNerewpuVgdkyWkCxI1LC+yAhNL j/cNc2+nfmK+ANhKp8f68pW8Dt5XipTQNNh/DrFL88VbdV7VTNUVrEuqnbN1OaIZrHeh NkWB9cSXY5sSO0YuAI8BiETPQcEUPC+2egYtJYkBiizcQbS527oTYUawikXF49GQy7bS kJmFrC3cBcIN6mHbvEM+JYHyO3/I1M2VUFKISyjyDHVRgjAFFvo535yoi+Y6aUrUTexQ MV5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=VWjgRI5l; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g6-20020a632006000000b003736cfb3796si15053681pgg.603.2022.03.02.09.27.04; Wed, 02 Mar 2022 09:27:21 -0800 (PST) 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=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b=VWjgRI5l; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240791AbiCBQOG (ORCPT + 99 others); Wed, 2 Mar 2022 11:14:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237727AbiCBQOD (ORCPT ); Wed, 2 Mar 2022 11:14:03 -0500 Received: from mail-pg1-x531.google.com (mail-pg1-x531.google.com [IPv6:2607:f8b0:4864:20::531]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CB47CCC5B for ; Wed, 2 Mar 2022 08:13:17 -0800 (PST) Received: by mail-pg1-x531.google.com with SMTP id 132so2034963pga.5 for ; Wed, 02 Mar 2022 08:13:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20210112.gappssmtp.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=n1sj86b59iu9bNEKeM9TJNWPtdaS8+JumVKQjHmv3eA=; b=VWjgRI5lBrSTdoy6GdW6JXhgIDzq9FlKFxNwvF7m95RNXP439RhBdJYvjWJ6DD292P xFMuGvkHVhQVE/f8bIsjpcKkakU0m/tknZtH+BUst+W7Vmfjc4pp1dMq29RE9cCHi9tJ JMzWzErO2G3z3FgM3+D/GSfYWUt8iUzNuekmpnSNjrW9CFpWHyoMdIwkK7buxbF3Egph 5demaYzOQx59dNv4FeF32mmi2xvC6Lhi8EZSodLGgLUDvnIPKpwDK7j9rvTZTkdsQVa+ 1imTP83PkikIDrwncEunCvypcav5RgtIAZTuP3L8qEyNYL3oYL9FJWCQyN74IC+hZjyB yXSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n1sj86b59iu9bNEKeM9TJNWPtdaS8+JumVKQjHmv3eA=; b=BNTluZdbFThdCiqBVgnBHuf3HLTN9Oj1rlmCx/MUFwXWP1xg9Zh/4vqOR/SAD9bSC8 WRXmdUH+px1+RLyOma55JI78c/BkMfE7BJU8P4rk0A2ulMrKPn1ip+GodblHbyt9OiLs TzuEyJ1djmlWrepQjUcH5GESA6vTsxwtO2FE5Y1nw++K9aDyuNvx3HrkwkBF2y2suFaV WQ2jU2CvFmf0kAxrO4UhsqX6zcd8Wdu68uo7ZLWSjfBVqQWtM5quQnk/CBSnBqb+CWOo JchSGco2RpyggMDPl5zPQxqtzepqcKLf2uCutT3Zl9i05j61GwaXdU+EAuK2u9zjgme3 tBnw== X-Gm-Message-State: AOAM531QEmA+CmcNc3He16II+1B+xj6Le/bWQ17kx+2Yu4dLRxvPHEEO sqPPq/EyizXPGAagzHb6hMHq1jC/ekBA6ml5Fa0bvA== X-Received: by 2002:a05:6a00:b52:b0:4f0:ff67:413 with SMTP id p18-20020a056a000b5200b004f0ff670413mr33650623pfo.61.1646237596578; Wed, 02 Mar 2022 08:13:16 -0800 (PST) MIME-Version: 1.0 References: <20220302142806.51844-1-kirill.shutemov@linux.intel.com> <20220302142806.51844-30-kirill.shutemov@linux.intel.com> In-Reply-To: <20220302142806.51844-30-kirill.shutemov@linux.intel.com> From: Dan Williams Date: Wed, 2 Mar 2022 08:13:05 -0800 Message-ID: Subject: Re: [PATCHv5 29/30] ACPICA: Avoid cache flush inside virtual machines To: "Kirill A. Shutemov" Cc: Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Kuppuswamy Sathyanarayanan , Andrea Arcangeli , Andi Kleen , David Hildenbrand , "H. Peter Anvin" , Juergen Gross , Jim Mattson , Joerg Roedel , Josh Poimboeuf , Kuppuswamy Sathyanarayanan , Paolo Bonzini , sdeep@vmware.com, Sean Christopherson , "Luck, Tony" , Vitaly Kuznetsov , Wanpeng Li , Tom Lendacky , Brijesh Singh , X86 ML , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham 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 Wed, Mar 2, 2022 at 6:28 AM Kirill A. Shutemov wrote: > > WBINVD is not supported in TDX guest and triggers #VE. There's no robust > way to emulate it. The kernel has to avoid it. > > ACPI_FLUSH_CPU_CACHE() flushes caches usign WBINVD on entering sleep > states. It is required to prevent data loss. > > While running inside virtual machine, the kernel can bypass cache > flushing. Changing sleep state in a virtual machine doesn't affect the > host system sleep state and cannot lead to data loss. > > Signed-off-by: Kirill A. Shutemov Reviewed-by: Dan Williams