[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <szkkdk35keb6ibdy2d2p2q6qiykeo2aoj2iqpzx3h6k2wzs2ob@iuidkwpeoxua>
Date: Fri, 10 Jan 2025 10:23:17 +0200
From: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
To: Kevin Loughlin <kevinloughlin@...gle.com>
Cc: linux-kernel@...r.kernel.org, tglx@...utronix.de, mingo@...hat.com,
bp@...en8.de, dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
seanjc@...gle.com, pbonzini@...hat.com, kai.huang@...el.com, ubizjak@...il.com,
dave.jiang@...el.com, jgross@...e.com, kvm@...r.kernel.org, thomas.lendacky@....com,
pgonda@...gle.com, sidtelang@...gle.com, mizhang@...gle.com, rientjes@...gle.com,
szy0127@...u.edu.cn
Subject: Re: [PATCH v2 2/2] KVM: SEV: Prefer WBNOINVD over WBINVD for cache
maintenance efficiency
On Thu, Jan 09, 2025 at 10:55:33PM +0000, Kevin Loughlin wrote:
> @@ -710,6 +711,14 @@ static void sev_clflush_pages(struct page *pages[], unsigned long npages)
> }
> }
>
> +static void sev_wb_on_all_cpus(void)
> +{
> + if (boot_cpu_has(X86_FEATURE_WBNOINVD))
> + wbnoinvd_on_all_cpus();
> + else
> + wbinvd_on_all_cpus();
I think the X86_FEATURE_WBNOINVD check should be inside wbnoinvd().
wbnoinvd() should fallback to WBINVD if the instruction is not supported
rather than trigger #UD.
--
Kiryl Shutsemau / Kirill A. Shutemov
Powered by blists - more mailing lists