All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement
@ 2025-04-02 17:07 Siddhesh Poyarekar
  2025-04-03 15:07 ` Martin Doucha
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-02 17:07 UTC (permalink / raw)
  To: ltp

When the input compiler defaults to AVX enabled, stack realignment
requirements causes gcc to fail to omit %rbp use, due to which the test
fails to clobber %rbp in inline asm.  Bump up the preferred stack
boundary to avoid this stack realignment for AVX, so the frame pointer
omission goes through.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
 testcases/cve/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index 01b9b9ccb..06bd1b3db 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -22,6 +22,9 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
 meltdown: CFLAGS += -msse2
 endif
 
-cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
+# The test needs to clobber %rbp, which requires frame pointer omission.  Also
+# bump up the preferred stack boundary to ensure that the compiler manages to
+# omit the frame pointer even with AVX enabled.
+cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer -mpreferred-stack-boundary=5
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement
  2025-04-02 17:07 [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement Siddhesh Poyarekar
@ 2025-04-03 15:07 ` Martin Doucha
  2025-04-04 14:00   ` Petr Vorel
  2025-04-04 18:14 ` [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
  2025-04-07 10:24 ` [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
  2 siblings, 1 reply; 19+ messages in thread
From: Martin Doucha @ 2025-04-03 15:07 UTC (permalink / raw)
  To: Siddhesh Poyarekar, ltp

Hello,
I've tested the new compile options with a buggy kernel and the test can 
still reproduce the issue.

Reviewed-by: Martin Doucha <mdoucha@suse.cz>

On 02. 04. 25 19:07, Siddhesh Poyarekar wrote:
> When the input compiler defaults to AVX enabled, stack realignment
> requirements causes gcc to fail to omit %rbp use, due to which the test
> fails to clobber %rbp in inline asm.  Bump up the preferred stack
> boundary to avoid this stack realignment for AVX, so the frame pointer
> omission goes through.
> 
> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
> ---
>   testcases/cve/Makefile | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
> index 01b9b9ccb..06bd1b3db 100644
> --- a/testcases/cve/Makefile
> +++ b/testcases/cve/Makefile
> @@ -22,6 +22,9 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
>   meltdown: CFLAGS += -msse2
>   endif
>   
> -cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
> +# The test needs to clobber %rbp, which requires frame pointer omission.  Also
> +# bump up the preferred stack boundary to ensure that the compiler manages to
> +# omit the frame pointer even with AVX enabled.
> +cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer -mpreferred-stack-boundary=5
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk


-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement
  2025-04-03 15:07 ` Martin Doucha
@ 2025-04-04 14:00   ` Petr Vorel
  2025-04-04 14:20     ` Martin Doucha
  0 siblings, 1 reply; 19+ messages in thread
From: Petr Vorel @ 2025-04-04 14:00 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

Hi Siddhesh, Martin,

Siddhesh, I was not aware -mpreferred-stack-boundary is not supported on all archs:
powerpc64le-linux-gnu-gcc: error: unrecognized command-line option '-mpreferred-stack-boundary=5'

But it's even not supported on clang:
clang: error: unknown argument: '-mpreferred-stack-boundary=5'

You need to use -mstack-alignment.

All failures:
https://github.com/pevik/ltp/actions/runs/14243227637/job/39917780931

Good thing is that value 5 is supported on all gcc versions we use.
If clang works as well, we need just detect the compiler.
Maybe it'd be easiest to test with AX_CHECK_COMPILE_FLAG.

Ideally create LTP fork, enable github actions and test yourself before posting.

> Hello,
> I've tested the new compile options with a buggy kernel and the test can
> still reproduce the issue.

Martin, thanks for testing. I'm sorry to waste your time.

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement
  2025-04-04 14:00   ` Petr Vorel
@ 2025-04-04 14:20     ` Martin Doucha
  2025-04-04 14:23       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Doucha @ 2025-04-04 14:20 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

On 04. 04. 25 16:00, Petr Vorel wrote:
> Hi Siddhesh, Martin,
> 
> Siddhesh, I was not aware -mpreferred-stack-boundary is not supported on all archs:
> powerpc64le-linux-gnu-gcc: error: unrecognized command-line option '-mpreferred-stack-boundary=5'
> 
> But it's even not supported on clang:
> clang: error: unknown argument: '-mpreferred-stack-boundary=5'
> 
> You need to use -mstack-alignment.

It might be better to use -mno-avx then and wrap the CFLAGS setting in 
the same condition as the meltdown test right above it.

ifneq (,$(filter $(HOST_CPU),x86 x86_64))
...
endif

I've tested -mno-avx as well so if it fixes the clobber problem I could 
not reproduce, you can submit patch v2 with my review tag.

-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement
  2025-04-04 14:20     ` Martin Doucha
@ 2025-04-04 14:23       ` Siddhesh Poyarekar
  0 siblings, 0 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-04 14:23 UTC (permalink / raw)
  To: Martin Doucha, Petr Vorel; +Cc: ltp

On 2025-04-04 10:20, Martin Doucha wrote:
> On 04. 04. 25 16:00, Petr Vorel wrote:
>> Hi Siddhesh, Martin,
>>
>> Siddhesh, I was not aware -mpreferred-stack-boundary is not supported 
>> on all archs:
>> powerpc64le-linux-gnu-gcc: error: unrecognized command-line option '- 
>> mpreferred-stack-boundary=5'

Sorry, I overlooked the arch check, I'll fix that.

>> But it's even not supported on clang:
>> clang: error: unknown argument: '-mpreferred-stack-boundary=5'
>>
>> You need to use -mstack-alignment.
> 
> It might be better to use -mno-avx then and wrap the CFLAGS setting in 
> the same condition as the meltdown test right above it.
> 
> ifneq (,$(filter $(HOST_CPU),x86 x86_64))
> ...
> endif
> 
> I've tested -mno-avx as well so if it fixes the clobber problem I could 
> not reproduce, you can submit patch v2 with my review tag.

Yes, I was just about to ask if -mno-avx would be acceptable :)

