From patchwork Thu Dec 6 22:30:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Collin Walling X-Patchwork-Id: 10717139 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 07F6315A6 for ; Thu, 6 Dec 2018 22:30:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2D732EF96 for ; Thu, 6 Dec 2018 22:30:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6FC12EF9D; Thu, 6 Dec 2018 22:30:34 +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 595582EF99 for ; Thu, 6 Dec 2018 22:30:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725945AbeLFWad (ORCPT ); Thu, 6 Dec 2018 17:30:33 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:58352 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725948AbeLFWad (ORCPT ); Thu, 6 Dec 2018 17:30:33 -0500 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id wB6MIt3v039248 for ; Thu, 6 Dec 2018 17:30:31 -0500 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2p7bddbp8d-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 06 Dec 2018 17:30:31 -0500 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 6 Dec 2018 22:30:31 -0000 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 6 Dec 2018 22:30:27 -0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id wB6MUNKA19333372 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 6 Dec 2018 22:30:23 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B7B9AC05E; Thu, 6 Dec 2018 22:30:23 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8CB2EAC05F; Thu, 6 Dec 2018 22:30:23 +0000 (GMT) Received: from collin-ThinkPad-W541.pok.ibm.com (unknown [9.56.58.52]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 6 Dec 2018 22:30:23 +0000 (GMT) From: Collin Walling To: linux-s390@vger.kernel.org, kvm@vger.kernel.org, borntraeger@de.ibm.com, david@redhat.com, cohuck@redhat.com, heiko.carstens@de.ibm.com, schwidefsky@de.ibm.com, frankja@linux.ibm.com Subject: [PATCH v2 0/2] Use DIAG318 to set Control Program Name & Version Codes Date: Thu, 6 Dec 2018 17:30:03 -0500 X-Mailer: git-send-email 2.7.4 X-TM-AS-GCONF: 00 x-cbid: 18120622-0068-0000-0000-0000036D98D8 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00010184; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000270; SDB=6.01127999; UDB=6.00585945; IPR=6.00908131; MB=3.00024517; MTD=3.00000008; XFM=3.00000015; UTC=2018-12-06 22:30:29 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18120622-0069-0000-0000-000046AD9FCF Message-Id: <1544135405-22385-1-git-send-email-walling@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-12-06_08:,, 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=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=758 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812060188 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Changelog RFC -> v1 - set distro_id to 0 for now and will be introduced properly as a follow-on patch with further details wrt its usage - created diag318 union structure to contain CPC data in kvm - removed VCPU_EVENT from diag318 handler (we still see a VM_EVENT) v1 -> v2 - set_cpc now uses kvm_block_all - s/VM_MISC/VM_MACHINE - SCB shadowing / unshadowing of cpnc - added r-b's to patch 1 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 (currently set to 0) 1-byte trailing NULL *The distribution identifier will be introduced as a follow-on patch. 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 kernel cannot support it. The CPNC and CPVC 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 linux version is this guest running?" (CPVC) Collin Walling (2): s390/setup: set control program code via diag 318 s390/kvm: handle diagnose 318 instruction call arch/s390/include/asm/diag.h | 12 ++++++ arch/s390/include/asm/kvm_host.h | 13 +++++- 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 | 21 +++++++++ arch/s390/kvm/diag.c | 12 ++++++ arch/s390/kvm/kvm-s390.c | 92 ++++++++++++++++++++++++++++++++++++++++ arch/s390/kvm/kvm-s390.h | 1 + arch/s390/kvm/vsie.c | 7 +++ drivers/s390/char/sclp.h | 4 +- drivers/s390/char/sclp_early.c | 2 + 12 files changed, 169 insertions(+), 2 deletions(-)