Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp378127pxb; Thu, 17 Feb 2022 06:10:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJwgP/UpcEmG4B6L+0hwwsbyvIAtZcFEZrQzDynze4qO8Bj2V83ybcZ/wgfykOzPbhhFzEKt X-Received: by 2002:a63:f20:0:b0:364:db94:67f with SMTP id e32-20020a630f20000000b00364db94067fmr2563297pgl.310.1645107012033; Thu, 17 Feb 2022 06:10:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645107012; cv=none; d=google.com; s=arc-20160816; b=v3JYlDoLPD3YsIL70zs8TCQx9UurqmYO9qhSBTncvrPfurnbUIt4o/LGnAgmojM+lF u21JjP2AHbIIsi5PeAX1Jv6UzlBDZrxQ843WJezBHilO8F4ilNCwQcWGV7HCVdqpIl7w gcSUBuVtSyGVoDemx18UJiaOJApbkNor1PSVl0sLzZ9VdDCmzQ2wBp7B97ny5AoNA6v+ iWCMJLBXtkCSF665PAqf/Qb1UMWq8+OKlD2tueRDVcA3IjfjgR/fhCkgbE0F6a4x3bNo n9CK3ZVRp3kL8b+QfjZ578TfntkXd09CDqjWjMSbshkeOZIpGIUo1p1Zy5EcUq3rkHpx xkNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:to:from:dkim-signature; bh=jgMzF4Ni0eGA4OONPUhvtPkYyU4OFQyeFoXgK5Tg20U=; b=QLesHvMiUUFmI5qpqCHJSYuolQSPzK+/kIA9kTpwPAXlHwTnl26lnIsW73cYk1fVXK A3khuZtgF5jpWmWZ1LX7wDnMUrjNYcg111QjYwZW0oiuQG+gJCRhm2fFaZhsdc4MRCrl 2AfoKGSSlmLumP2MmZijEEh9W965m0g6yRX7Rt5jIUkm/RuaE96gDsE8RmB8KvVIB9r1 K1PZHLSMTkVhDfEaXkSL67KMHOycTBVPb/WB8T4RhGhOUn+Pg97fuKY5PYQTwHe7PSzg QLofXPWuo1V2MJt76L5Qt6NS4j3wm9w9CQj93eHLlH7Cp/Vk9QkaY06dTA8uTvT9N2Ul WuoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tGE8je2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7si8344071pgh.848.2022.02.17.06.09.56; Thu, 17 Feb 2022 06:10:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tGE8je2I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235158AbiBQLhx (ORCPT + 99 others); Thu, 17 Feb 2022 06:37:53 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:45744 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239924AbiBQLhm (ORCPT ); Thu, 17 Feb 2022 06:37:42 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E83E01B78C; Thu, 17 Feb 2022 03:37:27 -0800 (PST) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 21HABvwT000795; Thu, 17 Feb 2022 11:37:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : subject : date : message-id : mime-version : content-transfer-encoding; s=pp1; bh=jgMzF4Ni0eGA4OONPUhvtPkYyU4OFQyeFoXgK5Tg20U=; b=tGE8je2ID/YxryhRGpHw3J7Ym8YUcRI89XA1FEREeC5uRS3ACPd8/zToo1oZvRWKu2/b OstLyWhu7eNCAcn2h458OWLbMHuEtzI6TepslUOb2G8WdrOYLQZcB7rgCXX6+PZdv5dh 8POzQOUyfKFpShblPwbJ9pLzESJ6jCcABL1s2QJJZyz8QLxJfKm+0kLWAJt2yjscfrHe +vkx6EAn8zDooKGLfq3A2LLli7J0Om1ShVqQ43zxXwr/T7nYUei/rdaejVyqTnpnZVmE s1rCUCyPDUamb5s1m2VdzLEZrgaMg209GDJSzs/4xpOoNZBn5E2TtSwcO9yquAyMcxFJ 1g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3e9m1ntcv8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Feb 2022 11:37:24 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 21HBLLjF004332; Thu, 17 Feb 2022 11:37:24 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com with ESMTP id 3e9m1ntcua-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Feb 2022 11:37:24 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 21HBZnDa028358; Thu, 17 Feb 2022 11:37:22 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma01fra.de.ibm.com with ESMTP id 3e64h9y5dp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 17 Feb 2022 11:37:22 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 21HBbJVp35258876 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 17 Feb 2022 11:37:19 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 595775204E; Thu, 17 Feb 2022 11:37:19 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.12.92]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 225035207A; Thu, 17 Feb 2022 11:37:18 +0000 (GMT) From: Steffen Eiden To: Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Alexander Gordeev , Janosch Frank , David Hildenbrand , Claudio Imbrenda , Shuah Khan , linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org, linux-kselftest@vger.kernel.org Subject: [PATCH 0/3] s390: Ultravisor device Date: Thu, 17 Feb 2022 06:37:14 -0500 Message-Id: <20220217113717.46624-1-seiden@linux.ibm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Zidn7y2A38B8FfZYnNEis0TV6ue8XLMG X-Proofpoint-ORIG-GUID: TwY6zA9qN2bj8on8Z4-ELGKhwyJ5UhIJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-02-17_04,2022-02-17_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 lowpriorityscore=0 mlxlogscore=999 impostorscore=0 mlxscore=0 suspectscore=0 adultscore=0 bulkscore=0 clxscore=1011 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202170051 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This series adds an Ultravisor(UV) device letting the userspace send some Ultravisor calls to the UV. Currently two calls are supported. Query Ultravisor Information (QUI) and Receive Attestation Measurement (Attest[ation]). The UV device is implemented as a miscdevice accepting only IOCTLs. The IOCTL cmd specifies the UV call and the IOCTL arg the request and response data depending on the UV call. The device driver writes the UV response in the ioctl argument data. The 'uvdevice' does no checks on the request beside faulty userspace addresses, if sizes are in a sane range before allocating in kernel space, and other tests that prevent the system from corruption. Especially, no checks are made, that will be performed by the UV anyway (E.g. 'invalid command' in case of attestation on unsupported hardware). These errors are reported back to Userspace using the UV return code field. Steffen Eiden (3): drivers/s390/char: Add Ultravisor io device drivers/s390/char: Add Ultravisor attestation to uvdevice selftests: drivers/s390x: Add uvdevice tests MAINTAINERS | 3 + arch/s390/include/asm/uv.h | 23 +- arch/s390/include/uapi/asm/uvdevice.h | 46 +++ drivers/s390/char/Kconfig | 9 + drivers/s390/char/Makefile | 1 + drivers/s390/char/uvdevice.c | 325 ++++++++++++++++++ tools/testing/selftests/Makefile | 1 + tools/testing/selftests/drivers/.gitignore | 1 + .../selftests/drivers/s390x/uvdevice/Makefile | 22 ++ .../selftests/drivers/s390x/uvdevice/config | 1 + .../drivers/s390x/uvdevice/test_uvdevice.c | 280 +++++++++++++++ 11 files changed, 711 insertions(+), 1 deletion(-) create mode 100644 arch/s390/include/uapi/asm/uvdevice.h create mode 100644 drivers/s390/char/uvdevice.c create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/Makefile create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/config create mode 100644 tools/testing/selftests/drivers/s390x/uvdevice/test_uvdevice.c -- 2.25.1