linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/10] arm64/kvm: Fix assembler compatibility of macros
Date: Fri, 24 Oct 2014 10:24:51 +0100	[thread overview]
Message-ID: <20141024092451.GA24265@leverpostej> (raw)
In-Reply-To: <f57759dbc105dd3996acd959d4e3157224ff81fa.1414099246.git.geoff@infradead.org>

On Fri, Oct 24, 2014 at 12:10:58AM +0100, Geoff Levand wrote:
> Some of the macros defined in kvm_arm.h are useful in assembly files, but are
> not compatible with the assembler.  Change any C language integer constant
> definitions using appended U, UL, or ULL to the UL() preprocessor macro.  Also,
> add a preprocessor include of the asm/memory.h file which defines the UL()
> macro.
> 
> Fixes build errors like these when using kvm_arm.h in assembly
> source files:
> 
>   Error: unexpected characters following instruction at operand 3 -- `and x0,x1,#((1U<<25)-1)'
> 
> Signed-off-by: Geoff Levand <geoff@infradead.org>

Thanks for putting this together, Geoff.

Acked-by: Mark Rutland <mark.rutland@arm.com>

Thanks,
Mark.

> ---
>  arch/arm64/include/asm/kvm_arm.h | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
> 
> diff --git a/arch/arm64/include/asm/kvm_arm.h b/arch/arm64/include/asm/kvm_arm.h
> index cc83520..9038a26 100644
> --- a/arch/arm64/include/asm/kvm_arm.h
> +++ b/arch/arm64/include/asm/kvm_arm.h
> @@ -18,6 +18,7 @@
>  #ifndef __ARM64_KVM_ARM_H__
>  #define __ARM64_KVM_ARM_H__
>  
> +#include <asm/memory.h>
>  #include <asm/types.h>
>  
>  /* Hyp Configuration Register (HCR) bits */
> @@ -149,9 +150,9 @@
>  #endif
>  
>  #define VTTBR_BADDR_SHIFT (VTTBR_X - 1)
> -#define VTTBR_BADDR_MASK  (((1LLU << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
> -#define VTTBR_VMID_SHIFT  (48LLU)
> -#define VTTBR_VMID_MASK	  (0xffLLU << VTTBR_VMID_SHIFT)
> +#define VTTBR_BADDR_MASK  (((UL(1) << (40 - VTTBR_X)) - 1) << VTTBR_BADDR_SHIFT)
> +#define VTTBR_VMID_SHIFT  (UL(48))
> +#define VTTBR_VMID_MASK	  (UL(0xFF) << VTTBR_VMID_SHIFT)
>  
>  /* Hyp System Trap Register */
>  #define HSTR_EL2_TTEE	(1 << 16)
> @@ -174,13 +175,13 @@
>  
>  /* Exception Syndrome Register (ESR) bits */
>  #define ESR_EL2_EC_SHIFT	(26)
> -#define ESR_EL2_EC		(0x3fU << ESR_EL2_EC_SHIFT)
> -#define ESR_EL2_IL		(1U << 25)
> +#define ESR_EL2_EC		(UL(0x3f) << ESR_EL2_EC_SHIFT)
> +#define ESR_EL2_IL		(UL(1) << 25)
>  #define ESR_EL2_ISS		(ESR_EL2_IL - 1)
>  #define ESR_EL2_ISV_SHIFT	(24)
> -#define ESR_EL2_ISV		(1U << ESR_EL2_ISV_SHIFT)
> +#define ESR_EL2_ISV		(UL(1) << ESR_EL2_ISV_SHIFT)
>  #define ESR_EL2_SAS_SHIFT	(22)
> -#define ESR_EL2_SAS		(3U << ESR_EL2_SAS_SHIFT)
> +#define ESR_EL2_SAS		(UL(3) << ESR_EL2_SAS_SHIFT)
>  #define ESR_EL2_SSE		(1 << 21)
>  #define ESR_EL2_SRT_SHIFT	(16)
>  #define ESR_EL2_SRT_MASK	(0x1f << ESR_EL2_SRT_SHIFT)
> @@ -194,16 +195,16 @@
>  #define ESR_EL2_FSC_TYPE	(0x3c)
>  
>  #define ESR_EL2_CV_SHIFT	(24)
> -#define ESR_EL2_CV		(1U << ESR_EL2_CV_SHIFT)
> +#define ESR_EL2_CV		(UL(1) << ESR_EL2_CV_SHIFT)
>  #define ESR_EL2_COND_SHIFT	(20)
> -#define ESR_EL2_COND		(0xfU << ESR_EL2_COND_SHIFT)
> +#define ESR_EL2_COND		(UL(0xf) << ESR_EL2_COND_SHIFT)
>  
>  
>  #define FSC_FAULT	(0x04)
>  #define FSC_PERM	(0x0c)
>  
>  /* Hyp Prefetch Fault Address Register (HPFAR/HDFAR) */
> -#define HPFAR_MASK	(~0xFUL)
> +#define HPFAR_MASK	(~UL(0xf))
>  
>  #define ESR_EL2_EC_UNKNOWN	(0x00)
>  #define ESR_EL2_EC_WFI		(0x01)
> -- 
> 1.9.1
> 
> 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
> 

  reply	other threads:[~2014-10-24  9:24 UTC|newest]

Thread overview: 72+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-23 23:10 [PATCH 00/10] arm64 kexec kernel patches V5 Geoff Levand
2014-10-23 23:10 ` [PATCH 03/10] arm64: Add new hcall HVC_CALL_FUNC Geoff Levand
2014-10-23 23:10 ` [PATCH 06/10] arm64: Update booting.txt to reserved-memory nodes Geoff Levand
2014-10-24 10:54   ` Mark Rutland
2014-10-24 11:04     ` Grant Likely
2014-10-24 12:18       ` Mark Rutland
2014-10-24 13:54         ` Grant Likely
2014-10-24 14:10           ` Mark Rutland
2014-10-24 14:47             ` Grant Likely
2014-10-23 23:10 ` [PATCH 07/10] arm64: Move proc-macros.S to include/asm Geoff Levand
2014-10-23 23:10 ` [PATCH 08/10] arm64/kexec: Add core kexec support Geoff Levand
2014-10-24 10:28   ` Mark Rutland
2014-11-13  2:19     ` Geoff Levand
2014-11-17 16:38       ` Mark Rutland
2014-11-17 20:20         ` Geoff Levand
2014-11-07 11:01   ` Arun Chandran
2014-11-12 21:54     ` Geoff Levand
2014-11-13  9:52       ` Arun Chandran
2014-11-17  3:52       ` Dave Young
2014-10-23 23:10 ` [PATCH 01/10] arm64/kvm: Fix assembler compatibility of macros Geoff Levand
2014-10-24  9:24   ` Mark Rutland [this message]
2014-10-27 12:13     ` Will Deacon
2014-10-27 12:45       ` Christoffer Dall
2014-10-31 23:06       ` [PATCH V2 " Geoff Levand
2014-10-23 23:10 ` [PATCH 04/10] arm64: Add EL2 switch to soft_restart Geoff Levand
2014-10-24 10:57   ` Mark Rutland
2014-10-31 23:47     ` Geoff Levand
2014-10-23 23:10 ` [PATCH 05/10] arm64: Convert dts to use reserved-memory nodes Geoff Levand
2014-10-24 10:51   ` Mark Rutland
2014-10-24 10:59     ` Grant Likely
2014-10-24 12:27       ` Mark Rutland
2014-10-24 14:45         ` Grant Likely
2014-10-31 23:44         ` Geoff Levand
2014-11-03 20:02           ` Mark Rutland
2014-11-03 22:26           ` Rob Herring
2014-11-04 11:35             ` Mark Rutland
2014-11-04 11:37             ` Grant Likely
2014-10-23 23:10 ` [PATCH 02/10] arm64: Convert hcalls to use ISS field Geoff Levand
2014-10-23 23:10 ` [PATCH 09/10] arm64/kexec: Enable kexec in the arm64 defconfig Geoff Levand
2014-10-24 10:31   ` Mark Rutland
2014-10-31 23:50     ` Geoff Levand
2014-11-03 20:05       ` Mark Rutland
2014-11-04  1:49         ` Geoff Levand
2014-10-23 23:10 ` [PATCH 10/10] arm64/kexec: Add pr_devel output Geoff Levand
2014-10-31  7:52 ` [PATCH 00/10] arm64 kexec kernel patches V5 Dave Young
2014-10-31 23:25   ` Geoff Levand
2014-11-06  2:01     ` Dave Young
2014-11-13  8:37     ` Dave Young
2014-11-13 23:50       ` Geoff Levand
2014-11-17  3:49         ` Dave Young
2014-11-03 19:46   ` Mark Rutland
2014-11-06  1:56     ` Dave Young
2014-11-06 15:08       ` Mark Rutland
2014-11-07  0:41         ` Grant Likely
2014-11-07 10:16           ` Mark Rutland
2014-11-07 10:41             ` Ard Biesheuvel
2014-11-07 10:45               ` Ard Biesheuvel
2014-11-07 10:46                 ` Ard Biesheuvel
2014-11-07 11:35               ` Mark Rutland
2014-11-07 11:42                 ` Ard Biesheuvel
2014-11-07 22:34                 ` Grant Likely
2014-11-06 12:16 ` Arun Chandran
2014-11-06 15:28   ` Mark Rutland
2014-11-06 16:13     ` Arun Chandran
2014-11-06 18:25       ` Geoff Levand
2014-11-07  6:26         ` Arun Chandran
2014-11-06 18:39       ` Mark Rutland
2014-11-07  6:36         ` Arun Chandran
2014-11-10  7:17       ` Dave Young
2014-11-10  8:35         ` Arun Chandran
2014-11-10  9:24           ` Dave Young
2014-11-12  9:56           ` Dave Young

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=20141024092451.GA24265@leverpostej \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).