x86: Add function to see if xsavec is available.

PiperOrigin-RevId: 510459831
This commit is contained in:
Konstantin Bogomolov
2023-02-17 10:10:46 -08:00
committed by gVisor bot
parent 7b8b9527ef
commit 17d9b14478
+7
View File
@@ -403,6 +403,13 @@ func (fs FeatureSet) UseXsaveopt() bool {
return fs.UseXsave() && fs.HasFeature(X86FeatureXSAVEOPT)
}
// UseXsavec returns true if 'fs' supports the "xsavec" instruction.
//
//go:nosplit
func (fs FeatureSet) UseXsavec() bool {
return fs.UseXsaveopt() && fs.HasFeature(X86FeatureXSAVEC)
}
// archCheckHostCompatible checks for compatibility.
func (fs FeatureSet) archCheckHostCompatible(hfs FeatureSet) error {
// The size of a cache line must match, as it is critical to correctly