From patchwork Fri Aug 18 11:43:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 803201 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xYhRF2fB0z9t2M for ; Fri, 18 Aug 2017 21:57:45 +1000 (AEST) Received: from localhost ([::1]:46290 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1difuI-0005W6-Py for incoming@patchwork.ozlabs.org; Fri, 18 Aug 2017 07:57:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49395) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1difha-0002Gb-LX for qemu-devel@nongnu.org; Fri, 18 Aug 2017 07:44:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1difhW-0007II-PX for qemu-devel@nongnu.org; Fri, 18 Aug 2017 07:44:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51578) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1difhW-0007HY-Ha for qemu-devel@nongnu.org; Fri, 18 Aug 2017 07:44:30 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6448B80469; Fri, 18 Aug 2017 11:44:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6448B80469 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=david@redhat.com Received: from t460s.redhat.com (ovpn-116-230.ams2.redhat.com [10.36.116.230]) by smtp.corp.redhat.com (Postfix) with ESMTP id 728DB6A75B; Fri, 18 Aug 2017 11:44:27 +0000 (UTC) From: David Hildenbrand To: qemu-devel@nongnu.org Date: Fri, 18 Aug 2017 13:43:46 +0200 Message-Id: <20170818114353.13455-12-david@redhat.com> In-Reply-To: <20170818114353.13455-1-david@redhat.com> References: <20170818114353.13455-1-david@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 18 Aug 2017 11:44:29 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 for-2.11 11/18] target/s390x: move psw_key_valid() to mem_helper.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, cohuck@redhat.com, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , borntraeger@de.ibm.com, Aurelien Jarno , rth@twiddle.net Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Only used in that file. Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand --- target/s390x/cpu.h | 11 ----------- target/s390x/mem_helper.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index c71a4bf..8300cb2 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -366,17 +366,6 @@ void s390x_cpu_debug_excp_handler(CPUState *cs); #define MMU_SECONDARY_IDX 1 #define MMU_HOME_IDX 2 -static inline bool psw_key_valid(CPUS390XState *env, uint8_t psw_key) -{ - uint16_t pkm = env->cregs[3] >> 16; - - if (env->psw.mask & PSW_MASK_PSTATE) { - /* PSW key has range 0..15, it is valid if the bit is 1 in the PKM */ - return pkm & (0x80 >> psw_key); - } - return true; -} - static inline int cpu_mmu_index(CPUS390XState *env, bool ifetch) { switch (env->psw.mask & PSW_MASK_ASC) { diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index c71dce4..b91c740 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -56,6 +56,17 @@ void tlb_fill(CPUState *cs, target_ulong addr, MMUAccessType access_type, #define HELPER_LOG(x...) #endif +static inline bool psw_key_valid(CPUS390XState *env, uint8_t psw_key) +{ + uint16_t pkm = env->cregs[3] >> 16; + + if (env->psw.mask & PSW_MASK_PSTATE) { + /* PSW key has range 0..15, it is valid if the bit is 1 in the PKM */ + return pkm & (0x80 >> psw_key); + } + return true; +} + /* Reduce the length so that addr + len doesn't cross a page boundary. */ static inline uint32_t adj_len_to_page(uint32_t len, uint64_t addr) {