[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 3/5] build: arm64: provide -target and -march if using clang


  • To: Julien Grall <julien@xxxxxxx>
  • From: Luca Fancellu <Luca.Fancellu@xxxxxxx>
  • Date: Tue, 3 Dec 2024 10:35:48 +0000
  • Accept-language: en-GB, en-US
  • Arc-authentication-results: i=2; mx.microsoft.com 1; spf=pass (sender ip is 63.35.35.123) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=pass (signature was verified) header.d=arm.com; arc=pass (0 oda=1 ltdi=1 spf=[1,1,smtp.mailfrom=arm.com] dkim=[1,1,header.d=arm.com] dmarc=[1,1,header.from=arm.com])
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none
  • Arc-message-signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zqpGvx/DKaZfbGFyKM6NO+fx+CIiYkQzdSiWawj89bI=; b=hg17gnkyTcsoe0olsm/DnRrIo142oV4QMA7Zerib/KmOq/q26/2qL8gPZWXB8RP/6jusT9kxKrN60Uo3mHJx7niW6QLAlBEM2QC7E/ZxTs1qGVRcrS1bLDOYfBFxDLAb9X57phB+NVdVnO2BPqGkZ9E5dnTWdws2tVq5PLll0CrSi+coOuteAvgYtUyvTHElJm0FHRMGtLlo3PFFNhtQ02soitfJ/z+rlPvNz4wetLI+ssqe14/ttHEROi2ulK8HaI7Jd9O5wYMalxkK3W7ipHTzhcEyMFealVhYfRLbe4slLi9L4kyBiJ3qLrfhdgLlVcKNF/nFfeahhmX1CKycyA==
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=zqpGvx/DKaZfbGFyKM6NO+fx+CIiYkQzdSiWawj89bI=; b=YGHqXY1WK7+Accq0PqTae00Qe3CCJJPo3EuxPWwQY38r71/ySe9kPosT0GFcXSM4mKlQwdC/nOHaXZlcOHqzGP/shKFAd/nzYI3MXAjoJz4YTARZTFKoO5/6Yj7bbx/qgounhm4eVD1P4pnAvS+4EicwCB001bl9C+6x1hJcK/CpY8DMNQ1mxucIm6lh7BQBN2EQmbJz15lPEzsRcYpevt9nGkS9RxG2GWitViMgl0cbMPWKxKpjeL/bf7WaNzdJHM50Bar49dglpTq7dLgBR1Sz8b5NL6/mEl5US87sq856aevfHK9RcLZow1qW+YAkHx/HkQHTazew1bYnBOS0QQ==
  • Arc-seal: i=2; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=pass; b=tV51WzxR6ko9i3GrPjzjHnpmlzsxcL2kKeS8HZdtxwY7wSiQIV31BldFv0Eu8NkT4UVYj43Vipi45FBDJVoJrxltOrdI5ZNAdkIRgIZO+VTNXJ1TgD4bVFdR6AAuaFeNJws8/crl7cDcxUfrNtpPWJs+FZOY9FeqbWOjFM/cglSpV7uGWUhX0KKMPaj1Lur+0+v6TsVNzuNon2nWN+NA/acqMLTam2Fl9SP2tmlJGziyDyLMt7OLY8+vFOn0GwFWjQ3DT/ZGE2Er7sYaplF1HlToRN0bJfAlLzhPdVZmhs4/hGRgtW0U4UFvAkdmmRgxlqGvkcvH+0GVYpRjM/K/AA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=RC1txj8SnYbmWWZUdAi+58wFS3oX9qmm5A0c8tas2zP6cHACmCT0RdhnuRxhEG4nyKFNdYmxAhQURbKVbP1EJiyb71RrGpCELk4jcjYZV1OBUdE20ObFO4b8tUjlXa30LMR6o6p7sYznPcGYkeYk91S9d1o6hZLF14P6XuDhg53n/yaOukA/iJqsupAQmKXXoU3hIY9HU6LttjDMrrMlEOMZ8ISxb6+Fi5Fx8f/24P8kBC8liIpw4Xje0i9yquODG2AaoI49tYdo2gIC9T+SZnj2gIIX0OybMSiS/yizANyUqM/TFtHlG8iMZUSjVlml/yO9mZH/oVgARABzWi9TJw==
  • Authentication-results-original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Cc: Jan Beulich <jbeulich@xxxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Anthony PERARD <anthony.perard@xxxxxxxxxx>, Ayan Kumar Halder <ayan.kumar.halder@xxxxxxx>
  • Delivery-date: Tue, 03 Dec 2024 10:36:15 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Nodisclaimer: true
  • Original-authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com;
  • Thread-index: AQHbRPo1JX+4yJsUxkavQ6TQ6Lnjf7LUVCKA
  • Thread-topic: [PATCH 3/5] build: arm64: provide -target and -march if using clang

HI,

> On 2 Dec 2024, at 20:38, Julien Grall <julien@xxxxxxx> wrote:
> 
> Hi Jan,
> 
> On 02/12/2024 07:52, Jan Beulich wrote:
>> On 30.11.2024 18:15, Julien Grall wrote:
>>> On 29/11/2024 22:12, Volodymyr Babchuk wrote:
>>>> Jan Beulich <jbeulich@xxxxxxxx> writes:
>>>>> On 29.11.2024 02:49, Volodymyr Babchuk wrote:
>>>>>> --- a/config/arm64.mk
>>>>>> +++ b/config/arm64.mk
>>>>>> @@ -5,6 +5,10 @@ CONFIG_XEN_INSTALL_SUFFIX :=
>>>>>>      CFLAGS += #-marm -march= -mcpu= etc
>>>>>>   +ifeq ($(clang),y)
>>>>>> +CFLAGS += -target aarch64 -march=armv8-a
>>>>>> +endif
>>>>> 
>>>>> Why is this dependent on (just?) $(clang), not (also?) $(llvm)?
>>>> 
>>>> Because this parameter is handled by clang only. There is no harm in
>>>> providing it explicitly. When building on arm64, value of this parameter
>>>> will match the default value for the platform. When building on x86, we
>>>> need to tell clang that it should generate arm64 code anyways. There is
>>>> no reason in trying to make ARM build with x86 instruction set.
>>>> 
>>>>> Also
>>>>> this affects both toolstack builds and hypervisor. Is applying -march
>>>>> like this actually appropriate for the toolstack?
>>>> 
>>>> This is a good question. I can't see why this can't be appropriate for
>>>> toolstack. I.e. what bad can happen when building the toolstack.
>>> 
>>> In the future, we may want to build the tools for Armv8-M. So I think
>>> the -march should also applies for the toolstack.
>> Perhaps I don't know enough of the Arm world, but: Wouldn't it be possible
>> to build a tool stack suitable for a wide range for Arm64 flavors, while
>> requiring more targeted hypervisor binaries?
> 
> Good question. There are some commonnality between ARMv8-M and ARMv8-R but I 
> am not sure whether it means we could use -march=armv8-a build and run on 
> ARMv8-M. Adding Ayan and Luca.

AFAIK a binary compiled for armv8-a aarch64 will work also on armv8-r aarch64 
since they share almost everything apart from some MPU registers,
instead in order to work on armv8-m we might need to pass the appropriate march

Cheers,
Luca


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.