From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 17CB8C2D0B1 for ; Tue, 4 Feb 2020 10:37:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DF31A21582 for ; Tue, 4 Feb 2020 10:37:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="QwdsKWZ0" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726730AbgBDKhx (ORCPT ); Tue, 4 Feb 2020 05:37:53 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:35239 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726364AbgBDKhw (ORCPT ); Tue, 4 Feb 2020 05:37:52 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1580812671; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:openpgp:openpgp; bh=4Ak30yKFdoLowaZ9b4evJ0p34pMH2ElOOZ3YejGiSaE=; b=QwdsKWZ0kcFnXwt9bgqF/n/HHBbGIGnTR34iwyv1BkcyKMz1/7vpCje3DiX+cudoTjIr3U Xt1bHTHYyef7dR3A/RI6WJ1OtmHiL9gFT1HJlmT2mETD2Mg9SSDxcbFdhuQzQckRm9Vrb2 XK5FS6xNSBtp5l1hl+HlhvtQ/JQpirg= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-326-01E_5977OSmefFcojUxSzA-1; Tue, 04 Feb 2020 05:37:49 -0500 X-MC-Unique: 01E_5977OSmefFcojUxSzA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 961FE8010E6; Tue, 4 Feb 2020 10:37:48 +0000 (UTC) Received: from thuth.remote.csb (ovpn-116-39.ams2.redhat.com [10.36.116.39]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 590E65D9CA; Tue, 4 Feb 2020 10:37:44 +0000 (UTC) Subject: Re: [RFCv2 06/37] s390: add (non)secure page access exceptions handlers To: Christian Borntraeger , Janosch Frank Cc: KVM , Cornelia Huck , David Hildenbrand , Ulrich Weigand , Claudio Imbrenda , Andrea Arcangeli References: <20200203131957.383915-1-borntraeger@de.ibm.com> <20200203131957.383915-7-borntraeger@de.ibm.com> From: Thomas Huth Openpgp: preference=signencrypt Message-ID: Date: Tue, 4 Feb 2020 11:37:42 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200203131957.383915-7-borntraeger@de.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Content-Transfer-Encoding: quoted-printable Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 03/02/2020 14.19, Christian Borntraeger wrote: > From: Vasily Gorbik >=20 > Add exceptions handlers performing transparent transition of non-secure > pages to secure (import) upon guest access and secure pages to > non-secure (export) upon hypervisor access. >=20 > Signed-off-by: Vasily Gorbik > Signed-off-by: Janosch Frank > [adding checks for failures] > Signed-off-by: Claudio Imbrenda > [further changes like adding a check for gmap fault] Who did which modification here? According to Documentation/process/submitting-patches.rst the square brackets should go in front of the S-o-b of the person who did the change, e.g.: Signed-off-by: Random J Developer [lucky@maintainer.example.org: struct foo moved from foo.c to foo.h] Signed-off-by: Lucky K Maintainer It would be nice if you could stick to that scheme. > --- > arch/s390/kernel/pgm_check.S | 4 +- > arch/s390/mm/fault.c | 87 ++++++++++++++++++++++++++++++++++++ > 2 files changed, 89 insertions(+), 2 deletions(-) [...] > +void do_non_secure_storage_access(struct pt_regs *regs) > +{ > + unsigned long gaddr =3D regs->int_parm_long & __FAIL_ADDR_MASK; > + struct gmap *gmap =3D (struct gmap *)S390_lowcore.gmap; > + struct uv_cb_cts uvcb =3D { > + .header.cmd =3D UVC_CMD_CONV_TO_SEC_STOR, > + .header.len =3D sizeof(uvcb), > + .guest_handle =3D gmap->se_handle, > + .gaddr =3D gaddr, > + }; > + int rc; > + > + if (get_fault_type(regs) !=3D GMAP_FAULT) { > + do_fault_error(regs, VM_READ | VM_WRITE, VM_FAULT_BADMAP); > + WARN_ON_ONCE(1); > + return; > + } > + > + rc =3D uv_make_secure(gmap, gaddr, &uvcb, 0); > + if (rc =3D=3D -EINVAL && uvcb.header.rc !=3D 0x104) > + send_sig(SIGSEGV, current, 0); > +} What about the other rc beside 0x104 that could happen here? They go unnoticed? Thomas