From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <f.ebner@proxmox.com>
Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by lists.proxmox.com (Postfix) with ESMTPS id 98FA99ED23
 for <pve-devel@lists.proxmox.com>; Wed,  7 Jun 2023 13:48:42 +0200 (CEST)
Received: from firstgate.proxmox.com (localhost [127.0.0.1])
 by firstgate.proxmox.com (Proxmox) with ESMTP id 81F9418E98
 for <pve-devel@lists.proxmox.com>; Wed,  7 Jun 2023 13:48:42 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com
 [94.136.29.106])
 (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
 key-exchange X25519 server-signature RSA-PSS (2048 bits))
 (No client certificate requested)
 by firstgate.proxmox.com (Proxmox) with ESMTPS
 for <pve-devel@lists.proxmox.com>; Wed,  7 Jun 2023 13:48:41 +0200 (CEST)
Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1])
 by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 7FD6241E78;
 Wed,  7 Jun 2023 13:48:41 +0200 (CEST)
Message-ID: <33c99c7a-2bc1-8826-2d27-787f4ad52a89@proxmox.com>
Date: Wed, 7 Jun 2023 13:48:40 +0200
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
 Thunderbird/102.11.0
Content-Language: en-US
To: "DERUMIER, Alexandre" <alexandre.derumier@groupe-cyllene.com>,
 "pve-devel@lists.proxmox.com" <pve-devel@lists.proxmox.com>,
 "aderumier@odiso.com" <aderumier@odiso.com>
References: <20230602100551.2224246-1-aderumier@odiso.com>
 <20230602100551.2224246-2-aderumier@odiso.com>
 <ae82ddba-d4da-9dd1-aad1-9ddb05a6721e@proxmox.com>
 <c73ce1cfea3d4b1507868547d74cec437a22856d.camel@groupe-cyllene.com>
 <6dc9ad49-3f73-3b07-3b00-c8673f5859b4@proxmox.com>
 <c00e1a5a2d9752cddb0ab527fdaae191d293050e.camel@groupe-cyllene.com>
From: Fiona Ebner <f.ebner@proxmox.com>
In-Reply-To: <c00e1a5a2d9752cddb0ab527fdaae191d293050e.camel@groupe-cyllene.com>
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-SPAM-LEVEL: Spam detection results:  0
 AWL -0.001 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DMARC_MISSING             0.1 Missing DMARC policy
 KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment
 NICE_REPLY_A           -0.094 Looks like a legit reply (A)
 SPF_HELO_NONE           0.001 SPF: HELO does not publish an SPF Record
 SPF_PASS               -0.001 SPF: sender matches SPF record
 T_SCC_BODY_TEXT_LINE    -0.01 -
Subject: Re: [pve-devel] [PATCH v4 qemu-server 1/1] cpuconfig: add new
 x86-64-vX models
X-BeenThere: pve-devel@lists.proxmox.com
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: Proxmox VE development discussion <pve-devel.lists.proxmox.com>
List-Unsubscribe: <https://lists.proxmox.com/cgi-bin/mailman/options/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=unsubscribe>
List-Archive: <http://lists.proxmox.com/pipermail/pve-devel/>
List-Post: <mailto:pve-devel@lists.proxmox.com>
List-Help: <mailto:pve-devel-request@lists.proxmox.com?subject=help>
List-Subscribe: <https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel>, 
 <mailto:pve-devel-request@lists.proxmox.com?subject=subscribe>
X-List-Received-Date: Wed, 07 Jun 2023 11:48:42 -0000

Am 07.06.23 um 12:57 schrieb DERUMIER, Alexandre:
>>
>> So again, sounds like the xsave feature is required for the osxsave
>> feature to even make sense.
>>
> The problem is that xsaves is not supported on all intel/amd cpu, 
> 
> older model don't seem to support xsaves too  (intel only since
> sandybridge , amd since epyc v1)
> https://github.com/qemu/qemu/blob/master/target/i386/cpu.c#L3050
> 
> 
> 
> but also newer model depending of firmware revision
> 
> "target/i386: EPYC-Rome model without XSAVES"
> https://github.com/qemu/qemu/commit/fb00aa61267c8b9c57a2d1a1fa1e336d02e3bcd1
> 

AFAIU, xsaves with the additional s is just an optional sub-feature of
xsave:
https://en.wikipedia.org/wiki/CPUID#EAX%3D0Dh%3A_XSAVE_features_and_state-components

Note that QEMU has both, a xsave and an xsaves CPU flag.

If I run the cpuid-dump2.c script in my VM with

-cpu
qemu64,+abm,+aes,+avx,+avx2,+bmi1,+bmi2,enforce,+f16c,+fma,+kvm_pv_eoi,+kvm_pv_unhalt,+movbe,+pni,+popcnt,+sse4.1,+sse4.2,+ssse3,xsave

I get

cpu=bdver4 -mmmx -mno-3dnow -msse -msse2 -msse3 -mssse3 -mno-sse4a
-mcx16 -msahf -mmovbe -maes -mno-sha -mno-pclmul -mpopcnt -mabm -mno-lwp
-mfma -mno-fma4 -mno-xop -mbmi -mbmi2 -mno-tbm -mavx -mavx2 -msse4.2
-msse4.1 -mlzcnt -mno-rtm -mno-hle -mno-rdrnd -mf16c -mno-fsgsbase
-mno-rdseed -mno-prfchw -mno-adx -mfxsr

here -> -mxsave

-mno-xsaveopt -mno-avx512f -mno-avx512er -mno-avx512cd -mno-avx512pf
-mno-prefetchwt1 -mno-clflushopt -mno-xsavec

here -> -mno-xsaves

-mno-avx512dq -mno-avx512bw -mno-avx512vl -mno-avx512ifma
-mno-avx512vbmi -mno-clwb -mno-pcommit

So there is -mxsave, but also -mno-xsaves.

But couldn't find from which models onward xsave is supported from a
quick search.