Thread (15 messages) 15 messages, 5 authors, 2023-07-22

Re: [PATCH v4 5/9] virt: geniezone: Add irqfd support

From: "Arnd Bergmann" <arnd@arndb.de>
Date: 2023-06-27 09:30:22
Also in: linux-arch, linux-doc, lkml

On Fri, Jun 9, 2023, at 10:52, Yi-De Wu wrote:
quoted hunk ↗ jump to hunk
 /**
  * gzvm_hypercall_wrapper()
@@ -72,6 +73,11 @@ static inline gzvm_vcpu_id_t 
get_vcpuid_from_tuple(unsigned int tuple)
 	return (gzvm_vcpu_id_t)(tuple & 0xffff);
 }

+struct gzvm_vcpu_hwstate {
+	__u32 nr_lrs;
+	__u64 lr[GIC_V3_NR_LRS];
+};
This is not a good definition for a hardware data structure, as there
is architecture specific implicit padding between the two members.

Better add an explicit '__u32 __pad;' in the middle to make it clear
what the actual layout is and make it portable.

If this is an interface to the hypervisor, it should probably also
use explicit endianess, using __le32 and __le64 instead of __u32
and __u64, along with the corresponding accessors.

      Arnd

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help