unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support
@ 2021-10-10 23:23 Fangrui Song via Libc-alpha
  2021-10-10 23:37 ` H.J. Lu via Libc-alpha
  0 siblings, 1 reply; 4+ messages in thread
From: Fangrui Song via Libc-alpha @ 2021-10-10 23:23 UTC (permalink / raw
  To: libc-alpha, H.J. Lu

LLVM integrated assembler has incomplete MPX support, e.g.
bnd is not supported while bndmov is supported:

    error: invalid instruction mnemonic 'bnd'

Improve the configure check so that HAVE_MPX_SUPPORT code can be
properly skipped.
---
 sysdeps/x86_64/configure    | 2 ++
 sysdeps/x86_64/configure.ac | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
index 585279f83d..c3145e6030 100755
--- a/sysdeps/x86_64/configure
+++ b/sysdeps/x86_64/configure
@@ -30,6 +30,8 @@ if ${libc_cv_asm_mpx+:} false; then :
 else
   cat > conftest.s <<\EOF
         bndmov %bnd0,(%rsp)
+        bnd
+        jmp *%r11
 EOF
 if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
index 29e14033c0..3c935d66e1 100644
--- a/sysdeps/x86_64/configure.ac
+++ b/sysdeps/x86_64/configure.ac
@@ -14,6 +14,8 @@ dnl Check whether asm supports Intel MPX
 AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
 cat > conftest.s <<\EOF
         bndmov %bnd0,(%rsp)
+        bnd
+        jmp *%r11
 EOF
 if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
   libc_cv_asm_mpx=yes
-- 
2.33.0.882.g93a45727a2-goog


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

* Re: [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support
  2021-10-10 23:23 [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support Fangrui Song via Libc-alpha
@ 2021-10-10 23:37 ` H.J. Lu via Libc-alpha
  2021-10-11  0:29   ` Fangrui Song via Libc-alpha
  0 siblings, 1 reply; 4+ messages in thread
From: H.J. Lu via Libc-alpha @ 2021-10-10 23:37 UTC (permalink / raw
  To: Fangrui Song; +Cc: GNU C Library

On Sun, Oct 10, 2021 at 4:23 PM Fangrui Song <maskray@google.com> wrote:
>
> LLVM integrated assembler has incomplete MPX support, e.g.
> bnd is not supported while bndmov is supported:
>
>     error: invalid instruction mnemonic 'bnd'
>
> Improve the configure check so that HAVE_MPX_SUPPORT code can be
> properly skipped.
> ---
>  sysdeps/x86_64/configure    | 2 ++
>  sysdeps/x86_64/configure.ac | 2 ++
>  2 files changed, 4 insertions(+)
>
> diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
> index 585279f83d..c3145e6030 100755
> --- a/sysdeps/x86_64/configure
> +++ b/sysdeps/x86_64/configure
> @@ -30,6 +30,8 @@ if ${libc_cv_asm_mpx+:} false; then :
>  else
>    cat > conftest.s <<\EOF
>          bndmov %bnd0,(%rsp)
> +        bnd
> +        jmp *%r11
>  EOF
>  if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
> index 29e14033c0..3c935d66e1 100644
> --- a/sysdeps/x86_64/configure.ac
> +++ b/sysdeps/x86_64/configure.ac
> @@ -14,6 +14,8 @@ dnl Check whether asm supports Intel MPX
>  AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
>  cat > conftest.s <<\EOF
>          bndmov %bnd0,(%rsp)
> +        bnd
> +        jmp *%r11
>  EOF
>  if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
>    libc_cv_asm_mpx=yes
> --
> 2.33.0.882.g93a45727a2-goog
>

Intel MPX has been deprecated.   Can you simply remove MPX support?

Thanks.

-- 
H.J.

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

* Re: [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support
  2021-10-10 23:37 ` H.J. Lu via Libc-alpha
@ 2021-10-11  0:29   ` Fangrui Song via Libc-alpha
  2021-10-11  0:49     ` H.J. Lu via Libc-alpha
  0 siblings, 1 reply; 4+ messages in thread
