Handle spurious page faults due to break-before-make.
Also adding test that triggers spurious faults and fails without this
fix, but passes with it.
Change-Id: I30c591d87c5278a8bb4ed4ec992544f751204d90
diff --git a/inc/hf/cpu.h b/inc/hf/cpu.h
index 3b90b13..4812abf 100644
--- a/inc/hf/cpu.h
+++ b/inc/hf/cpu.h
@@ -68,6 +68,14 @@
bool force;
};
+struct vcpu_fault_info {
+ ipaddr_t ipaddr;
+ vaddr_t vaddr;
+ vaddr_t pc;
+ int mode;
+ uint8_t size;
+};
+
struct vcpu {
struct spinlock lock;
enum vcpu_state state;
@@ -127,3 +135,6 @@
void vcpu_on(struct vcpu *vcpu);
void vcpu_off(struct vcpu *vcpu);
size_t vcpu_index(const struct vcpu *vcpu);
+
+bool vcpu_handle_page_fault(const struct vcpu *current,
+ struct vcpu_fault_info *f);