The implementation was backwards and checked that the guest could
read when asked about write and vice versa.
This is an update to the fix for XSA-98.
Reported-by: Tamas K Lengyel <tklengyel@sec.in.tum.de>
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
uint64_t par, tmp = READ_SYSREG64(PAR_EL1);
if ( (flags & GV2M_WRITE) == GV2M_WRITE )
- asm volatile ("at s12e1r, %0;" : : "r" (va));
- else
asm volatile ("at s12e1w, %0;" : : "r" (va));
+ else
+ asm volatile ("at s12e1r, %0;" : : "r" (va));
isb();
par = READ_SYSREG64(PAR_EL1);
WRITE_SYSREG64(tmp, PAR_EL1);