From patchwork Fri Aug 31 16:51:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Collin Walling X-Patchwork-Id: 10584205 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 E90725A4 for ; Fri, 31 Aug 2018 16:51:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D779D2B615 for ; Fri, 31 Aug 2018 16:51:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C9ADE2BE44; Fri, 31 Aug 2018 16:51:45 +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 3F0A82B615 for ; Fri, 31 Aug 2018 16:51:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727793AbeHaVAF (ORCPT ); Fri, 31 Aug 2018 17:00:05 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52694 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727328AbeHaVAF (ORCPT ); Fri, 31 Aug 2018 17:00:05 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w7VGoVo1139766 for ; Fri, 31 Aug 2018 12:51:42 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0a-001b2d01.pphosted.com with ESMTP id 2m76ugybp7-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 31 Aug 2018 12:51:42 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 31 Aug 2018 10:51:41 -0600 Received: from b03cxnp08026.gho.boulder.ibm.com (9.17.130.18) by e34.co.us.ibm.com (192.168.1.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Fri, 31 Aug 2018 10:51:39 -0600 Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w7VGpY0T40239324 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Aug 2018 09:51:35 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CFAA26E053; Fri, 31 Aug 2018 10:51:34 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2BAFD6E04C; Fri, 31 Aug 2018 10:51:34 -0600 (MDT) Received: from collin-ThinkPad-W541.pok.ibm.com (unknown [9.56.58.24]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP; Fri, 31 Aug 2018 10:51:33 -0600 (MDT) From: Collin Walling To: linux-s390@vger.kernel.org, kvm@vger.kernel.org Cc: borntraeger@de.ibm.com, david@redhat.com, heiko.carstens@de.ibm.com, cohuck@redhat.com, frankja@linux.ibm.com, schwidefsky@de.ibm.com, alifm@linux.ibm.com Subject: [RFC PATCH 0/3] Use DIAG318 to set Control Program Name & Version Codes Date: Fri, 31 Aug 2018 12:51:16 -0400 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18083116-0016-0000-0000-00000925485A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009645; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000266; SDB=6.01081586; UDB=6.00558004; IPR=6.00861572; MB=3.00023038; MTD=3.00000008; XFM=3.00000015; UTC=2018-08-31 16:51:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18083116-0017-0000-0000-000040317BEB Message-Id: <1535734279-10204-1-git-send-email-walling@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-31_07:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=865 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1808310171 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A new diagnose instruction, 318, allows the kernel to set an 8-byte "Control Program Code" (CPC) that is composed of: 1-byte Control Program Name Code (CPNC) 7-byte Control Program Version Code (CPVC) composed of: 3-bytes for Linux Kernel version (determined at build-time) 3-bytes for Distribution Identifier (referred to as distro_id; set by Kconfig option) 1-byte trailing NULL Note about distro_id: [ The initial idea for the 3-byte distro_id is for each distribution to set three characters that correspond to their distribution name (for a theoretical distributor "ACME," they could set "ACM" as the distro_id). A registry file could be included in the s390 kernel documentation to avoid name collisions. ] This instruction call is executed once-and-only-once during Kernel setup. The availability of this instruction depends on Read SCP Info byte 134, bit 0. Diagnose318's functionality is also emulated by KVM, which means we can enable this feature for a guest even if the host cannot support it. Also introduced with this patchset is a Host Program Identifier (HPID), which denotes the underlying host environment. The CPC and HPID are used for problem diagnosis and allows IBM to identify control program information by answering the following questions: "What environment is this guest running in?" (CPNC) "What distribution is this guest running?" (CPVC) "What underlying host environment is this guest running on?" (HPID) Please note: I will be returning to the office on Thursday (9/6). Collin Walling (3): s390/setup: set control program code via diag 318 s390/kvm: handle diagnose 318 instruction call s390/kvm: set host program identifier arch/s390/Kconfig | 8 +++ arch/s390/include/asm/diag.h | 12 +++++ arch/s390/include/asm/kvm_host.h | 12 ++++- arch/s390/include/asm/sclp.h | 1 + arch/s390/include/uapi/asm/kvm.h | 5 ++ arch/s390/kernel/diag.c | 1 + arch/s390/kernel/setup.c | 23 +++++++++ arch/s390/kvm/diag.c | 16 ++++++ arch/s390/kvm/kvm-s390.c | 92 ++++++++++++++++++++++++++++++++++ arch/s390/kvm/kvm-s390.h | 1 + arch/s390/kvm/vsie.c | 2 + drivers/s390/char/sclp_early.c | 6 ++- tools/arch/s390/include/uapi/asm/kvm.h | 1 + 13 files changed, 177 insertions(+), 3 deletions(-)