Hi Michal,

On 4/28/21 2:26 PM, Michal Simek wrote:
Hi,

On 4/28/21 8:19 AM, quanyang.wang wrote:
Hi Michal,

On 4/28/21 2:11 PM, Michal Simek wrote:
Hi,

On 4/28/21 2:41 AM, quanyang.wang wrote:
Hi Michal,

On 4/27/21 9:12 PM, Michal Simek wrote:
Hi,

On 4/23/21 6:26 AM, quanyang.w...@windriver.com wrote:
From: Quanyang Wang <quanyang.w...@windriver.com>

When CONFIG_CPU_32v6 is enabled and arm gcc isn't configured with the
option "--with-arch=armv7-a", there will be a build error message as
below:

arch/arm/mach-zynq/suspend.S:68: Error: selected processor does not support 
`dsb sy' in ARM mode
arch/arm/mach-zynq/headsmp.S:13: Error: selected processor does not support 
`setend be' in ARM mode

This is because in arch/arm/Makefile, arch-$(CONFIG_CPU_32v6) will
override arch-$(CONFIG_CPU_32v7), and if the arm gcc doesn't contain
"--with-arch=armv7-a" feature, gcc can only handle armv6 instructions and
armv7 instructions in suspend.S and headsmp.S can't be recognized.

Let's add "-march=armv7-a" to AFLAGS explicitly to avoid this build
error.

Reported-by: kernel test robot <l...@intel.com>
Signed-off-by: Quanyang Wang <quanyang.w...@windriver.com>
---
  arch/arm/mach-zynq/Makefile | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/arch/arm/mach-zynq/Makefile b/arch/arm/mach-zynq/Makefile
index dbb75be53deb..9b3e6a4140a2 100644
--- a/arch/arm/mach-zynq/Makefile
+++ b/arch/arm/mach-zynq/Makefile
@@ -10,3 +10,5 @@ obj-$(CONFIG_SMP)             += headsmp.o platsmp.o
  ORIG_AFLAGS := $(KBUILD_AFLAGS)
  KBUILD_AFLAGS = $(subst -march=armv6k,,$(ORIG_AFLAGS))
  obj-$(CONFIG_SUSPEND)         += suspend.o
+AFLAGS_suspend.o       +=-Wa,-march=armv7-a
+AFLAGS_headsmp.o       +=-Wa,-march=armv7-a

Acked-by: Michal Simek <michal.si...@xilinx.com>

Can you please also send it to upstream that I will take it via my tree?
Do you mean mainline or git-...@xilinx.com?
upstream - linux-arm-kernel <linux-arm-ker...@lists.infradead.org> and lkml.
In mainline kernel, there is no suspend.S. Do you mean I delete the part
about suspend.S and send it

to linux-arm-kernel and lkml?
ah yeah. I remember Soren was trying to push it there in past.

Yes - just target that one file for upstreaming.

I tested on mainline kernel just now and found that mainline has no this issue.

I wrote the wrong reason in the commit message. The root cause is that xilinx

SDK delete "-march=armv6k" from KBUILD_AFLAGS in arch/arm/mach-zynq/Makefile:

ORIG_AFLAGS := $(KBUILD_AFLAGS)
KBUILD_AFLAGS = $(subst -march=armv6k,,$(ORIG_AFLAGS))

When CONFIG_CPU_32v6 and CONFIG_CPU_32v7 are both enabled, CONFIG_CPU_32v6K

will be seleted, and "-march=armv6k" will be added to AFLAGS.

So upstream kernel can build headsmp.S well with "-march=armv6k". But  linux-yocto build

failed without "-march=xxx" because there is armv6 instructions in headsmp.S and armv7

instructions in suspend.S. So this patch is only avaible for linux-yocto and linux-xlnx.

And I wonder if this patch is the best solution since I can't figure out the reason that delete

"-march=armv6k".

Michal, would you please give me some suggestions?

Thanks,

Quanyang



Thanks,
Michal

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9826): 
https://lists.yoctoproject.org/g/linux-yocto/message/9826
Mute This Topic: https://lists.yoctoproject.org/mt/82303755/21656
Group Owner: linux-yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to