From: Fangrui Song via Libc-alpha @ 2021-10-11  0:29 UTC (permalink / raw
  To: H.J. Lu; +Cc: GNU C Library


On 2021-10-10, H.J. Lu wrote:
>On Sun, Oct 10, 2021 at 4:23 PM Fangrui Song <maskray@google.com> wrote:
>>
>> LLVM integrated assembler has incomplete MPX support, e.g.
>> bnd is not supported while bndmov is supported:
>>
>>     error: invalid instruction mnemonic 'bnd'
>>
>> Improve the configure check so that HAVE_MPX_SUPPORT code can be
>> properly skipped.
>> ---
>>  sysdeps/x86_64/configure    | 2 ++
>>  sysdeps/x86_64/configure.ac | 2 ++
>>  2 files changed, 4 insertions(+)
>>
>> diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
>> index 585279f83d..c3145e6030 100755
>> --- a/sysdeps/x86_64/configure
>> +++ b/sysdeps/x86_64/configure
>> @@ -30,6 +30,8 @@ if ${libc_cv_asm_mpx+:} false; then :
>>  else
>>    cat > conftest.s <<\EOF
>>          bndmov %bnd0,(%rsp)
>> +        bnd
>> +        jmp *%r11
>>  EOF
>>  if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
>>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>> diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
>> index 29e14033c0..3c935d66e1 100644
>> --- a/sysdeps/x86_64/configure.ac
>> +++ b/sysdeps/x86_64/configure.ac
>> @@ -14,6 +14,8 @@ dnl Check whether asm supports Intel MPX
>>  AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
>>  cat > conftest.s <<\EOF
>>          bndmov %bnd0,(%rsp)
>> +        bnd
>> +        jmp *%r11
>>  EOF
>>  if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
>>    libc_cv_asm_mpx=yes
>> --
>> 2.33.0.882.g93a45727a2-goog
>>
>
>Intel MPX has been deprecated.   Can you simply remove MPX support?
>
>Thanks.
>
>-- 
>H.J.

Like https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/maskray/x86-mpx ?

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

* Re: [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support
  2021-10-11  0:29   ` Fangrui Song via Libc-alpha
@ 2021-10-11  0:49     ` H.J. Lu via Libc-alpha
  0 siblings, 0 replies; 4+ messages in thread
From: H.J. Lu via Libc-alpha @ 2021-10-11  0:49 UTC (permalink / raw
  To: Fangrui Song; +Cc: GNU C Library

On Sun, Oct 10, 2021 at 5:29 PM Fangrui Song <maskray@google.com> wrote:
>
>
> On 2021-10-10, H.J. Lu wrote:
> >On Sun, Oct 10, 2021 at 4:23 PM Fangrui Song <maskray@google.com> wrote:
> >>
> >> LLVM integrated assembler has incomplete MPX support, e.g.
> >> bnd is not supported while bndmov is supported:
> >>
> >>     error: invalid instruction mnemonic 'bnd'
> >>
> >> Improve the configure check so that HAVE_MPX_SUPPORT code can be
> >> properly skipped.
> >> ---
> >>  sysdeps/x86_64/configure    | 2 ++
> >>  sysdeps/x86_64/configure.ac | 2 ++
> >>  2 files changed, 4 insertions(+)
> >>
> >> diff --git a/sysdeps/x86_64/configure b/sysdeps/x86_64/configure
> >> index 585279f83d..c3145e6030 100755
> >> --- a/sysdeps/x86_64/configure
> >> +++ b/sysdeps/x86_64/configure
> >> @@ -30,6 +30,8 @@ if ${libc_cv_asm_mpx+:} false; then :
> >>  else
> >>    cat > conftest.s <<\EOF
> >>          bndmov %bnd0,(%rsp)
> >> +        bnd
> >> +        jmp *%r11
> >>  EOF
> >>  if { ac_try='${CC-cc} -c $ASFLAGS conftest.s 1>&5'
> >>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> >> diff --git a/sysdeps/x86_64/configure.ac b/sysdeps/x86_64/configure.ac
> >> index 29e14033c0..3c935d66e1 100644
> >> --- a/sysdeps/x86_64/configure.ac
> >> +++ b/sysdeps/x86_64/configure.ac
> >> @@ -14,6 +14,8 @@ dnl Check whether asm supports Intel MPX
> >>  AC_CACHE_CHECK(for Intel MPX support, libc_cv_asm_mpx, [dnl
> >>  cat > conftest.s <<\EOF
> >>          bndmov %bnd0,(%rsp)
> >> +        bnd
> >> +        jmp *%r11
> >>  EOF
> >>  if AC_TRY_COMMAND(${CC-cc} -c $ASFLAGS conftest.s 1>&AS_MESSAGE_LOG_FD); then
> >>    libc_cv_asm_mpx=yes
> >> --
> >> 2.33.0.882.g93a45727a2-goog
> >>
> >
> >Intel MPX has been deprecated.   Can you simply remove MPX support?
> >
> >Thanks.
> >
> >--
> >H.J.
>
> Like https://sourceware.org/git/?p=glibc.git;a=shortlog;h=refs/heads/maskray/x86-mpx ?

The patch looks OK.  Commit message should mention MPX deprecation.

Thanks.

-- 
H.J.

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

end of thread, other threads:[~2021-10-11  0:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-10 23:23 [PATCH] x86_64: Improve Intel MPX check to reject incomplete Clang support Fangrui Song via Libc-alpha
2021-10-10 23:37 ` H.J. Lu via Libc-alpha
2021-10-11  0:29   ` Fangrui Song via Libc-alpha
2021-10-11  0:49     ` H.J. Lu via Libc-alpha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).