On 10.07.2025 02:35, Stefano Stabellini wrote: > On Wed, 9 Jul 2025, Jan Beulich wrote: >>> What fine grained deviation do you have in mind? >> >> Ones for almost(?) everything that is having actual code changes right now >> in this series. > > We could easily deviate alternative.c based on the file name alone. But > for the rest: > > emulate.c: casts from unsigned char* (byte aligned) to uint64_t* (8 bytes > aligned)
This one may indeed be fine to patch. > vlapic.h: casts from uint8_t* (byte aligned) to uint32_t* (4 bytes aligned) These only give the impression of increasing alignment. struct hvm_hw_lapic_regs is containing solely an uint8_t[1024] array, and all instances (created from vlapic_init()) actually end up at page boundaries. What I don't know is whether adding __aligned(PAGE_SIZE) to the struct vlapic field declaration would convince Eclair of there being no issue here. Probably not, as the array index used in both of the accesses isn't known (to it) to be 16-byte aligned. > setup.c: games with symbols The change here may again be acceptable; better may be to use memchr_inv() there, as being less obfuscating _and_ eliminating the cast there altogether. > iommu_init.c: cast from uint32_t* (4 bytes aligned) to uint64_t* (8 bytes > aligned) This imo would better be done by reconstructing the 64-bit value from the two involved 32-bit array elements. > How would you deviate these in general terms? Or are you suggesting to > use SAF tags for each of them? If no other solution can be found for the vlapic.h issue, "yes" there. For all others I suggested alternative approaches. Subject to other x86 folks possibly objecting, though. Jan