[PATCH v5 02/16] x86: Raise minimum GCC version to 8.1

Brian Gerst posted 16 patches 1 year, 3 months ago
There is a newer version of this series
[PATCH v5 02/16] x86: Raise minimum GCC version to 8.1
Posted by Brian Gerst 1 year, 3 months ago
Stack protector support on 64-bit currently requires that the percpu
section is linked at absolute address 0 because older compilers fixed
the location of the canary value relative to the GS segment base.
GCC 8.1 introduced options to change where the canary value is located,
allowing it to be configured as a standard percpu variable.  This has
already been done for 32-bit.  Doing the same for 64-bit will enable
removing the code needed to suport zero-based percpu.

Signed-off-by: Brian Gerst <brgerst@gmail.com>
---
 scripts/min-tool-version.sh | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
index 91c91201212c..06c4e410ecab 100755
--- a/scripts/min-tool-version.sh
+++ b/scripts/min-tool-version.sh
@@ -19,6 +19,8 @@ binutils)
 gcc)
 	if [ "$ARCH" = parisc64 ]; then
 		echo 12.0.0
+	elif [ "$SRCARCH" = x86 ]; then
+		echo 8.1.0
 	else
 		echo 5.1.0
 	fi
-- 
2.47.0
Re: [PATCH v5 02/16] x86: Raise minimum GCC version to 8.1
Posted by Borislav Petkov 1 year ago
On Tue, Nov 05, 2024 at 10:57:47AM -0500, Brian Gerst wrote:
> Stack protector support on 64-bit currently requires that the percpu
> section is linked at absolute address 0 because older compilers fixed
> the location of the canary value relative to the GS segment base.
> GCC 8.1 introduced options to change where the canary value is located,
> allowing it to be configured as a standard percpu variable.  This has
> already been done for 32-bit.  Doing the same for 64-bit will enable
> removing the code needed to suport zero-based percpu.

Unknown word [suport] in commit message.
Suggestions: ['support'...

Spellchecker please.

-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette
Re: [PATCH v5 02/16] x86: Raise minimum GCC version to 8.1
Posted by Ard Biesheuvel 1 year, 2 months ago
On Tue, 5 Nov 2024 at 16:58, Brian Gerst <brgerst@gmail.com> wrote:
>
> Stack protector support on 64-bit currently requires that the percpu
> section is linked at absolute address 0 because older compilers fixed
> the location of the canary value relative to the GS segment base.
> GCC 8.1 introduced options to change where the canary value is located,
> allowing it to be configured as a standard percpu variable.  This has
> already been done for 32-bit.  Doing the same for 64-bit will enable
> removing the code needed to suport zero-based percpu.
>
> Signed-off-by: Brian Gerst <brgerst@gmail.com>
> ---
>  scripts/min-tool-version.sh | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
> index 91c91201212c..06c4e410ecab 100755
> --- a/scripts/min-tool-version.sh
> +++ b/scripts/min-tool-version.sh
> @@ -19,6 +19,8 @@ binutils)
>  gcc)
>         if [ "$ARCH" = parisc64 ]; then
>                 echo 12.0.0
> +       elif [ "$SRCARCH" = x86 ]; then
> +               echo 8.1.0
>         else
>                 echo 5.1.0
>         fi

There appears to be consensus that we can bump this to GCC 8.1.0 for
all architectures:

https://lore.kernel.org/all/20240925150059.3955569-32-ardb+git@google.com/
Re: [PATCH v5 02/16] x86: Raise minimum GCC version to 8.1
Posted by Brian Gerst 1 year, 2 months ago
On Thu, Dec 5, 2024 at 6:44 AM Ard Biesheuvel <ardb@kernel.org> wrote:
>
> On Tue, 5 Nov 2024 at 16:58, Brian Gerst <brgerst@gmail.com> wrote:
> >
> > Stack protector support on 64-bit currently requires that the percpu
> > section is linked at absolute address 0 because older compilers fixed
> > the location of the canary value relative to the GS segment base.
> > GCC 8.1 introduced options to change where the canary value is located,
> > allowing it to be configured as a standard percpu variable.  This has
> > already been done for 32-bit.  Doing the same for 64-bit will enable
> > removing the code needed to suport zero-based percpu.
> >
> > Signed-off-by: Brian Gerst <brgerst@gmail.com>
> > ---
> >  scripts/min-tool-version.sh | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/scripts/min-tool-version.sh b/scripts/min-tool-version.sh
> > index 91c91201212c..06c4e410ecab 100755
> > --- a/scripts/min-tool-version.sh
> > +++ b/scripts/min-tool-version.sh
> > @@ -19,6 +19,8 @@ binutils)
> >  gcc)
> >         if [ "$ARCH" = parisc64 ]; then
> >                 echo 12.0.0
> > +       elif [ "$SRCARCH" = x86 ]; then
> > +               echo 8.1.0
> >         else
> >                 echo 5.1.0
> >         fi
>
> There appears to be consensus that we can bump this to GCC 8.1.0 for
> all architectures:
>
> https://lore.kernel.org/all/20240925150059.3955569-32-ardb+git@google.com/

That may be, but since the scope of this series is for x86, I'd rather
not have to depend on signoffs from all other arch maintainers.


Brian Gerst