Received: by 10.223.185.116 with SMTP id b49csp7215127wrg; Thu, 1 Mar 2018 01:38:51 -0800 (PST) X-Google-Smtp-Source: AG47ELvPWu3Ze5Ud81s8KUhYiR3cNxl72kyPpdsrdYybQ/cImso7MUm0GZP0fR5CW4+bQzwPUUez X-Received: by 10.101.86.138 with SMTP id v10mr1025108pgs.353.1519897131615; Thu, 01 Mar 2018 01:38:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519897131; cv=none; d=google.com; s=arc-20160816; b=qt1Yjtnvg0TIAAGDXLayV6lBU7r12ZaJTX2lYc+mYdoX3m9sHM0VUX9LDqonLEVls0 LwBXxpAhNGYsN8vO9JeqUOdmWBcw2zgBgy5FG1c21PG5vLd2WjstfTD7estLFlIRlW4D VQWJXER3nzTTB3o6kAFNl/Xao2wJ0FbqANCS/pKkP6kxuF5zmh7CBAHIMvIj8KNelm7B RkbwD0g8OxqAx7j6fb4PQybT586j2p9J4YcSAPUN3nT2ATL3ziSDbBaoae7u50c0Ivs5 YJApyYofAwWIwaJkkze7RgZTiaWk0gck2u3yzbmHxe44TRk8m63J6FUAiRKDHTwtlkEO yk9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :arc-authentication-results; bh=oFiZRhHhqjK1hCQpLuxWH8wt3/mre31XDWoWK+AAvMg=; b=MH8RQfg6g1POBFEVkaDNeOKDuf7hv6ORl+wzCLo3bCoa2lrDiRAHV2e3FAtDUHArLi bAqqLEamoaB7fkS5TVpe+HbtURlAN1rPxBkDkcA5hcIKN24fK+K04b7wLaYdLiyMA1U1 kYeI4Jfn7/OP+paErkvSDSGw9vXUKeKfrrQ6G8aSR/XLLXEPv9uH68hXsY2TYcpvDAhr PzMjDGWn0GcwylxvnNCAi/u5SJmXm0zIM2UbmidRmd4Psz/maIauFoHjRucWqQKQZa/8 Ae7OSzA3QNWF/RJmLR8pIUN0GLVVYvb28jp8ksclHcL76yhkq30ELbnVv2RUcmTVLF9l Vf4A== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 59-v6si2808484pld.299.2018.03.01.01.38.36; Thu, 01 Mar 2018 01:38:51 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S967061AbeCAJhy (ORCPT + 99 others); Thu, 1 Mar 2018 04:37:54 -0500 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:58924 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S966675AbeCAJhw (ORCPT ); Thu, 1 Mar 2018 04:37:52 -0500 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 621CF4040852; Thu, 1 Mar 2018 09:37:51 +0000 (UTC) Received: from [10.36.116.189] (ovpn-116-189.ams2.redhat.com [10.36.116.189]) by smtp.corp.redhat.com (Postfix) with ESMTP id B4A7F10AF9E4; Thu, 1 Mar 2018 09:37:46 +0000 (UTC) Subject: Re: [PATCH v2 13/15] KVM: s390: Configure the guest's CRYCB To: Tony Krowiak , 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: David Hildenbrand Organization: Red Hat GmbH Message-ID: <081eab40-0bbd-5842-76bc-2974f4544529@redhat.com> Date: Thu, 1 Mar 2018 10:37:46 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 09:37:51 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Thu, 01 Mar 2018 09:37:51 +0000 (UTC) for IP:'10.11.54.3' DOMAIN:'int-mx03.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'david@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 28.02.2018 21:45, Tony Krowiak wrote: > 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. Okay, but from a pure interface point of view, this could happen any time, even while the guest is already running. Patching in the SCB of a running VCPU is evil. But I guess we don't have to worry about that when changing they way we set ECA_APIE, as described in the other mail. -- Thanks, David / dhildenb