diff mbox

[kvm-unit-tests,v3,09/11] s390x: enable DAT in PGM interrupt handler

Message ID 20180213162321.20522-10-david@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

David Hildenbrand Feb. 13, 2018, 4:23 p.m. UTC
Configure it in setup_vm().

Signed-off-by: David Hildenbrand <david@redhat.com>
---
 lib/s390x/mmu.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/lib/s390x/mmu.c b/lib/s390x/mmu.c
index f0ec7c3..288f835 100644
--- a/lib/s390x/mmu.c
+++ b/lib/s390x/mmu.c
@@ -30,6 +30,7 @@  void configure_dat(int enable)
 
 static void mmu_enable(pgd_t *pgtable)
 {
+	struct lowcore *lc = NULL;
 	const uint64_t asce = __pa(pgtable) | ASCE_DT_REGION1 |
 			      REGION_TABLE_LENGTH;
 
@@ -39,6 +40,9 @@  static void mmu_enable(pgd_t *pgtable)
 
 	/* enable dat (primary == 0 set as default) */
 	configure_dat(1);
+
+	/* we can now also use DAT unconditionally in our PGM handler */
+	lc->pgm_new_psw.mask |= PSW_MASK_DAT;
 }
 
 static pteval_t *get_pte(pgd_t *pgtable, uintptr_t vaddr)