public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: Hamza Mahfooz <hamza.mahfooz@amd•com>, linuxppc-dev@lists•ozlabs.org
Cc: dan@danny•cz, daniel@octaforge•org,
	amd-gfx@lists•freedesktop.org, tpearson@raptorengineering•com,
	alexdeucher@gmail•com
Subject: Re: [PATCH] powerpc/64: Always build with 128-bit long double
Date: Wed, 12 Apr 2023 22:34:15 +1000	[thread overview]
Message-ID: <87leixi8jc.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <155c1057-d928-9037-9847-58cdbe7cf537@amd.com>

Hamza Mahfooz <hamza.mahfooz@amd•com> writes:
> On 4/4/23 06:28, Michael Ellerman wrote:
>> The amdgpu driver builds some of its code with hard-float enabled,
>> whereas the rest of the kernel is built with soft-float.
>> 
>> When building with 64-bit long double, if soft-float and hard-float
>> objects are linked together, the build fails due to incompatible ABI
>> tags.
>> 
>> In the past there have been build errors in the amdgpu driver caused by
>> this, some of those were due to bad intermingling of soft & hard-float
>> code, but those issues have now all been fixed since commit c92b7fe0d92a
>> ("drm/amd/display: move remaining FPU code to dml folder").
>> 
>> However it's still possible for soft & hard-float objects to end up
>> linked together, if the amdgpu driver is built-in to the kernel along
>> with the test_emulate_step.c code, which uses soft-float. That happens
>> in an allyesconfig build.
>> 
>> Currently those build errors are avoided because the amdgpu driver is
>> gated on 128-bit long double being enabled. But that's not a detail the
>> amdgpu driver should need to be aware of, and if another driver starts
>> using hard-float the same problem would occur.
>> 
>> All versions of the 64-bit ABI specify that long-double is 128-bits.
>> However some compilers, notably the kernel.org ones, are built to use
>> 64-bit long double by default.
>> 
>> Apart from this issue of soft vs hard-float, the kernel doesn't care
>> what size long double is. In particular the kernel using 128-bit long
>> double doesn't impact userspace's ability to use 64-bit long double, as
>> musl does.
>> 
>> So always build the 64-bit kernel with 128-bit long double. That should
>> avoid any build errors due to the incompatible ABI tags. Excluding the
>> code that uses soft/hard-float, the vmlinux is identical with/without
>> the flag.
>> 
>> It does mean any code which is incorrectly intermingling soft &
>> hard-float code will build without error, so those bugs will need to be
>> caught by testing rather than at build time.
>> 
>> For more background see:
>>    - commit d11219ad53dc ("amdgpu: disable powerpc support for the newer display engine")
>>    - commit c653c591789b ("drm/amdgpu: Re-enable DCN for 64-bit powerpc")
>>    - https://lore.kernel.org/r/dab9cbd8-2626-4b99-8098-31fe76397d2d@app.fastmail.com
>> 
>> Signed-off-by: Michael Ellerman <mpe@ellerman•id.au>
>
> Reviewed-by: Hamza Mahfooz <hamza.mahfooz@amd•com>

Thanks.

> If you'd prefer to have this go through the amdgpu branch, please let
> me know.

I think it makes more sense to go via the powerpc tree, it will get more
testing on powerpc that way.

cheers

  reply	other threads:[~2023-04-12 12:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-04 10:28 [PATCH] powerpc/64: Always build with 128-bit long double Michael Ellerman
2023-04-04 15:10 ` Segher Boessenkool
2023-04-05  5:32   ` Michael Ellerman
2023-04-05 11:04     ` Segher Boessenkool
2023-04-06 17:12 ` Hamza Mahfooz
2023-04-12 12:34   ` Michael Ellerman [this message]
2023-04-26 12:01 ` Michael Ellerman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87leixi8jc.fsf@mpe.ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=alexdeucher@gmail$(echo .)com \
    --cc=amd-gfx@lists$(echo .)freedesktop.org \
    --cc=dan@danny$(echo .)cz \
    --cc=daniel@octaforge$(echo .)org \
    --cc=hamza.mahfooz@amd$(echo .)com \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=tpearson@raptorengineering$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox