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

[PATCH] xen/riscv: Fix build with GCC 10


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Wed, 15 Mar 2023 18:51:21 +0000
  • Authentication-results: esa5.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Bob Eshleman <bobbyeshleman@xxxxxxxxx>, Alistair Francis <alistair.francis@xxxxxxx>, Connor Davis <connojdavis@xxxxxxxxx>
  • Delivery-date: Wed, 15 Mar 2023 18:51:59 +0000
  • Ironport-data: A9a23:FF28qq64b1ww2hM4CFrUtAxRtArHchMFZxGqfqrLsTDasY5as4F+v mEWXWHVaayONzP9KIogaITnoUwHvcXRztE1QQE/pX82Hi5G8cbLO4+Ufxz6V8+wwm8vb2o8t plDNYOQRCwQZiWBzvt4GuG59RGQ7YnRGvynTraCYnsrLeNdYH9JoQp5nOIkiZJfj9G8Agec0 fv/uMSaM1K+s9JOGjt8B5mr9VU+7JwehBtC5gZlPasS4QeE/5UoJMl3yZ+ZfiOQrrZ8RoZWd 86bpJml82XQ+QsaC9/Nut4XpWVTH9Y+lSDX4pZnc/DKbipq/0Te4Y5iXBYoUm9Fii3hojxE4 I4lWapc6+seFvakdOw1C3G0GszlVEFM0OevzXOX6aR/w6BaGpdFLjoH4EweZOUlFuhL7W5m+ aYRAS89Sw64uLiVg4yWSs1jqsAzI5y+VG8fkikIITDxCP8nRdbIQrnQ5M8e1zA17ixMNa+AP YxDM2MpNUmeJUQVYT/7C7pn9AusrlD5fydVtxS+oq0v7nKI5AdwzKLsIJzefdniqcB9zxfI/ jOdojqR7hcyOe278Bik6ECXlPL1hhvEfcU3D7C236s/6LGU7jNKU0BHPbehmtGph0j7V99BJ kg8/is1sbN05EGtVsP6XRCzvDiDpBF0c9NUEvYm4QCXjKTO6gCSB3MsUTJKLtchsaceTzsg3 E6EhNPtCDlmtpWaTHuc8vGfqjbaESMSK2kFZyMNUwoey9bmqYA3yBnIS75e/LWd14OvX2uqm nbT8XZ43u9I5SIW60ml1Vydihuzlr3XdTFvxUbpc2KB4S99dIHwMuRE9mPnxfpHKY+YSHyIs 34Fh9WS4YgyMH2dqMCeaL5TRe/0vp5pJBWZ2AcyRMd5q1xB7lb5JehtDCdCyFCF2yruURvge wfttAxY//e/11P6PPYsM+pd5ynHpJUM9OgJtNiOMrKigbArLmdrGR2CgmbBt10BaGB2zckC1 W6zKK5A90oyB6V91yaRTOwAy7ItzS1W7TqNGsCrlkX+iOLGOyT9pVI53LymP4gEAF6s+l2Jo 76zyePTo/mgbAEOSnaOqtNCRbz7BXM6GYr3u6RqSwJ3GSI/QDtJI6aIkdscl3lNw/w9ehHgo ivsBSe1CTPX2RX6FOl9Qio5Meq1Dc0h9SpT0O5FFQ/A5kXPqL2HtM83H6bbt5F9nAC/5ZaYl 8U4Rvg=
  • Ironport-hdrordr: A9a23:0sIzwaCGH78GhSflHelc55DYdb4zR+YMi2TDt3oddfU1SL3+qy nKpp4mPHDP5wr5NEtPpTnEAtjifZq+z+8Q3WByB9eftWDd0QPFEGgh1/qB/9SJIUbDH4VmpM JdmsZFaeEZDTJB/LrHCAvTKade/DFQmprY+9s3zB1WPHBXg7kL1XYeNu4CeHcGPjWvA/ACZe Ohz/sCnRWMU1INYP+2A3EUNtKz2uEixPrdEGY77wdM0nj0sQ+V
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

  riscv64-linux-gnu-gcc -MMD -MP -MF arch/riscv/.early_printk.o.d -DBUILD_ID 
-fno-strict-aliasing -std=gnu99 -Wall -Wstrict-prototypes 
-Wdeclaration-after-statement -Wno-unused-but-set-variable 
-Wno-unused-local-typedefs   -O1 -fno-omit-frame-pointer -nostdinc -fno-builtin 
-fno-common -Werror -Wredundant-decls -Wno-pointer-arith -Wvla -pipe -D__XEN__ 
-include ./include/xen/config.h -Wa,--strip-local-absolute -g -mabi=lp64  
-I./include -I./arch/riscv/include -march=rv64gc -mstrict-align -mcmodel=medany 
  -c arch/riscv/early_printk.c -o arch/riscv/early_printk.o
  arch/riscv/early_printk.c:18:2: error: #error "early_*() can be called from 
head.S with MMU-off"
     18 | #error "early_*() can be called from head.S with MMU-off"
        |  ^~~~~

  $ riscv64-linux-gnu-gcc --version
  riscv64-linux-gnu-gcc (Debian 10.2.1-6) 10.2.1 20210110

The binary is otherwise correct, so remove the incorrect check.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Bob Eshleman <bobbyeshleman@xxxxxxxxx>
CC: Alistair Francis <alistair.francis@xxxxxxx>
CC: Connor Davis <connojdavis@xxxxxxxxx>

I was honestly hoping to leave this to some poor sole in the future.

But the irony of this check, after all the argument it caused, breaking the
very case it was trying to enforce, speaks volumes.
---
 xen/arch/riscv/early_printk.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c
index dfe4ad77e25d..b66a11f1bc1a 100644
--- a/xen/arch/riscv/early_printk.c
+++ b/xen/arch/riscv/early_printk.c
@@ -7,17 +7,6 @@
 #include <asm/early_printk.h>
 #include <asm/sbi.h>
 
-/*
- * When the MMU is off during early boot, any C function called has to
- * use PC-relative rather than absolute address because the physical address
- * may not match the virtual address.
- *
- * To guarantee PC-relative address cmodel=medany should be used
- */
-#ifndef __riscv_cmodel_medany
-#error "early_*() can be called from head.S with MMU-off"
-#endif
-
 /*
  * TODO:
  *   sbi_console_putchar is already planned for deprecation
-- 
2.30.2




 


Rackspace

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