[PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback

Richard Henderson posted 50 patches 2 days, 5 hours ago
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Fabiano Rosas <farosas@suse.de>, Laurent Vivier <lvivier@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, Riku Voipio <riku.voipio@iki.fi>, Stefan Hajnoczi <stefanha@redhat.com>, Fam Zheng <fam@euphon.net>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, Warner Losh <imp@bsdimp.com>, Kyle Evans <kevans@freebsd.org>, "Daniel P. Berrangé" <berrange@redhat.com>, Stefano Stabellini <sstabellini@kernel.org>, Anthony PERARD <anthony@xenproject.org>, Paul Durrant <paul@xen.org>, "Edgar E. Iglesias" <edgar.iglesias@gmail.com>, "Michael S. Tsirkin" <mst@redhat.com>, David Hildenbrand <david@kernel.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Peter Xu <peterx@redhat.com>, Li Zhijian <lizhijian@fujitsu.com>, Hyman Huang <yong.huang@smartx.com>, Peter Maydell <peter.maydell@linaro.org>, Helge Deller <deller@gmx.de>, Zhao Liu <zhao1.liu@intel.com>, Eduardo Habkost <eduardo@habkost.net>, Palmer Dabbelt <palmer@dabbelt.com>, Alistair Francis <alistair.francis@wdc.com>, Weiwei Li <liwei1518@gmail.com>, Daniel Henrique Barboza <dbarboza@ventanamicro.com>, Liu Zhiwei <zhiwei_liu@linux.alibaba.com>, Ilya Leoshkevich <iii@linux.ibm.com>, WANG Xuerui <git@xen0n.name>, Stefan Weil <sw@weilnetz.de>
[PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback
Posted by Richard Henderson 2 days, 5 hours ago
Since x86_64 always has SSE2, we can remove the fallback
that was present for i686.

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
---
 host/include/x86_64/host/bufferiszero.c.inc | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/host/include/x86_64/host/bufferiszero.c.inc b/host/include/x86_64/host/bufferiszero.c.inc
index 74ae98580f..7e9d896a8d 100644
--- a/host/include/x86_64/host/bufferiszero.c.inc
+++ b/host/include/x86_64/host/bufferiszero.c.inc
@@ -3,7 +3,6 @@
  * buffer_is_zero acceleration, x86 version.
  */
 
-#if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
 #include <immintrin.h>
 
 /* Helper for preventing the compiler from reassociating
@@ -119,7 +118,3 @@ static unsigned best_accel(void)
 #endif
     return info & CPUINFO_SSE2 ? 1 : 0;
 }
-
-#else
-# include "host/include/generic/host/bufferiszero.c.inc"
-#endif
-- 
2.43.0
Re: [PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback
Posted by Pierrick Bouvier 1 day, 14 hours ago
On 1/7/26 9:29 PM, Richard Henderson wrote:
> Since x86_64 always has SSE2, we can remove the fallback
> that was present for i686.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   host/include/x86_64/host/bufferiszero.c.inc | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/host/include/x86_64/host/bufferiszero.c.inc b/host/include/x86_64/host/bufferiszero.c.inc
> index 74ae98580f..7e9d896a8d 100644
> --- a/host/include/x86_64/host/bufferiszero.c.inc
> +++ b/host/include/x86_64/host/bufferiszero.c.inc
> @@ -3,7 +3,6 @@
>    * buffer_is_zero acceleration, x86 version.
>    */
>   
> -#if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
>   #include <immintrin.h>
>   
>   /* Helper for preventing the compiler from reassociating
> @@ -119,7 +118,3 @@ static unsigned best_accel(void)
>   #endif
>       return info & CPUINFO_SSE2 ? 1 : 0;
>   }
> -
> -#else
> -# include "host/include/generic/host/bufferiszero.c.inc"
> -#endif

The only other user for this file is now
host/include/aarch64/host/bufferiszero.c.inc.

Code could be directly moved there instead, so 
host/include/generic/host/bufferiszero.c.inc can be removed.

It can be done in another commit though.

Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Re: [PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback
Posted by Richard Henderson 1 day, 13 hours ago
On 1/9/26 07:09, Pierrick Bouvier wrote:
> On 1/7/26 9:29 PM, Richard Henderson wrote:
>> Since x86_64 always has SSE2, we can remove the fallback
>> that was present for i686.
>>
>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>> ---
>>   host/include/x86_64/host/bufferiszero.c.inc | 5 -----
>>   1 file changed, 5 deletions(-)
>>
>> diff --git a/host/include/x86_64/host/bufferiszero.c.inc b/host/include/x86_64/host/ 
>> bufferiszero.c.inc
>> index 74ae98580f..7e9d896a8d 100644
>> --- a/host/include/x86_64/host/bufferiszero.c.inc
>> +++ b/host/include/x86_64/host/bufferiszero.c.inc
>> @@ -3,7 +3,6 @@
>>    * buffer_is_zero acceleration, x86 version.
>>    */
>> -#if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
>>   #include <immintrin.h>
>>   /* Helper for preventing the compiler from reassociating
>> @@ -119,7 +118,3 @@ static unsigned best_accel(void)
>>   #endif
>>       return info & CPUINFO_SSE2 ? 1 : 0;
>>   }
>> -
>> -#else
>> -# include "host/include/generic/host/bufferiszero.c.inc"
>> -#endif
> 
> The only other user for this file is now
> host/include/aarch64/host/bufferiszero.c.inc.
> 
> Code could be directly moved there instead, so host/include/generic/host/ 
> bufferiszero.c.inc can be removed.
> 
> It can be done in another commit though.

No.  Everyone who *doesn't* have such a file uses generic.


r~

Re: [PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback
Posted by Pierrick Bouvier 1 day, 13 hours ago
On 1/8/26 1:15 PM, Richard Henderson wrote:
> On 1/9/26 07:09, Pierrick Bouvier wrote:
>> On 1/7/26 9:29 PM, Richard Henderson wrote:
>>> Since x86_64 always has SSE2, we can remove the fallback
>>> that was present for i686.
>>>
>>> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
>>> ---
>>>    host/include/x86_64/host/bufferiszero.c.inc | 5 -----
>>>    1 file changed, 5 deletions(-)
>>>
>>> diff --git a/host/include/x86_64/host/bufferiszero.c.inc b/host/include/x86_64/host/
>>> bufferiszero.c.inc
>>> index 74ae98580f..7e9d896a8d 100644
>>> --- a/host/include/x86_64/host/bufferiszero.c.inc
>>> +++ b/host/include/x86_64/host/bufferiszero.c.inc
>>> @@ -3,7 +3,6 @@
>>>     * buffer_is_zero acceleration, x86 version.
>>>     */
>>> -#if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
>>>    #include <immintrin.h>
>>>    /* Helper for preventing the compiler from reassociating
>>> @@ -119,7 +118,3 @@ static unsigned best_accel(void)
>>>    #endif
>>>        return info & CPUINFO_SSE2 ? 1 : 0;
>>>    }
>>> -
>>> -#else
>>> -# include "host/include/generic/host/bufferiszero.c.inc"
>>> -#endif
>>
>> The only other user for this file is now
>> host/include/aarch64/host/bufferiszero.c.inc.
>>
>> Code could be directly moved there instead, so host/include/generic/host/
>> bufferiszero.c.inc can be removed.
>>
>> It can be done in another commit though.
> 
> No.  Everyone who *doesn't* have such a file uses generic.
> 
> 
> r~

Oops, missed util/bufferiszero.c indeed.

Re: [PATCH 07/50] host/include/x86_64/bufferiszero: Remove no SSE2 fallback
Posted by Thomas Huth 2 days, 1 hour ago
On 08/01/2026 06.29, Richard Henderson wrote:
> Since x86_64 always has SSE2, we can remove the fallback
> that was present for i686.
> 
> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
> ---
>   host/include/x86_64/host/bufferiszero.c.inc | 5 -----
>   1 file changed, 5 deletions(-)
> 
> diff --git a/host/include/x86_64/host/bufferiszero.c.inc b/host/include/x86_64/host/bufferiszero.c.inc
> index 74ae98580f..7e9d896a8d 100644
> --- a/host/include/x86_64/host/bufferiszero.c.inc
> +++ b/host/include/x86_64/host/bufferiszero.c.inc
> @@ -3,7 +3,6 @@
>    * buffer_is_zero acceleration, x86 version.
>    */
>   
> -#if defined(CONFIG_AVX2_OPT) || defined(__SSE2__)
>   #include <immintrin.h>
>   
>   /* Helper for preventing the compiler from reassociating
> @@ -119,7 +118,3 @@ static unsigned best_accel(void)
>   #endif
>       return info & CPUINFO_SSE2 ? 1 : 0;
>   }
> -
> -#else
> -# include "host/include/generic/host/bufferiszero.c.inc"
> -#endif

Reviewed-by: Thomas Huth <thuth@redhat.com>