From patchwork Thu Jan 10 15:41:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10756091 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 5CE9491E for ; Thu, 10 Jan 2019 15:43:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C6B129AED for ; Thu, 10 Jan 2019 15:43:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 40EF829B07; Thu, 10 Jan 2019 15:43:23 +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 D27F129B06 for ; Thu, 10 Jan 2019 15:43:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729710AbfAJPnW (ORCPT ); Thu, 10 Jan 2019 10:43:22 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:58964 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729661AbfAJPnV (ORCPT ); Thu, 10 Jan 2019 10:43:21 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id x0AFdibH074337 for ; Thu, 10 Jan 2019 10:43:20 -0500 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2px8ebhmc8-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 10 Jan 2019 10:43:20 -0500 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 10 Jan 2019 15:43:18 -0000 Received: from b06cxnps3075.portsmouth.uk.ibm.com (9.149.109.195) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 10 Jan 2019 15:43:15 -0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x0AFhEoH55836870 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 10 Jan 2019 15:43:14 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 77BC1A4060; Thu, 10 Jan 2019 15:43:14 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DD2B3A405F; Thu, 10 Jan 2019 15:43:13 +0000 (GMT) Received: from s38lp20.lnxne.boe (unknown [9.145.49.69]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 10 Jan 2019 15:43:13 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH v5 06/11] s390x: Move common sclp data and functions to sclp.c Date: Thu, 10 Jan 2019 16:41:46 +0100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20190110154151.24233-1-frankja@linux.ibm.com> References: <20190110154151.24233-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19011015-0020-0000-0000-0000030476B0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19011015-0021-0000-0000-000021557B56 Message-Id: <20190110154151.24233-7-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-10_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1901100123 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sclp.c will provide the common functionality in the future and the base memory detection as it is quite small. Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- lib/s390x/sclp-console.c | 20 -------------------- lib/s390x/sclp.c | 20 ++++++++++++++++++++ lib/s390x/sclp.h | 2 +- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/lib/s390x/sclp-console.c b/lib/s390x/sclp-console.c index deacbde..bc01f41 100644 --- a/lib/s390x/sclp-console.c +++ b/lib/s390x/sclp-console.c @@ -13,26 +13,6 @@ #include #include "sclp.h" -char _sccb[PAGE_SIZE] __attribute__((__aligned__(4096))); - -/* Perform service call. Return 0 on success, non-zero otherwise. */ -int sclp_service_call(unsigned int command, void *sccb) -{ - int cc; - - asm volatile( - " .insn rre,0xb2200000,%1,%2\n" /* servc %1,%2 */ - " ipm %0\n" - " srl %0,28" - : "=&d" (cc) : "d" (command), "a" (__pa(sccb)) - : "cc", "memory"); - if (cc == 3) - return -1; - if (cc == 2) - return -1; - return 0; -} - static void sclp_set_write_mask(void) { WriteEventMask *sccb = (void *)_sccb; diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c index cccfdc2..7f556e5 100644 --- a/lib/s390x/sclp.c +++ b/lib/s390x/sclp.c @@ -23,6 +23,8 @@ static uint64_t storage_increment_size; static uint64_t max_ram_size; static uint64_t ram_size; +char _sccb[PAGE_SIZE] __attribute__((__aligned__(4096))); + static void mem_init(phys_addr_t mem_end) { phys_addr_t freemem_start = (phys_addr_t)&stacktop; @@ -50,6 +52,24 @@ static void sclp_read_scp_info(ReadInfo *ri, int length) report_abort("READ_SCP_INFO failed"); } +/* Perform service call. Return 0 on success, non-zero otherwise. */ +int sclp_service_call(unsigned int command, void *sccb) +{ + int cc; + + asm volatile( + " .insn rre,0xb2200000,%1,%2\n" /* servc %1,%2 */ + " ipm %0\n" + " srl %0,28" + : "=&d" (cc) : "d" (command), "a" (__pa(sccb)) + : "cc", "memory"); + if (cc == 3) + return -1; + if (cc == 2) + return -1; + return 0; +} + void sclp_memory_setup(void) { ReadInfo *ri = (void *)_sccb; diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h index 4c60061..583c4e5 100644 --- a/lib/s390x/sclp.h +++ b/lib/s390x/sclp.h @@ -212,9 +212,9 @@ typedef struct ReadEventData { uint32_t mask; } __attribute__((packed)) ReadEventData; +extern char _sccb[]; void sclp_console_setup(void); void sclp_print(const char *str); -extern char _sccb[]; int sclp_service_call(unsigned int command, void *sccb); void sclp_memory_setup(void);