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 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F2A8BC433EF for ; Tue, 10 May 2022 13:34:16 +0000 (UTC) Received: from localhost ([::1]:56582 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noQ0F-0003ot-Qr for qemu-devel@archiver.kernel.org; Tue, 10 May 2022 09:34:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noPyi-0002tq-CZ; Tue, 10 May 2022 09:32:40 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:6368) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noPyg-0008VQ-4W; Tue, 10 May 2022 09:32:40 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 24ACg5re011452; Tue, 10 May 2022 13:32:35 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : from : subject : to : cc : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pp1; bh=C9x8kPI51BlNt0L/t0keAZmm6C7oleFFanaKozDqwGk=; b=eU9AJItgXxsoVliTuOcZ5EzTrH8oKuFjHdi5EU/AL4bGAobmx3jh5wqhtFFQASZ/48Yn fTYRI7yePTh1TRPPMH/kTPL95rgLzbZlZD/Mg8ilvwvIbxOpzyZNJcz9vaX3xgpSgs7Q NdJtGRwUW9Vvmwf4GLg9JBs8rLel0ro6HJtwiXa+wbkTduG+5S4PMpQQVAigWjGTi3/g SfcT5sH6u9yTG6FwD8kqsFQKJSzy8PFi0T/HWgcCxIHvJmDyNm/O2yu8XxXMYZKImnz4 fjqgOWIJFOVkv2WaXfmURPXCjIuVqFIs7Yu7dAyFN9i7+/+X7nwcDFqqPbKd1ZVAltNo Qw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fync6vvma-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 13:32:35 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 24ADQv2x039488; Tue, 10 May 2022 13:32:34 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3fync6vvku-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 13:32:34 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 24ADCUjN013779; Tue, 10 May 2022 13:32:32 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma02fra.de.ibm.com with ESMTP id 3fwgd8u7ay-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 10 May 2022 13:32:32 +0000 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 24ADItjQ54329802 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 10 May 2022 13:18:55 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4D1A3A4051; Tue, 10 May 2022 13:32:29 +0000 (GMT) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC984A404D; Tue, 10 May 2022 13:32:28 +0000 (GMT) Received: from [9.171.47.179] (unknown [9.171.47.179]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 10 May 2022 13:32:28 +0000 (GMT) Message-ID: Date: Tue, 10 May 2022 15:32:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 From: Janis Schoetterl-Glausch Subject: Re: [PATCH 0/2] s390x: kvm: Honor storage keys during emulation To: Cornelia Huck , qemu-s390x@nongnu.org, Christian Borntraeger , Halil Pasic Cc: "Michael S. Tsirkin" , Paolo Bonzini , David Hildenbrand , Thomas Huth , qemu-devel@nongnu.org, Matthew Rosato References: <20220506153956.2217601-1-scgl@linux.ibm.com> <87o8073zae.fsf@redhat.com> Content-Language: en-US In-Reply-To: <87o8073zae.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mo2tqfW4frgUsv_v28_aZOuJX1_CTLtS X-Proofpoint-ORIG-GUID: 2dX9ffy2ngUvtR7DiCPTwZTHTnqWGSpG Content-Transfer-Encoding: 7bit X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.858,Hydra:6.0.486,FMLib:17.11.64.514 definitions=2022-05-10_01,2022-05-10_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 bulkscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 mlxscore=0 malwarescore=0 spamscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2205100060 Received-SPF: pass client-ip=148.163.158.5; envelope-from=scgl@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 5/9/22 10:06, Cornelia Huck wrote: > On Fri, May 06 2022, Janis Schoetterl-Glausch wrote: > >> Make use of the storage key support of the MEMOP ioctl, if available, >> in order to support storage key checking during emulation. >> >> I did not update all the headers, since that broke the build, >> not sure what the best way of dealing with that is. > > Yeah, the vfio change is expected to break the build; the fix should be > easy (simple rename), and the code affected is deprecated anyway (there > hasn't been any upstream implementation that actually exposed the > interfaces). I think we should do that in a single commit to preserve > bisectability; I have not seen any patches posted yet to actually use > the new vfio migration interface, so a simple compile fixup should be > all that is needed. So basically this patch (pasted below) https://lore.kernel.org/qemu-devel/20220404181726.60291-3-mjrosato@linux.ibm.com/ squashed with the updated headers. Subject: [PATCH v5 2/9] vfio: tolerate migration protocol v1 uapi renames Date: Mon, 4 Apr 2022 14:17:19 -0400 [thread overview] Message-ID: <20220404181726.60291-3-mjrosato@linux.ibm.com> (raw) In-Reply-To: <20220404181726.60291-1-mjrosato@linux.ibm.com> The v1 uapi is deprecated and will be replaced by v2 at some point; this patch just tolerates the renaming of uapi fields to reflect v1 / deprecated status. Signed-off-by: Matthew Rosato --- hw/vfio/common.c | 2 +- hw/vfio/migration.c | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/hw/vfio/common.c b/hw/vfio/common.c index 080046e3f5..7b1e12fb69 100644 --- a/hw/vfio/common.c +++ b/hw/vfio/common.c @@ -380,7 +380,7 @@ static bool vfio_devices_all_running_and_saving(VFIOContainer *container) return false; } - if ((migration->device_state & VFIO_DEVICE_STATE_SAVING) && + if ((migration->device_state & VFIO_DEVICE_STATE_V1_SAVING) && (migration->device_state & VFIO_DEVICE_STATE_RUNNING)) { continue; } else { diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c index ff6b45de6b..e109cee551 100644 --- a/hw/vfio/migration.c +++ b/hw/vfio/migration.c @@ -432,7 +432,7 @@ static int vfio_save_setup(QEMUFile *f, void *opaque) } ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_MASK, - VFIO_DEVICE_STATE_SAVING); + VFIO_DEVICE_STATE_V1_SAVING); if (ret) { error_report("%s: Failed to set state SAVING", vbasedev->name); return ret; @@ -532,7 +532,7 @@ static int vfio_save_complete_precopy(QEMUFile *f, void *opaque) int ret; ret = vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_RUNNING, - VFIO_DEVICE_STATE_SAVING); + VFIO_DEVICE_STATE_V1_SAVING); if (ret) { error_report("%s: Failed to set state STOP and SAVING", vbasedev->name); @@ -569,7 +569,7 @@ static int vfio_save_complete_precopy(QEMUFile *f, void *opaque) return ret; } - ret = vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_SAVING, 0); + ret = vfio_migration_set_state(vbasedev, ~VFIO_DEVICE_STATE_V1_SAVING, 0); if (ret) { error_report("%s: Failed to set state STOPPED", vbasedev->name); return ret; @@ -730,7 +730,7 @@ static void vfio_vmstate_change(void *opaque, bool running, RunState state) * start saving data. */ if (state == RUN_STATE_SAVE_VM) { - value = VFIO_DEVICE_STATE_SAVING; + value = VFIO_DEVICE_STATE_V1_SAVING; } else { value = 0; } @@ -768,8 +768,9 @@ static void vfio_migration_state_notifier(Notifier *notifier, void *data) case MIGRATION_STATUS_FAILED: bytes_transferred = 0; ret = vfio_migration_set_state(vbasedev, - ~(VFIO_DEVICE_STATE_SAVING | VFIO_DEVICE_STATE_RESUMING), - VFIO_DEVICE_STATE_RUNNING); + ~(VFIO_DEVICE_STATE_V1_SAVING | + VFIO_DEVICE_STATE_RESUMING), + VFIO_DEVICE_STATE_RUNNING); if (ret) { error_report("%s: Failed to set state RUNNING", vbasedev->name); } @@ -864,8 +865,10 @@ int vfio_migration_probe(VFIODevice *vbasedev, Error **errp) goto add_blocker; } - ret = vfio_get_dev_region_info(vbasedev, VFIO_REGION_TYPE_MIGRATION, - VFIO_REGION_SUBTYPE_MIGRATION, &info); + ret = vfio_get_dev_region_info(vbasedev, + VFIO_REGION_TYPE_MIGRATION_DEPRECATED, + VFIO_REGION_SUBTYPE_MIGRATION_DEPRECATED, + &info); if (ret) { goto add_blocker; } > >> >> Janis Schoetterl-Glausch (2): >> Pull in MEMOP changes in linux-headers >> target/s390x: kvm: Honor storage keys during emulation >> >> linux-headers/linux/kvm.h | 11 +++++++++-- >> target/s390x/kvm/kvm.c | 9 +++++++++ >> 2 files changed, 18 insertions(+), 2 deletions(-) >> >> >> base-commit: 31abf61c4929a91275fe32f1fafe6e6b3e840b2a >> -- >> 2.32.0 >