Hi,

On 20/01/2023 00:48, Andrew Cooper wrote:
On 19/01/2023 2:07 pm, Oleksii Kurochko wrote:
diff --git a/xen/arch/riscv/early_printk.c b/xen/arch/riscv/early_printk.c
new file mode 100644
index 0000000000..6f590e712b
--- /dev/null
+++ b/xen/arch/riscv/early_printk.c
@@ -0,0 +1,45 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * RISC-V early printk using SBI
+ *
+ * Copyright (C) 2021 Bobby Eshleman <bobbyeshle...@gmail.com>
+ */
+#include <asm/early_printk.h>
+#include <asm/sbi.h>
+
+/*
+ * early_*() can be called from head.S with MMU-off.
+ *
+ * The following requiremets should be honoured for early_*() to
+ * work correctly:
+ *    It should use PC-relative addressing for accessing symbols.
+ *    To achieve that GCC cmodel=medany should be used.
+ */
+#ifndef __riscv_cmodel_medany
+#error "early_*() can be called from head.S with MMU-off"
+#endif

This comment is false, and the check is bogus.

You are already said that in the previous version and ... I reply back explaining why I think this is correct (see [1]).

 > It needs deleting.

That might be the second step. The first step is we settle down on the approach.

Cheers,

[1] https://lore.kernel.org/xen-devel/caf3u54c2ewefbn+zt6vpavu4vsqs_+12gr3yj_jsg1sghdh...@mail.gmail.com/

--
Julien Grall

Reply via email to