[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 4/4] tools/tests/x86_emulator: disable xmm* tests on clang


  • To: Edwin Torok <edwin.torok@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Tue, 24 Feb 2026 10:48:33 +0100
  • Autocrypt: addr=jbeulich@xxxxxxxx; keydata= xsDiBFk3nEQRBADAEaSw6zC/EJkiwGPXbWtPxl2xCdSoeepS07jW8UgcHNurfHvUzogEq5xk hu507c3BarVjyWCJOylMNR98Yd8VqD9UfmX0Hb8/BrA+Hl6/DB/eqGptrf4BSRwcZQM32aZK 7Pj2XbGWIUrZrd70x1eAP9QE3P79Y2oLrsCgbZJfEwCgvz9JjGmQqQkRiTVzlZVCJYcyGGsD /0tbFCzD2h20ahe8rC1gbb3K3qk+LpBtvjBu1RY9drYk0NymiGbJWZgab6t1jM7sk2vuf0Py O9Hf9XBmK0uE9IgMaiCpc32XV9oASz6UJebwkX+zF2jG5I1BfnO9g7KlotcA/v5ClMjgo6Gl MDY4HxoSRu3i1cqqSDtVlt+AOVBJBACrZcnHAUSuCXBPy0jOlBhxPqRWv6ND4c9PH1xjQ3NP nxJuMBS8rnNg22uyfAgmBKNLpLgAGVRMZGaGoJObGf72s6TeIqKJo/LtggAS9qAUiuKVnygo 3wjfkS9A3DRO+SpU7JqWdsveeIQyeyEJ/8PTowmSQLakF+3fote9ybzd880fSmFuIEJldWxp Y2ggPGpiZXVsaWNoQHN1c2UuY29tPsJgBBMRAgAgBQJZN5xEAhsDBgsJCAcDAgQVAggDBBYC AwECHgECF4AACgkQoDSui/t3IH4J+wCfQ5jHdEjCRHj23O/5ttg9r9OIruwAn3103WUITZee e7Sbg12UgcQ5lv7SzsFNBFk3nEQQCACCuTjCjFOUdi5Nm244F+78kLghRcin/awv+IrTcIWF hUpSs1Y91iQQ7KItirz5uwCPlwejSJDQJLIS+QtJHaXDXeV6NI0Uef1hP20+y8qydDiVkv6l IreXjTb7DvksRgJNvCkWtYnlS3mYvQ9NzS9PhyALWbXnH6sIJd2O9lKS1Mrfq+y0IXCP10eS FFGg+Av3IQeFatkJAyju0PPthyTqxSI4lZYuJVPknzgaeuJv/2NccrPvmeDg6Coe7ZIeQ8Yj t0ARxu2xytAkkLCel1Lz1WLmwLstV30g80nkgZf/wr+/BXJW/oIvRlonUkxv+IbBM3dX2OV8 AmRv1ySWPTP7AAMFB/9PQK/VtlNUJvg8GXj9ootzrteGfVZVVT4XBJkfwBcpC/XcPzldjv+3 HYudvpdNK3lLujXeA5fLOH+Z/G9WBc5pFVSMocI71I8bT8lIAzreg0WvkWg5V2WZsUMlnDL9 mpwIGFhlbM3gfDMs7MPMu8YQRFVdUvtSpaAs8OFfGQ0ia3LGZcjA6Ik2+xcqscEJzNH+qh8V m5jjp28yZgaqTaRbg3M/+MTbMpicpZuqF4rnB0AQD12/3BNWDR6bmh+EkYSMcEIpQmBM51qM EKYTQGybRCjpnKHGOxG0rfFY1085mBDZCH5Kx0cl0HVJuQKC+dV2ZY5AqjcKwAxpE75MLFkr wkkEGBECAAkFAlk3nEQCGwwACgkQoDSui/t3IH7nnwCfcJWUDUFKdCsBH/E5d+0ZnMQi+G0A nAuWpQkjM1ASeQwSHEeAWPgskBQL
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Roger Pau Monne <roger.pau@xxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 24 Feb 2026 09:48:44 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 24.02.2026 10:34, Edwin Torok wrote:
>> On 23 Feb 2026, at 16:10, Jan Beulich <jbeulich@xxxxxxxx> wrote:
>> On 23.02.2026 11:04, Edwin Török wrote:
>>> clang-21 doesn't support `-ffixed-xmm0`, so `%xmm0` won't have the
>>> expected value.
>>> Disable these tests on clang.
>>
>> I don't think that's what we want, and not only because of the clutter the
>> various #ifdef cause. We want to be able to run as many of the tests as
>> possible, so the first goal should be to find some alternative mechanism to
>> achieve the same effect. A global register variable comes to mind as a
>> possible option.
>>
>> Further, how did you arrive at which tests need suppressing?
> 
> I used gdb to look at the 2 memory areas, and noticed that the XMM region was 
> different between emulated and actual when built with clang.
> Then I noticed the build failures due to the lack of fixed-xmm0.
> Then I added the ifdefs one by one as I ran the test until the whole test 
> program passed without failure.
> I tried adding some ‘pxor xmm0, xmm0’ into the cpu_has_sse2 sections, but 
> that didn’t really work either.
> 
> Although I may have been misled by the overlapping region, see below.
> 
>> I don't think
>> we rely on an "expected value" anywhere. I don't even recall us passing
>> -ffixed-xmm0 when compiling test_x86_emulate.c.
> 
> Yes, I’m surprised it works with GCC. But maybe only because the emulator 
> overwrites the actual FXSAVE area corresponding to XMM.
> XMM0 begins at offset 160, and 0x100 - 0x80 = 128.
> AFAICT the actual execution stores its result at [0x80, 0x80+0x200), and the 
> emulator stores its result into [0x100, 0x100+0x200).
> So the emulator will overwrite some of the values from the actual run. 
> 
> This only works if the end of the FXSAVE area looks like its beginning (i.e. 
> if FCW/FSW/etc. happens to match MM6/etc.)

Are you possibly overlooking the fact that res[] is an array of unsigned int 
elements,
i.e. the offsets used in source code all need to be multiplied by 4 to give 
offsets in
memory?

Jan



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.