Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1639933pxp; Thu, 17 Mar 2022 13:21:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzF2WRIN7PBehz8iI6eMoPB0HIuLz+LkvRbIBQzAKBuUGalRgqZH+ocM5PlO0CUlakz8cF+ X-Received: by 2002:a17:90b:4ad2:b0:1bf:d47:8077 with SMTP id mh18-20020a17090b4ad200b001bf0d478077mr17763552pjb.85.1647548481222; Thu, 17 Mar 2022 13:21:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647548481; cv=none; d=google.com; s=arc-20160816; b=0sQNLIBuo0FJvpYHSn/28iRcI0i1PUm1rmxFB6cqpQL8xIi+iESNH2rKa2mkMENTed SUZvwKKJKlDG1Grs+IL16fwKTJCDLncfbZQaV+Lq7Q2YXUuPreRBVw0cqKxTZY+d4qpZ e8JFDvdTP8UzZdPIr42Pf4hJfA0yNJouWD+ytkt2qHg7LEnpy5qzdUVVwokQ9Gkc3jOk yZjTZxhQTfOf2/zMr6bNEdXnys1INTsev5tqpJb/N9mRoWkN7GutxYyWHM+1laburlPu NcwwIpLaGSmnf70f0lSy7nudcmoqwx4JdbbThYMlU/Fd7y90uQgcN7ri1PLqJsbGT8j+ OxRA== 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=hnPiewiTmn5iKj7tv6YyXKcFYclFsk36ptIecBJ8qYw=; b=Xo1CVlDyG+NNh32SM6AAvbqXnNXR2GISl0tDLVSLVRNbEdnRYyTxjZAUYS2AOnhSEu 57fkSK5yUoCoiI+IwsFlu52QxUr0KWdA4x085wKJ52FJp/d8BVMGBMP8M9/m+TEzDJ3x +D8J/XveMMcYwaHqksoxqKLo7PRGRXqvYupaPXBIejW9Vx1aUbgO+tIczJxqrt8RnqKf EqXfEHjsy0lj8GaCpX4+QoQVom95SkmO9z51HUhr12QjdPLY6/nNy9ikBjZ23R/prDMN syVqzJPiWkLlzBRBwhwf1gPfMDmIKH4beS+arsjh/fHFHlEFegyhtH/Wbf3O6JGjdnzY kgZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b="s/z6/SWE"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id cm18-20020a056a00339200b004f785e0f808si6210530pfb.104.2022.03.17.13.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Mar 2022 13:21:21 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20210112.gappssmtp.com header.s=20210112 header.b="s/z6/SWE"; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7709E2AA1AD; Thu, 17 Mar 2022 13:02:20 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235810AbiCQPeH (ORCPT + 99 others); Thu, 17 Mar 2022 11:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234996AbiCQPeG (ORCPT ); Thu, 17 Mar 2022 11:34:06 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3894C208C2D for ; Thu, 17 Mar 2022 08:32:50 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id n15so4763158plh.2 for ; Thu, 17 Mar 2022 08:32:50 -0700 (PDT) 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=hnPiewiTmn5iKj7tv6YyXKcFYclFsk36ptIecBJ8qYw=; b=s/z6/SWEMrGSkgPqxHXiGu4Z5wuN0408LIBkkxWyr/DtH9662uvtRvJ+NeWlGvaUCw 2Q1NzrDo3uEu3fUgvbSWVxghMV3dALlHH/0ZvvXrthrmkLFAoJokILmuoaHTFRbAZeta mj6WETnZnUYPlH10aqh0c7fRRboLZCJMglgtMgYH4YAmK1NTRS5QbdG1spBF69gfodtl w3YyT6MssVTsBV+0Ip48QjWAOvzn/25nVJ5yifmWjfFwvz/wMjGhUxxVvzGYWs84ar2Q eOBHrYNZ1qTv5HI5OqPwsgeeNqRKtQLEKhrK1uhOzzEMNW3QTUEkqJY029P41mRcuTUn Rr0A== 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=hnPiewiTmn5iKj7tv6YyXKcFYclFsk36ptIecBJ8qYw=; b=XfNrePSbhOLGBACLZxhAcfMMeaPdRC4lHTugnKcroHkGH0ewNapM5MA3v2YqNkEPJ5 JL10EH7GcCGB7CykBtgJ14FT/K1RPVpZtyz+HiGycR4Ag/WdjR8D4Gcz+pE3JhOoolzx I1qtoHMUK0aScjJnJwOCMapGBEKTZopxpFQRXYueyJv/PbFBdOo4OXHwXs9+awGTUK4I 97gVfitkEXmEG2iMsnA12VFuFUGLujaKbA7smYzCyf0sfFmNDIpVF0kePu+hZOhQQu59 EnSHMecQLisyk93Uf5TGW2CxOHcqIv6uf6KjeMtbV43zq7PgTC2KdylefRpSu97Sg6O8 xFzg== X-Gm-Message-State: AOAM532LVe2xG5ODPdPUgZcAOdRlCM/XsknU+VTniX4BEnMOq35ZhZoC 8cs8veLbnnQfj/eIlvM1GezWu+G1p99XaBmolP5IEA== X-Received: by 2002:a17:902:d504:b0:154:172:3677 with SMTP id b4-20020a170902d50400b0015401723677mr1307643plg.147.1647531169689; Thu, 17 Mar 2022 08:32:49 -0700 (PDT) MIME-Version: 1.0 References: <20220316020856.24435-1-kirill.shutemov@linux.intel.com> <20220316020856.24435-30-kirill.shutemov@linux.intel.com> In-Reply-To: From: Dan Williams Date: Thu, 17 Mar 2022 08:32:39 -0700 Message-ID: Subject: Re: [PATCHv6 29/30] ACPICA: Avoid cache flush inside virtual machines To: Dave Hansen Cc: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , 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,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,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 Wed, Mar 16, 2022 at 3:13 PM Dave Hansen wrote: > > On 3/15/22 19:08, Kirill A. Shutemov wrote: > > 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. > > > > Before entering sleep states, the ACPI code flushes caches to prevent > > data loss using the WBINVD instruction. This mechanism is required on > > bare metal. > > > > But, any use WBINVD inside of a guest is worthless. Changing sleep > > state in a virtual machine doesn't affect the host system sleep state > > and cannot lead to data loss, so most hypervisors simply ignore it. > > Despite this, the ACPI code calls WBINVD unconditionally anyway. > > It's useless, but also normally harmless. > > > > In TDX guests, though, WBINVD stops being harmless; it triggers a > > virtualization exception (#VE). If the ACPI cache-flushing WBINVD > > were left in place, TDX guests would need handling to recover from > > the exception. > > > > Avoid using WBINVD whenever running under a hypervisor. This both > > removes the useless WBINVDs and saves TDX from implementing WBINVD > > handling. > > Looks good. Did you have more acks on this earlier that got removed? I > thought I remembered more acks on earlier versions. > > Reviewed-by: Dave Hansen Yeah, my previous reviewed-by still stands: Reviewed-by: Dan Williams