[ipxe-devel] [RFC] Why does ARM set -mcpu=cortex-a15

Mark Rutland mark.rutland at arm.com
Thu Mar 29 14:25:03 UTC 2018


On Thu, Mar 29, 2018 at 03:08:17PM +0100, Michael Brown wrote:
> On 29/03/18 01:45, Heinrich Schuchardt wrote:
> > I have some questions concerning the compilation flags used by iPXE on ARM.
> > 
> > There are a lot of different ARM CPUs available. Why do we set
> > -mcpu=cortex-a15?
> 
> In all honesty, I don't remember.  My best guess is that the build options
> were copied from whatever the EDK2 toolchain happens to use. I'd have to dig
> out my notebooks to find out for sure.
> 
> > Couldn't we use something like
> > -march=armv7-a -mfpu=vfpv3-d16 -mfloat=hard
> > instead? This is what Debian requires for armhf.
> 
> Mark: would this be sensible for AArch32 UEFI?

Unfortunately, UEFI forbids FP/simd/vector usage for AArch32, so I don't
think it's safe to pass -mfpu=vfpv3-d16 or -mfloat=hard. In contrast,
UEFI permits FP and SIMD for AArch64.

Per the UEFI 2.7 spec [1], section 2.3.5.3, describing AArch32:

  Floating point, SIMD, vector operations and other instruction set
  extensions must not be used.

It's probably necessary to use -mgeneral-regs-only to ensure the
compiler doesn't implicitly use vectors/simd, and if FP is necessary,
softfloat must be used.

Using -march=armv7a sounds fine to me otherwise, assuming IPXE is not
expected to run on ARMv6 or earlier.

I've also just spotted that the spec also states:

  The EFI ARM platform binding defines register r9 as an additional
  callee-saved variable register.

... which probably requires some special GCC option.

Thanks,
Mark.

[1] http://www.uefi.org/sites/default/files/resources/UEFI%20Spec%202_7_A%20Sept%206.pdf



More information about the ipxe-devel mailing list