From patchwork Thu Aug 30 16:30:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Hildenbrand X-Patchwork-Id: 10582281 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D4E9613AC for ; Thu, 30 Aug 2018 16:30:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C64A52C12C for ; Thu, 30 Aug 2018 16:30:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C456B2C17A; Thu, 30 Aug 2018 16:30:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74ECF2C172 for ; Thu, 30 Aug 2018 16:30:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727495AbeH3UdZ (ORCPT ); Thu, 30 Aug 2018 16:33:25 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44048 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726674AbeH3UdZ (ORCPT ); Thu, 30 Aug 2018 16:33:25 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 70F7440216FC; Thu, 30 Aug 2018 16:30:28 +0000 (UTC) Received: from t460s.redhat.com (ovpn-117-143.ams2.redhat.com [10.36.117.143]) by smtp.corp.redhat.com (Postfix) with ESMTP id 137FE202704E; Thu, 30 Aug 2018 16:30:26 +0000 (UTC) From: David Hildenbrand To: kvm@vger.kernel.org Cc: Paolo Bonzini , =?utf-8?b?UmFkaW0gS3LEjW3DocWZ?= , Thomas Huth , Christian Borntraeger , Cornelia Huck , Janosch Frank , David Hildenbrand Subject: [kvm-unit-tests PULL 1/5] s390x: user ctl_set/clear_bit for low address protection Date: Thu, 30 Aug 2018 18:30:18 +0200 Message-Id: <20180830163022.12350-2-david@redhat.com> In-Reply-To: <20180830163022.12350-1-david@redhat.com> References: <20180830163022.12350-1-david@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 30 Aug 2018 16:30:28 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 30 Aug 2018 16:30:28 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the provided helper functions now. Reviewed-by: Thomas Huth Reviewed-by: Janosch Frank Signed-off-by: David Hildenbrand --- lib/s390x/asm/interrupt.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/s390x/asm/interrupt.h b/lib/s390x/asm/interrupt.h index b3abd63..013709f 100644 --- a/lib/s390x/asm/interrupt.h +++ b/lib/s390x/asm/interrupt.h @@ -23,21 +23,13 @@ void check_pgm_int_code(uint16_t code); /* Activate low-address protection */ static inline void low_prot_enable(void) { - uint64_t cr0; - - asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory"); - cr0 |= 1ULL << (63-35); - asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0)); + ctl_set_bit(0, 63 - 35); } /* Disable low-address protection */ static inline void low_prot_disable(void) { - uint64_t cr0; - - asm volatile (" stctg %%c0,%%c0,%0 " : : "Q"(cr0) : "memory"); - cr0 &= ~(1ULL << (63-35)); - asm volatile (" lctlg %%c0,%%c0,%0 " : : "Q"(cr0)); + ctl_clear_bit(0, 63 - 35); } #endif