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

Re: [PATCH v2 07/14] xen/riscv: introduce exception context



Hi Oleksii,

On 27/01/2023 13:59, Oleksii Kurochko wrote:
+static inline void wfi(void)
+{
+    __asm__ __volatile__ ("wfi");

I have starred at this line for a while and I am not quite too sure to understand why we don't need to clobber the memory like we do on Arm.

FWIW, Linux is doing the same, so I guess this is correct. For Arm we also follow the Linux implementation.

But I am wondering whether we are just too strict on Arm, RISCv compiler offer a different guarantee, or you expect the user to be responsible to prevent the compiler to do harmful optimization.

+/*
+ * panic() isn't available at the moment so an infinite loop will be
+ * used temporarily.
+ * TODO: change it to panic()
+ */
+static inline void die(void)
+{
+    for( ;; ) wfi();

Please move wfi() to a newline.

+}

--
Julien Grall



 


Rackspace

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