[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPcyv4gfVfCNZKhc3aUU1+TyaSpxSMeuiqVxK1V2i3O6HVspcg@mail.gmail.com>
Date: Thu, 17 Mar 2022 08:32:39 -0700
From: Dan Williams <dan.j.williams@...el.com>
To: Dave Hansen <dave.hansen@...el.com>
Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Kuppuswamy Sathyanarayanan
<sathyanarayanan.kuppuswamy@...ux.intel.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Andi Kleen <ak@...ux.intel.com>,
David Hildenbrand <david@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>, Juergen Gross <jgross@...e.com>,
Jim Mattson <jmattson@...gle.com>,
Joerg Roedel <joro@...tes.org>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Kuppuswamy Sathyanarayanan <knsathya@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>, sdeep@...are.com,
Sean Christopherson <seanjc@...gle.com>,
"Luck, Tony" <tony.luck@...el.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Wanpeng Li <wanpengli@...cent.com>,
Tom Lendacky <thomas.lendacky@....com>,
Brijesh Singh <brijesh.singh@....com>, X86 ML <x86@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv6 29/30] ACPICA: Avoid cache flush inside virtual machines
On Wed, Mar 16, 2022 at 3:13 PM Dave Hansen <dave.hansen@...el.com> 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 <dave.hansen@...ux.intel.com>
Yeah, my previous reviewed-by still stands:
Reviewed-by: Dan Williams <dan.j.williams@...el.com>
Powered by blists - more mailing lists