From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Hildenbrand Subject: [PATCH kvm-unit-tests v2 09/11] s390x: enable DAT in PGM interrupt handler Date: Fri, 12 Jan 2018 15:34:15 +0100 Message-ID: <20180112143417.16743-10-david@redhat.com> References: <20180112143417.16743-1-david@redhat.com> Cc: Paolo Bonzini , =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= , Thomas Huth , Christian Borntraeger , Cornelia Huck , David Hildenbrand To: kvm@vger.kernel.org Return-path: Received: from mx1.redhat.com ([209.132.183.28]:35438 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933810AbeALOgW (ORCPT ); Fri, 12 Jan 2018 09:36:22 -0500 In-Reply-To: <20180112143417.16743-1-david@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Configure it in setup_vm(). Signed-off-by: David Hildenbrand --- lib/s390x/asm/arch_def.h | 2 ++ lib/s390x/mmu.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h index f934120..ac3754e 100644 --- a/lib/s390x/asm/arch_def.h +++ b/lib/s390x/asm/arch_def.h @@ -15,6 +15,8 @@ struct psw { uint64_t addr; }; +#define PSW_MASK_DAT 0x0400000000000000UL + struct lowcore { uint8_t pad_0x0000[0x0080 - 0x0000]; /* 0x0000 */ uint32_t ext_int_param; /* 0x0080 */ diff --git a/lib/s390x/mmu.c b/lib/s390x/mmu.c index 9febb18..be0358f 100644 --- a/lib/s390x/mmu.c +++ b/lib/s390x/mmu.c @@ -47,6 +47,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; @@ -56,6 +57,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) -- 2.14.3