Skip to contentSkip to conversation

xen/arm: Fix compilation error when early printk is enabled

PATCH In review Michal Orzel 4 participants 9 messages Jan 21, 2021 – Jan 22, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen/arm: Fix compilation error when early printk is enabled

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

---
 xen/include/asm-arm/early_printk.h | 1 +
 1 file changed, 1 insertion(+)
xen/include/asm-arm/early_printk.h +1 -0
index d5485decfa..8dc911cf48 100644
@@ -10,6 +10,7 @@
 #ifndef __ARM_EARLY_PRINTK_H__
 #define __ARM_EARLY_PRINTK_H__
 
+#include <xen/page-size.h>
 
 #ifdef CONFIG_EARLY_PRINTK
 
Signature · 1 line
2.29.0
Reviewed-by on v1 1/1
#1 lore raw

Hi Michal,

Quoted 11 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

Fixes aa4b9d1ee653 ("include: don't use asm/page.h from common headers")
Quoted 1 line
Quoted 10 lines
---
  xen/include/asm-arm/early_printk.h | 1 +
  1 file changed, 1 insertion(+)
xen/include/asm-arm/early_printk.h +0 -0
index d5485decfa..8dc911cf48 100644

xen/include/asm-arm/early_printk.h line 16

Quoted 7 lines
xen/include/asm-arm/early_printk.h +1 -0
@@ -10,6 +10,7 @@
  #ifndef __ARM_EARLY_PRINTK_H__
  #define __ARM_EARLY_PRINTK_H__
 
+#include <xen/page-size.h>
 
  #ifdef CONFIG_EARLY_PRINTK
 

Cheers,

Signature · 1 line
Julien Grall
#2 lore raw
In reply to Michal Orzel
Quoted 8 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

I'm sorry for the breakage, but I wonder how I should have noticed the issue. In all the Arm .config-s I'm routinely building I can't even see ...

xen/include/asm-arm/early_printk.h line 15

Quoted 9 lines
xen/include/asm-arm/early_printk.h +1 -0
@@ -10,6 +10,7 @@
 #ifndef __ARM_EARLY_PRINTK_H__
 #define __ARM_EARLY_PRINTK_H__
 
+#include <xen/page-size.h>
 
 #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

Jan

#3 lore raw

Hi Jan,

Quoted 9 lines · Jan Beulich
Quoted 8 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 9 lines
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

I'm sorry for the breakage, but I wonder how I should have noticed the issue. In all the Arm .config-s I'm routinely building I can't even see ...

This is not your fault. Nowadays it is becoming harder and harder to try all the possible combinations.

Quoted 6 lines
Quoted 6 lines
xen/include/asm-arm/early_printk.h +0 -0
@@ -10,6 +10,7 @@
 #ifndef __ARM_EARLY_PRINTK_H__
 #define __ARM_EARLY_PRINTK_H__
 
Quoted 9 lines

xen/include/asm-arm/early_printk.h line 15

Quoted 3 lines
xen/include/asm-arm/early_printk.h +1 -0
+#include <xen/page-size.h>
 
 #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

Jan

Cheers,
Michal

#4 lore raw
In reply to Jan Beulich

Hi Jan,

Quoted 24 lines · Jan Beulich
Quoted 8 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

I'm sorry for the breakage, but I wonder how I should have noticed the issue. In all the Arm .config-s I'm routinely building I can't even see ...

Quoted 6 lines
xen/include/asm-arm/early_printk.h +0 -0
@@ -10,6 +10,7 @@
  #ifndef __ARM_EARLY_PRINTK_H__
  #define __ARM_EARLY_PRINTK_H__
 
Quoted 6 lines

xen/include/asm-arm/early_printk.h line 15

Quoted 3 lines
xen/include/asm-arm/early_printk.h +1 -0
+#include <xen/page-size.h>
 
  #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

EARLY_PRINTK is defined in arch/arm/Kconfig.debug and is selected when you specify the UART to use.

Assuming you are only build testing, you could add the following for testing EARLY_PRINTK:

CONFIG_DEBUG=y
CONFIG_EARLY_UART_CHOICE_8250=y
CONFIG_EARLY_UART_8250=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_UART_BASE_ADDRESS=
CONFIG_EARLY_UART_8250_REG_SHIFT=0
CONFIG_EARLY_PRINTK_INC="debug-8250.inc"

Cheers,

Signature · 1 line
Julien Grall
#5 lore raw
Quoted 40 lines · Julien Grall

Hi Jan,

Quoted 24 lines · Jan Beulich
Quoted 8 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

I'm sorry for the breakage, but I wonder how I should have noticed the issue. In all the Arm .config-s I'm routinely building I can't even see ...

Quoted 6 lines
xen/include/asm-arm/early_printk.h +0 -0
@@ -10,6 +10,7 @@
  #ifndef __ARM_EARLY_PRINTK_H__
  #define __ARM_EARLY_PRINTK_H__
 
Quoted 6 lines

xen/include/asm-arm/early_printk.h line 15

Quoted 3 lines
xen/include/asm-arm/early_printk.h +1 -0
+#include <xen/page-size.h>
 
  #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

EARLY_PRINTK is defined in arch/arm/Kconfig.debug and is selected when you specify the UART to use.

Assuming you are only build testing, you could add the following for testing EARLY_PRINTK:

Quoted 7 lines

