fix(VHE): Fix Instr/Data abort handling for EL0

This patch fixes instruction abort handling for EL0 partitions. When
there is an instruction abort on a writeable page, the partition must
not be resumed since SCTLR_WXN bit is set, making any writeable page not
executable. This is however fixed in architecture agnostic code since
WXN is common across most architectures.
This patch also fixes data abort handling on unaligned accesses, on
AArch64. This cannot be fixed in architecture agnostic code since the
syndrome for unaligned accesses vary by architecture.

Signed-off-by: Raghu Krishnamurthy <raghu.ncstate@gmail.com>
Change-Id: I4d7c0ba34c5dedcf1b9d8224da58fdaee7daadb7
diff --git a/src/vcpu.c b/src/vcpu.c
index 2c79ae5..6ac811b 100644
--- a/src/vcpu.c
+++ b/src/vcpu.c
@@ -164,6 +164,16 @@
 					ipa_add(ipa_init(va_addr(f->vaddr)), 1),
 					&mode) &&
 			(mode & mask) == f->mode;
+
+		/*
+		 * For EL0 partitions, if there is an instruction abort and the
+		 * mode of the page is RWX, we don't resume since Hafnium does
+		 * not allow write and executable pages.
+		 */
+		if ((f->mode == MM_MODE_X) &&
+		    ((mode & MM_MODE_W) == MM_MODE_W)) {
+			resume = false;
+		}
 	}
 
 	vm_unlock(&locked_vm);