Received: by 10.223.185.116 with SMTP id b49csp6635745wrg; Wed, 28 Feb 2018 12:47:22 -0800 (PST) X-Google-Smtp-Source: AH8x226ic3tijcuG36cZ4NSUwkgMseQtiOsXP74Gf756EYwjm8bTN89hfINx3HQBTuE+VDchutll X-Received: by 10.99.154.73 with SMTP id e9mr14879324pgo.26.1519850842197; Wed, 28 Feb 2018 12:47:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519850842; cv=none; d=google.com; s=arc-20160816; b=NNuIBXVkhm5bT7pXB5WsBmX+CgW3pB0eHMiedwSYcAcE5c8GnH2zW7NdgekEUllSVw Dyvv7BWgUntAj2eetvdeoEjLDEWuRjcmexuSJu0FpzG/sFxOg4sbuakV5HDnqHth0ktY Kj5bnM93ktKld4H8/f6y8zUWrJ0dgH8e0Mm7fhntLiJkXcQUEHUrEHc3xtXvxeMUpZet JhjEPDzFqEilPZSaFsWuCy5c6Eoj9CKIGiGNTAFELo9sr6HsmXzbCRd44T++uLb376qr JAn9gJOfggM4nseY/+yuH9AcdkNqTlFA9vWZpKynfsAJ16Rd7iKiLBFQmlIHCfGWpoli drPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:arc-authentication-results; bh=XklJXWZaKyi+g6uh+ZbMq+KUOc/E8lN8khTaqE5LcTk=; b=JLv3t1T5+A7wpx4SA9T0hJalxLVlp4HiUKjZKryc/RuSy8kPflFU3Y6YWIQW+vSJjn Pg6paiePiEtQH6kI/Gdb/mC+wuDHWO6D36gNRFrroXI8ytsJv5nApBjK66vpqfispy0m li2YzCCQjTEbaRI1k2Tf9ddVWd5CKDDo28/9CmBrTk3v7OhyWOwJPc4+P/9H+18x8Xqo ixH59FtCzh2pMQ/PNko1Fpsop1uwwHV/Y00zw+BvMD7WOi2igJY0cLC5XKub6BkV5LXC 1GQ45jh8B9Z+iggJ4l3qez42qY41gbABKnhF5Yv9eQrBvVMp695IUZ6UWKqamTZuEZAK 483g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x20si1467411pgv.227.2018.02.28.12.47.05; Wed, 28 Feb 2018 12:47:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934755AbeB1UqE (ORCPT + 99 others); Wed, 28 Feb 2018 15:46:04 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:52232 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S934726AbeB1UqC (ORCPT ); Wed, 28 Feb 2018 15:46:02 -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 w1SKhiLn021655 for ; Wed, 28 Feb 2018 15:46:02 -0500 Received: from e18.ny.us.ibm.com (e18.ny.us.ibm.com [129.33.205.208]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ge29x3j6y-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 28 Feb 2018 15:46:02 -0500 Received: from localhost by e18.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 28 Feb 2018 15:46:01 -0500 Received: from b01cxnp23034.gho.pok.ibm.com (9.57.198.29) by e18.ny.us.ibm.com (146.89.104.205) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 28 Feb 2018 15:45:58 -0500 Received: from b01ledav005.gho.pok.ibm.com (b01ledav005.gho.pok.ibm.com [9.57.199.110]) by b01cxnp23034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w1SKjv7Y44957828; Wed, 28 Feb 2018 20:45:57 GMT Received: from b01ledav005.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E776DAE043; Wed, 28 Feb 2018 15:47:20 -0500 (EST) Received: from oc8043147753.ibm.com (unknown [9.60.75.238]) by b01ledav005.gho.pok.ibm.com (Postfix) with ESMTP id 042F0AE03C; Wed, 28 Feb 2018 15:47:19 -0500 (EST) Subject: Re: [PATCH v2 13/15] KVM: s390: Configure the guest's CRYCB To: David Hildenbrand , linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: freude@de.ibm.com, schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, borntraeger@de.ibm.com, cohuck@redhat.com, kwankhede@nvidia.com, bjsdjshi@linux.vnet.ibm.com, pbonzini@redhat.com, alex.williamson@redhat.com, pmorel@linux.vnet.ibm.com, alifm@linux.vnet.ibm.com, mjrosato@linux.vnet.ibm.com, jjherne@linux.vnet.ibm.com, thuth@redhat.com, pasic@linux.vnet.ibm.com, fiuczy@linux.vnet.ibm.com, buendgen@de.ibm.com References: <1519741693-17440-1-git-send-email-akrowiak@linux.vnet.ibm.com> <1519741693-17440-14-git-send-email-akrowiak@linux.vnet.ibm.com> <99b24fc7-3df9-6620-d1df-917214fbdda2@redhat.com> From: Tony Krowiak Date: Wed, 28 Feb 2018 15:45:56 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: <99b24fc7-3df9-6620-d1df-917214fbdda2@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18022820-0044-0000-0000-000003EC233D X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008603; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000254; SDB=6.00996465; UDB=6.00506591; IPR=6.00775788; MB=3.00019783; MTD=3.00000008; XFM=3.00000015; UTC=2018-02-28 20:46:01 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18022820-0045-0000-0000-0000081C2360 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-02-28_11:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1802280252 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/28/2018 04:49 AM, David Hildenbrand wrote: >> +static int vfio_ap_mdev_open(struct mdev_device *mdev) >> +{ >> + struct ap_matrix_mdev *matrix_mdev = mdev_get_drvdata(mdev); >> + unsigned long events; >> + int ret; >> + >> + matrix_mdev->group_notifier.notifier_call = vfio_ap_mdev_group_notifier; >> + events = VFIO_GROUP_NOTIFY_SET_KVM; >> + ret = vfio_register_notifier(mdev_dev(mdev), VFIO_GROUP_NOTIFY, >> + &events, &matrix_mdev->group_notifier); >> + >> + ret = kvm_ap_configure_matrix(matrix_mdev->kvm, >> + matrix_mdev->matrix); >> + if (ret) >> + return ret; >> + >> + ret = kvm_ap_enable_ie_mode(matrix_mdev->kvm); > Can't this happen while the guest is already running? Or what hinders us > from doing that? I'm not sure exactly what you're asking here. Are you asking if the vfio_ap_mdev_open() function can be called multiple times while the guest is running? AFAIK this will be called only once when the mediated device's file descriptor is opened. This happens in QEMU when the -device vfio-ap device is realized. > >> + >> + return ret; >> +} >> + >> +static void vfio_ap_mdev_release(struct mdev_device *mdev) > Thanks, > > David / dhildenb >