CONFIG_DEBUG=y
CONFIG_EARLY_UART_CHOICE_8250=y
CONFIG_EARLY_UART_8250=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_UART_BASE_ADDRESS=
CONFIG_EARLY_UART_8250_REG_SHIFT=0
CONFIG_EARLY_PRINTK_INC="debug-8250.inc"

Ah yes, this works, thanks. The "optional" on the choice isn't very helpful I suppose, because when going from an existing .config one would neither find a setting presently turned off in that .config, nor will there be a prompt.

I suppose any page-aligned base address is fine to use for my build-testing-only purposes?

Jan

#6 lore raw

Hi Jan,

Quoted 49 lines · Jan Beulich
Quoted 40 lines · Julien Grall

Hi Jan,

Quoted 24 lines · Jan Beulich
Quoted 8 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

I'm sorry for the breakage, but I wonder how I should have noticed the issue. In all the Arm .config-s I'm routinely building I can't even see ...

Quoted 6 lines
xen/include/asm-arm/early_printk.h +0 -0
@@ -10,6 +10,7 @@
   #ifndef __ARM_EARLY_PRINTK_H__
   #define __ARM_EARLY_PRINTK_H__
 
Quoted 6 lines

xen/include/asm-arm/early_printk.h line 15

Quoted 3 lines
xen/include/asm-arm/early_printk.h +1 -0
+#include <xen/page-size.h>
 
   #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

EARLY_PRINTK is defined in arch/arm/Kconfig.debug and is selected when you specify the UART to use.

Assuming you are only build testing, you could add the following for testing EARLY_PRINTK:

Quoted 7 lines

CONFIG_DEBUG=y
CONFIG_EARLY_UART_CHOICE_8250=y
CONFIG_EARLY_UART_8250=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_UART_BASE_ADDRESS=
CONFIG_EARLY_UART_8250_REG_SHIFT=0
CONFIG_EARLY_PRINTK_INC="debug-8250.inc"

Quoted 4 lines

Ah yes, this works, thanks. The "optional" on the choice isn't very helpful I suppose, because when going from an existing .config one would neither find a setting presently turned off in that .config, nor will there be a prompt.

Do you have a suggestion how the "choice" can appear in the .config?

Quoted 2 lines

I suppose any page-aligned base address is fine to use for my build-testing-only purposes?

The base address doesn't need to be page-aligned (some HW have multiple UARTs in the same 4K region).

Cheers,

Signature · 1 line
Julien Grall
#7 lore raw
Quoted 31 lines · Julien Grall
Quoted 30 lines · Jan Beulich
Quoted 28 lines · Julien Grall
Quoted 7 lines · Jan Beulich
Quoted 6 lines · Michal Orzel
xen/include/asm-arm/early_printk.h +0 -0
@@ -10,6 +10,7 @@
   #ifndef __ARM_EARLY_PRINTK_H__
   #define __ARM_EARLY_PRINTK_H__
 
Quoted 6 lines

xen/include/asm-arm/early_printk.h line 15

Quoted 3 lines
xen/include/asm-arm/early_printk.h +1 -0
+#include <xen/page-size.h>
 
   #ifdef CONFIG_EARLY_PRINTK

... a respective Kconfig setting, i.e. it's not like I simply failed to enable it.

EARLY_PRINTK is defined in arch/arm/Kconfig.debug and is selected when you specify the UART to use.

Assuming you are only build testing, you could add the following for testing EARLY_PRINTK:

CONFIG_DEBUG=y
CONFIG_EARLY_UART_CHOICE_8250=y
CONFIG_EARLY_UART_8250=y
CONFIG_EARLY_PRINTK=y
CONFIG_EARLY_UART_BASE_ADDRESS=
CONFIG_EARLY_UART_8250_REG_SHIFT=0
CONFIG_EARLY_PRINTK_INC="debug-8250.inc"

Quoted 6 lines
Quoted 4 lines

Ah yes, this works, thanks. The "optional" on the choice isn't very helpful I suppose, because when going from an existing .config one would neither find a setting presently turned off in that .config, nor will there be a prompt.

Do you have a suggestion how the "choice" can appear in the .config?

Drop the "optional" attribute from it? Of course I ask without any knowledge on why it may have been put there in the first place.

Jan

Reviewed-by on v1 1/1
#8 lore raw
In reply to Michal Orzel

Hi Michal,

Quoted 10 lines · Michal Orzel

Fix compilation error when enabling early printk, introduced by commit aa4b9d1ee6538b5cbe218d4d3fcdf9548130a063:

```
debug.S: Assembler messages:
debug.S:31: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
debug.S:38: Error: constant expression expected at operand 2 -- `ldr x15,=((0x00400000+(0)*PAGE_SIZE)+(0x1c090000&~PAGE_MASK))`
```
Quoted 4 lines

The fix is to include header <xen/page-size.h> which now contains definitions for page/size/mask etc.

Thanks a lot, this is fixing the compilation issues.

Cheers
Bertrand

Quoted 19 lines

---
xen/include/asm-arm/early_printk.h | 1 +

1 file changed, 1 insertion(+)
xen/include/asm-arm/early_printk.h +1 -0
index d5485decfa..8dc911cf48 100644
@@ -10,6 +10,7 @@
 #ifndef __ARM_EARLY_PRINTK_H__
 #define __ARM_EARLY_PRINTK_H__
 
+#include <xen/page-size.h>
 
 #ifdef CONFIG_EARLY_PRINTK
 
Signature · 1 line
2.29.0