I'll send a v2, thanks!

Sid

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX
  2025-04-02 17:07 [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement Siddhesh Poyarekar
  2025-04-03 15:07 ` Martin Doucha
@ 2025-04-04 18:14 ` Siddhesh Poyarekar
  2025-04-04 18:14   ` [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
  2025-04-04 18:14   ` [LTP] [PATCH v2 2/2] Add centos10 to test matrix Siddhesh Poyarekar
  2025-04-07 10:24 ` [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
  2 siblings, 2 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-04 18:14 UTC (permalink / raw)
  To: ltp

Here's v2 of the patch, this time also with an addition to the test
matrix so that github actions also tests on centos10, which has gcc
defaulting to x86-64-v3.

Test results without the flags, where centos10 fails:
https://github.com/siddhesh/ltp/actions/runs/14271015950/job/40004000177#step:10:658

Test results with the flags where all tests succeed:
https://github.com/siddhesh/ltp/actions/runs/14271210435

Siddhesh Poyarekar (2):
  cve-2015-3290: Disable AVX for x86_64
  Add centos10 to test matrix

 .github/workflows/ci-docker-build.yml | 5 +++++
 testcases/cve/Makefile                | 6 ++++++
 2 files changed, 11 insertions(+)

-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-04 18:14 ` [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
@ 2025-04-04 18:14   ` Siddhesh Poyarekar
  2025-04-07  8:29     ` Martin Doucha
  2025-04-04 18:14   ` [LTP] [PATCH v2 2/2] Add centos10 to test matrix Siddhesh Poyarekar
  1 sibling, 1 reply; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-04 18:14 UTC (permalink / raw)
  To: ltp

When the input compiler enables AVX, stack realignment requirements
causes gcc to fail to omit %rbp use, due to which the test fails to
clobber %rbp in inline asm.  Disable AVX to build the test on x86_64 so
that the test continues working.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/cve/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index 01b9b9ccb..d545a7f93 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
 meltdown: CFLAGS += -msse2
 endif
 
+# The test needs to clobber %rbp, which requires frame pointer omission.  Also
+# for x86_64, disable AVX since that could sometimes require a stack
+# realignment, which gets in the way of frame pointer omission.
 cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
+ifneq (,$(filter $(HOST_CPU),x86_64))
+cve-2015-3290: CFLAGS += -mno-avx
+endif
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v2 2/2] Add centos10 to test matrix
  2025-04-04 18:14 ` [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
  2025-04-04 18:14   ` [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
@ 2025-04-04 18:14   ` Siddhesh Poyarekar
  1 sibling, 0 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-04 18:14 UTC (permalink / raw)
  To: ltp

gcc on CentOS 10 is configured to build with AVX on by default
(specifically, -march=x86-64-v3), unlike other compilers, so it should
be a useful addition to the test matrix.

cve-2015-3290 for example fails to build on this without `-mno-avx` in
the build flags.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
 .github/workflows/ci-docker-build.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml
index 44dcca055..310d8c3a3 100644
--- a/.github/workflows/ci-docker-build.yml
+++ b/.github/workflows/ci-docker-build.yml
@@ -67,6 +67,11 @@ jobs:
               CC: gcc
               TREE: out
 
+          - container: "quay.io/centos/centos:stream10"
+            env:
+              CC: gcc
+              TREE: out
+
           - container: "debian:testing"
             env:
               CC: gcc
-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-04 18:14   ` [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
@ 2025-04-07  8:29     ` Martin Doucha
  2025-04-07  9:18       ` Petr Vorel
  0 siblings, 1 reply; 19+ messages in thread
From: Martin Doucha @ 2025-04-07  8:29 UTC (permalink / raw)
  To: Siddhesh Poyarekar, ltp

Hi,
one nit below.

On 04. 04. 25 20:14, Siddhesh Poyarekar wrote:
> When the input compiler enables AVX, stack realignment requirements
> causes gcc to fail to omit %rbp use, due to which the test fails to
> clobber %rbp in inline asm.  Disable AVX to build the test on x86_64 so
> that the test continues working.
> 
> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
> Reviewed-by: Martin Doucha <mdoucha@suse.cz>
> ---
>   testcases/cve/Makefile | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
> index 01b9b9ccb..d545a7f93 100644
> --- a/testcases/cve/Makefile
> +++ b/testcases/cve/Makefile
> @@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
>   meltdown: CFLAGS += -msse2
>   endif
>   
> +# The test needs to clobber %rbp, which requires frame pointer omission.  Also
> +# for x86_64, disable AVX since that could sometimes require a stack
> +# realignment, which gets in the way of frame pointer omission.
>   cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
> +ifneq (,$(filter $(HOST_CPU),x86_64))

If you don't want to add the command line option for 32bit x86 builds, 
then this condition would be cleaner:
ifeq ($(HOST_CPU),x86_64)

We can fix that during merge but please confirm that we should.

> +cve-2015-3290: CFLAGS += -mno-avx
> +endif
>   
>   include $(top_srcdir)/include/mk/generic_leaf_target.mk


-- 
Martin Doucha   mdoucha@suse.cz
SW Quality Engineer
SUSE LINUX, s.r.o.
CORSO IIa
Krizikova 148/34
186 00 Prague 8
Czech Republic

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-07  8:29     ` Martin Doucha
@ 2025-04-07  9:18       ` Petr Vorel
  2025-04-07 10:09         ` Siddhesh Poyarekar
  0 siblings, 1 reply; 19+ messages in thread
From: Petr Vorel @ 2025-04-07  9:18 UTC (permalink / raw)
  To: Martin Doucha; +Cc: ltp

> Hi,
> one nit below.

> On 04. 04. 25 20:14, Siddhesh Poyarekar wrote:
> > When the input compiler enables AVX, stack realignment requirements
> > causes gcc to fail to omit %rbp use, due to which the test fails to
> > clobber %rbp in inline asm.  Disable AVX to build the test on x86_64 so
> > that the test continues working.

> > Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
> > Reviewed-by: Martin Doucha <mdoucha@suse.cz>
> > ---
> >   testcases/cve/Makefile | 6 ++++++
> >   1 file changed, 6 insertions(+)

> > diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
> > index 01b9b9ccb..d545a7f93 100644
> > --- a/testcases/cve/Makefile
> > +++ b/testcases/cve/Makefile
> > @@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
> >   meltdown: CFLAGS += -msse2
> >   endif
> > +# The test needs to clobber %rbp, which requires frame pointer omission.  Also
> > +# for x86_64, disable AVX since that could sometimes require a stack
> > +# realignment, which gets in the way of frame pointer omission.
> >   cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
> > +ifneq (,$(filter $(HOST_CPU),x86_64))

> If you don't want to add the command line option for 32bit x86 builds, then
> this condition would be cleaner:
> ifeq ($(HOST_CPU),x86_64)

+1. IMHO this works as expected. I suppose Siddhesh got inspiration for filter
due the above meltdown, where it is needed because it compares 2 archs. But
I will also appreciate an explicit confirmation.

Kind regards,
Petr

> We can fix that during merge but please confirm that we should.

> > +cve-2015-3290: CFLAGS += -mno-avx
> > +endif
> >   include $(top_srcdir)/include/mk/generic_leaf_target.mk

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-07  9:18       ` Petr Vorel
@ 2025-04-07 10:09         ` Siddhesh Poyarekar
  0 siblings, 0 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-07 10:09 UTC (permalink / raw)
  To: Petr Vorel, Martin Doucha; +Cc: ltp

On 2025-04-07 05:18, Petr Vorel wrote:
>>> diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
>>> index 01b9b9ccb..d545a7f93 100644
>>> --- a/testcases/cve/Makefile
>>> +++ b/testcases/cve/Makefile
>>> @@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
>>>    meltdown: CFLAGS += -msse2
>>>    endif
>>> +# The test needs to clobber %rbp, which requires frame pointer omission.  Also
>>> +# for x86_64, disable AVX since that could sometimes require a stack
>>> +# realignment, which gets in the way of frame pointer omission.
>>>    cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
>>> +ifneq (,$(filter $(HOST_CPU),x86_64))
> 
>> If you don't want to add the command line option for 32bit x86 builds, then
>> this condition would be cleaner:
>> ifeq ($(HOST_CPU),x86_64)
> 
> +1. IMHO this works as expected. I suppose Siddhesh got inspiration for filter
> due the above meltdown, where it is needed because it compares 2 archs. But
> I will also appreciate an explicit confirmation.

Oops, yes.  I tested both first just like meltdown and then just removed 
x86.  I'll send a v3 in a moment.

Thanks,
Sid

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX
  2025-04-02 17:07 [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement Siddhesh Poyarekar
  2025-04-03 15:07 ` Martin Doucha
  2025-04-04 18:14 ` [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
@ 2025-04-07 10:24 ` Siddhesh Poyarekar
  2025-04-07 10:24   ` [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
  2025-04-07 10:24   ` [LTP] [PATCH v3 2/2] Add centos10 to test matrix Siddhesh Poyarekar
  2 siblings, 2 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-07 10:24 UTC (permalink / raw)
  To: ltp

Here's v3 of the patch with test results here:

https://github.com/siddhesh/ltp/actions/runs/14306572501

Thanks,
Sid

Siddhesh Poyarekar (2):
  cve-2015-3290: Disable AVX for x86_64
  Add centos10 to test matrix

 .github/workflows/ci-docker-build.yml | 5 +++++
 testcases/cve/Makefile                | 6 ++++++
 2 files changed, 11 insertions(+)

-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-07 10:24 ` [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
@ 2025-04-07 10:24   ` Siddhesh Poyarekar
  2025-04-07 11:18     ` Petr Vorel
  2025-04-07 10:24   ` [LTP] [PATCH v3 2/2] Add centos10 to test matrix Siddhesh Poyarekar
  1 sibling, 1 reply; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-07 10:24 UTC (permalink / raw)
  To: ltp

When the input compiler enables AVX, stack realignment requirements
causes gcc to fail to omit %rbp use, due to which the test fails to
clobber %rbp in inline asm.  Disable AVX to build the test on x86_64 so
that the test continues working.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
Reviewed-by: Martin Doucha <mdoucha@suse.cz>
---
 testcases/cve/Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/testcases/cve/Makefile b/testcases/cve/Makefile
index 01b9b9ccb..98c38e908 100644
--- a/testcases/cve/Makefile
+++ b/testcases/cve/Makefile
@@ -22,6 +22,12 @@ ifneq (,$(filter $(HOST_CPU),x86 x86_64))
 meltdown: CFLAGS += -msse2
 endif
 
+# The test needs to clobber %rbp, which requires frame pointer omission.  Also
+# for x86_64, disable AVX since that could sometimes require a stack
+# realignment, which gets in the way of frame pointer omission.
 cve-2015-3290:	CFLAGS += -pthread -fomit-frame-pointer
+ifeq ($(HOST_CPU),x86_64)
+cve-2015-3290: CFLAGS += -mno-avx
+endif
 
 include $(top_srcdir)/include/mk/generic_leaf_target.mk
-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [LTP] [PATCH v3 2/2] Add centos10 to test matrix
  2025-04-07 10:24 ` [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
  2025-04-07 10:24   ` [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
@ 2025-04-07 10:24   ` Siddhesh Poyarekar
  2025-04-07 11:13     ` Petr Vorel
  1 sibling, 1 reply; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-07 10:24 UTC (permalink / raw)
  To: ltp

gcc on CentOS 10 is configured to build with AVX on by default
(specifically, -march=x86-64-v3), unlike other compilers, so it should
be a useful addition to the test matrix.

cve-2015-3290 for example fails to build on this without `-mno-avx` in
the build flags.

Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
---
 .github/workflows/ci-docker-build.yml | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml
index 44dcca055..310d8c3a3 100644
--- a/.github/workflows/ci-docker-build.yml
+++ b/.github/workflows/ci-docker-build.yml
@@ -67,6 +67,11 @@ jobs:
               CC: gcc
               TREE: out
 
+          - container: "quay.io/centos/centos:stream10"
+            env:
+              CC: gcc
+              TREE: out
+
           - container: "debian:testing"
             env:
               CC: gcc
-- 
2.49.0


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v3 2/2] Add centos10 to test matrix
  2025-04-07 10:24   ` [LTP] [PATCH v3 2/2] Add centos10 to test matrix Siddhesh Poyarekar
@ 2025-04-07 11:13     ` Petr Vorel
  2025-04-07 13:43       ` Siddhesh Poyarekar
  0 siblings, 1 reply; 19+ messages in thread
From: Petr Vorel @ 2025-04-07 11:13 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: ltp

Hi Siddhesh,

> gcc on CentOS 10 is configured to build with AVX on by default
> (specifically, -march=x86-64-v3), unlike other compilers, so it should
> be a useful addition to the test matrix.

> cve-2015-3290 for example fails to build on this without `-mno-avx` in
> the build flags.

I don't want to add yet another CI job just to test previous commit.
We already have quite a lot of distros (running is quite long).

@Li I suppose you want to keep centos 9 than to have centos 10.
I guess for new distros we have Fedora.

Therefore I suggest to not accept this change.

Kind regards,
Petr

> Signed-off-by: Siddhesh Poyarekar <siddhesh@gotplt.org>
> ---
>  .github/workflows/ci-docker-build.yml | 5 +++++
>  1 file changed, 5 insertions(+)

> diff --git a/.github/workflows/ci-docker-build.yml b/.github/workflows/ci-docker-build.yml
> index 44dcca055..310d8c3a3 100644
> --- a/.github/workflows/ci-docker-build.yml
> +++ b/.github/workflows/ci-docker-build.yml
> @@ -67,6 +67,11 @@ jobs:
>                CC: gcc
>                TREE: out

> +          - container: "quay.io/centos/centos:stream10"
> +            env:
> +              CC: gcc
> +              TREE: out
> +
>            - container: "debian:testing"
>              env:
>                CC: gcc

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64
  2025-04-07 10:24   ` [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
@ 2025-04-07 11:18     ` Petr Vorel
  0 siblings, 0 replies; 19+ messages in thread
From: Petr Vorel @ 2025-04-07 11:18 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: Martin Doucha, ltp

Hi Siddhesh, Martin,

> When the input compiler enables AVX, stack realignment requirements
> causes gcc to fail to omit %rbp use, due to which the test fails to
> clobber %rbp in inline asm.  Disable AVX to build the test on x86_64 so
> that the test continues working.

Thanks for your work and testing, this patch merged!

Kind regards,
Petr

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v3 2/2] Add centos10 to test matrix
  2025-04-07 11:13     ` Petr Vorel
@ 2025-04-07 13:43       ` Siddhesh Poyarekar
  2025-04-10  3:03         ` Li Wang via ltp
  0 siblings, 1 reply; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-07 13:43 UTC (permalink / raw)
  To: Petr Vorel; +Cc: ltp

On 2025-04-07 07:13, Petr Vorel wrote:
>> gcc on CentOS 10 is configured to build with AVX on by default
>> (specifically, -march=x86-64-v3), unlike other compilers, so it should
>> be a useful addition to the test matrix.
> 
>> cve-2015-3290 for example fails to build on this without `-mno-avx` in
>> the build flags.
> 
> I don't want to add yet another CI job just to test previous commit.
> We already have quite a lot of distros (running is quite long).

So the reason I suggested adding centos10 is that it has a distinctly 
different toolchain from the other containers in the matrix.  The gcc on 
centos10 defaults to generating code for the x86-64-v3 baseline (which 
enables AVX by default) on x86_64 which is different from all of the 
other test environments in the matrix.

> @Li I suppose you want to keep centos 9 than to have centos 10.
> I guess for new distros we have Fedora.

centos9 defaults to x86-64-v2 FWIW, so it's kinda unique in that sense 
too.  Fedora does not change ISA baselines the way centos/RHEL does 
since the Fedora community would like to continue supporting the lowest 
common denominator in terms of architecture support.

Although I understand the need to keep the pre-commit CI run slim, just 
thought I'd add my $0.02 :)

Thanks,
Sid

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v3 2/2] Add centos10 to test matrix
  2025-04-07 13:43       ` Siddhesh Poyarekar
@ 2025-04-10  3:03         ` Li Wang via ltp
  2025-04-10 14:50           ` Siddhesh Poyarekar
  0 siblings, 1 reply; 19+ messages in thread
From: Li Wang via ltp @ 2025-04-10  3:03 UTC (permalink / raw)
  To: Siddhesh Poyarekar; +Cc: ltp

Hi Petr, Siddhesh,

Siddhesh's words make sense, but considering we (RedHat) already test
Fedora-ELN [1] internally with the LTP latest branch, so it's not necessary
to enable CentOS-10 stream in GitHub CI again.

[1] Acts as a testing ground for RHEL's next major version (e.g., RHEL 10).

@Siddhesh, you can find the Fedora-ELN test in CKI system, which plays
an important role in testing LTP master branch.


On Mon, Apr 7, 2025 at 10:00 PM Siddhesh Poyarekar <siddhesh@gotplt.org>
wrote:

> On 2025-04-07 07:13, Petr Vorel wrote:
> >> gcc on CentOS 10 is configured to build with AVX on by default
> >> (specifically, -march=x86-64-v3), unlike other compilers, so it should
> >> be a useful addition to the test matrix.
> >
> >> cve-2015-3290 for example fails to build on this without `-mno-avx` in
> >> the build flags.
> >
> > I don't want to add yet another CI job just to test previous commit.
> > We already have quite a lot of distros (running is quite long).
>
> So the reason I suggested adding centos10 is that it has a distinctly
> different toolchain from the other containers in the matrix.  The gcc on
> centos10 defaults to generating code for the x86-64-v3 baseline (which
> enables AVX by default) on x86_64 which is different from all of the
> other test environments in the matrix.
>
> > @Li I suppose you want to keep centos 9 than to have centos 10.
> > I guess for new distros we have Fedora.
>
> centos9 defaults to x86-64-v2 FWIW, so it's kinda unique in that sense
> too.  Fedora does not change ISA baselines the way centos/RHEL does
> since the Fedora community would like to continue supporting the lowest
> common denominator in terms of architecture support.


> Although I understand the need to keep the pre-commit CI run slim, just
> thought I'd add my $0.02 :)
>
> Thanks,
> Sid
>
>

-- 
Regards,
Li Wang

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [LTP] [PATCH v3 2/2] Add centos10 to test matrix
  2025-04-10  3:03         ` Li Wang via ltp
@ 2025-04-10 14:50           ` Siddhesh Poyarekar
  0 siblings, 0 replies; 19+ messages in thread
From: Siddhesh Poyarekar @ 2025-04-10 14:50 UTC (permalink / raw)
  To: Li Wang; +Cc: ltp

On 2025-04-09 23:03, Li Wang wrote:
> Hi Petr, Siddhesh,
> 
> Siddhesh's words make sense, but considering we (RedHat) already test
> Fedora-ELN [1] internally with the LTP latest branch, so it's not necessary
> to enable CentOS-10 stream in GitHub CI again.
> 
> [1] Acts as a testing ground for RHEL's next major version (e.g., RHEL 10).
> 
> @Siddhesh, you can find the Fedora-ELN test in CKI system, which plays
> an important role in testing LTP master branch.

Ahh ok, that's fair.  I wasn't aware that LTP tests were run on ELN.

Thanks,
Sid

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2025-04-10 14:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-02 17:07 [LTP] [PATCH] cve-2015-3290: Bump up stack boundary requirement Siddhesh Poyarekar
2025-04-03 15:07 ` Martin Doucha
2025-04-04 14:00   ` Petr Vorel
2025-04-04 14:20     ` Martin Doucha
2025-04-04 14:23       ` Siddhesh Poyarekar
2025-04-04 18:14 ` [LTP] [PATCH v2 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
2025-04-04 18:14   ` [LTP] [PATCH v2 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
2025-04-07  8:29     ` Martin Doucha
2025-04-07  9:18       ` Petr Vorel
2025-04-07 10:09         ` Siddhesh Poyarekar
2025-04-04 18:14   ` [LTP] [PATCH v2 2/2] Add centos10 to test matrix Siddhesh Poyarekar
2025-04-07 10:24 ` [LTP] [PATCH v3 0/2] cve-2015-3290: Disable AVX Siddhesh Poyarekar
2025-04-07 10:24   ` [LTP] [PATCH v3 1/2] cve-2015-3290: Disable AVX for x86_64 Siddhesh Poyarekar
2025-04-07 11:18     ` Petr Vorel
2025-04-07 10:24   ` [LTP] [PATCH v3 2/2] Add centos10 to test matrix Siddhesh Poyarekar
2025-04-07 11:13     ` Petr Vorel
2025-04-07 13:43       ` Siddhesh Poyarekar
2025-04-10  3:03         ` Li Wang via ltp
2025-04-10 14:50           ` Siddhesh Poyarekar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.