diff options
author | David Hildenbrand <dahi@linux.vnet.ibm.com> | 2016-03-08 06:31:52 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2016-06-20 03:55:08 -0400 |
commit | 4a49443924731823da2e9b3ae9311b74a34e7ed8 (patch) | |
tree | d65b91881e0a62a8e3b8aafdf982e978c46869aa | |
parent | 717c05554afa69a36398a57dac64b95972f138d5 (diff) |
s390/mm: remember the int code for the last gmap fault
For nested virtualization, we want to know if we are handling a protection
exception, because these can directly be forwarded to the guest without
additional checks.
Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: David Hildenbrand <dahi@linux.vnet.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r-- | arch/s390/include/asm/processor.h | 1 | ||||
-rw-r--r-- | arch/s390/mm/fault.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/s390/include/asm/processor.h b/arch/s390/include/asm/processor.h index 94c80b6d031d..8c2922f540f9 100644 --- a/arch/s390/include/asm/processor.h +++ b/arch/s390/include/asm/processor.h | |||
@@ -110,6 +110,7 @@ struct thread_struct { | |||
110 | mm_segment_t mm_segment; | 110 | mm_segment_t mm_segment; |
111 | unsigned long gmap_addr; /* address of last gmap fault. */ | 111 | unsigned long gmap_addr; /* address of last gmap fault. */ |
112 | unsigned int gmap_write_flag; /* gmap fault write indication */ | 112 | unsigned int gmap_write_flag; /* gmap fault write indication */ |
113 | unsigned int gmap_int_code; /* int code of last gmap fault */ | ||
113 | unsigned int gmap_pfault; /* signal of a pending guest pfault */ | 114 | unsigned int gmap_pfault; /* signal of a pending guest pfault */ |
114 | struct per_regs per_user; /* User specified PER registers */ | 115 | struct per_regs per_user; /* User specified PER registers */ |
115 | struct per_event per_event; /* Cause of the last PER trap */ | 116 | struct per_event per_event; /* Cause of the last PER trap */ |
diff --git a/arch/s390/mm/fault.c b/arch/s390/mm/fault.c index b84416c11c43..730e0d3aa840 100644 --- a/arch/s390/mm/fault.c +++ b/arch/s390/mm/fault.c | |||
@@ -419,6 +419,7 @@ static inline int do_exception(struct pt_regs *regs, int access) | |||
419 | if (gmap) { | 419 | if (gmap) { |
420 | current->thread.gmap_addr = address; | 420 | current->thread.gmap_addr = address; |
421 | current->thread.gmap_write_flag = !!(flags & FAULT_FLAG_WRITE); | 421 | current->thread.gmap_write_flag = !!(flags & FAULT_FLAG_WRITE); |
422 | current->thread.gmap_int_code = regs->int_code & 0xffff; | ||
422 | address = __gmap_translate(gmap, address); | 423 | address = __gmap_translate(gmap, address); |
423 | if (address == -EFAULT) { | 424 | if (address == -EFAULT) { |
424 | fault = VM_FAULT_BADMAP; | 425 | fault = VM_FAULT_BADMAP; |