From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615889675; cv=none; d=zohomail.com; s=zohoarc; b=Yg7I5Lp0cMaYFK/JuXzVpDAS4y1sO1u1GZawRhU0gJbymCkWZ/4Gxrtko8ui9vSLJj8P6kljzF3Fg11bhA4DDRCVtrf9/qv8TZs89ue6/3aw83+Zz7ctwJG39b6xVWPqjvoQgJ23HNRCJxCJDuAzVS00daFWnxTaBbPmBAnIVa8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615889675; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=QzwphXCd9U/i1cuULs603z8JDdyllsbKXFi/APkknSA=; b=AcO3Shipthy7VvUaUxJVUuDClbY5Y+xNQv7rt5fmWbGhYe916FmTvYv7JvFsdMzoJL4l6wUl4diT+cxGHbuYB/ZgPRH+NUhzG6Tixh6XWZILv/ecUOCwtdV/1jgq0ylegig8UD6dPmISI9D+gv+ahKuQJvD7Ce8UFKSYFEIIMno= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615889675430233.6093512647202; Tue, 16 Mar 2021 03:14:35 -0700 (PDT) Received: from localhost ([::1]:42658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6ig-0007e9-AZ for importer@patchew.org; Tue, 16 Mar 2021 06:14:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38830) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6gz-0005Zv-6f for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:49 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:58305) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6gw-0004jI-HZ for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:48 -0400 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-275-xnz9yxJfPn2sxWlYDe6bqQ-1; Tue, 16 Mar 2021 06:12:43 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EDA87800FF0; Tue, 16 Mar 2021 10:12:41 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id E9FF66C32F; Tue, 16 Mar 2021 10:12:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889565; 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; bh=QzwphXCd9U/i1cuULs603z8JDdyllsbKXFi/APkknSA=; b=hBZdqqVMCLeyq61SD3tDjRS3kQS3/P/370YcPoJhCv2G6KLJHKdsLHvrEJT0bMMHNnO536 TXh6GCKYNH5RRZQj8Q0E4jRH4GIZVmI6uR/4Qkk1Ey78wUUZbqRic5ejGRTAGFnUe1Xa9Y TQ4hk1zHdGnu1iygDNCrHwwqzIebIXM= X-MC-Unique: xnz9yxJfPn2sxWlYDe6bqQ-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 1/6] s390x/kvm: Get rid of legacy_s390_alloc() Date: Tue, 16 Mar 2021 11:12:16 +0100 Message-Id: <20210316101221.1890034-2-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , qemu-devel@nongnu.org, Peter Xu , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Igor Mammedov , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Hildenbrand legacy_s390_alloc() was required for dealing with the absence of the ESOP feature -- on old HW (< gen 10) and old z/VM versions (< 6.3). As z/VM v6.2 (and even v6.3) is no longer supported since 2017 [1] and we don't expect to have real users on such old hardware, let's drop legacy_s390_alloc(). Still check+report an error just in case someone still runs on such old z/VM environments, or someone runs under weird nested KVM setups (where we can manually disable ESOP via the CPU model). No need to check for KVM_CAP_GMAP - that should always be around on kernels that also have KVM_CAP_DEVICE_CTRL (>=3D v3.15). [1] https://www.ibm.com/support/lifecycle/search?q=3Dz%2FVM Suggested-by: Cornelia Huck Suggested-by: Thomas Huth Cc: Paolo Bonzini Cc: Richard Henderson Cc: Halil Pasic Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Thomas Huth Cc: Igor Mammedov Cc: Peter Xu Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Message-Id: <20210303130916.22553-2-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 43 +++++-------------------------------------- 1 file changed, 5 insertions(+), 38 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 73f816a72227..4fb3bbfef506 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -161,8 +161,6 @@ static int cap_protected; =20 static int active_cmma; =20 -static void *legacy_s390_alloc(size_t size, uint64_t *align, bool shared); - static int kvm_s390_query_mem_limit(uint64_t *memory_limit) { struct kvm_device_attr attr =3D { @@ -349,6 +347,11 @@ int kvm_arch_init(MachineState *ms, KVMState *s) "please use kernel 3.15 or newer"); return -1; } + if (!kvm_check_extension(s, KVM_CAP_S390_COW)) { + error_report("KVM is missing capability KVM_CAP_S390_COW - " + "unsupported environment"); + return -1; + } =20 cap_sync_regs =3D kvm_check_extension(s, KVM_CAP_SYNC_REGS); cap_async_pf =3D kvm_check_extension(s, KVM_CAP_ASYNC_PF); @@ -357,11 +360,6 @@ int kvm_arch_init(MachineState *ms, KVMState *s) cap_vcpu_resets =3D kvm_check_extension(s, KVM_CAP_S390_VCPU_RESETS); cap_protected =3D kvm_check_extension(s, KVM_CAP_S390_PROTECTED); =20 - if (!kvm_check_extension(s, KVM_CAP_S390_GMAP) - || !kvm_check_extension(s, KVM_CAP_S390_COW)) { - phys_mem_set_alloc(legacy_s390_alloc); - } - kvm_vm_enable_cap(s, KVM_CAP_S390_USER_SIGP, 0); kvm_vm_enable_cap(s, KVM_CAP_S390_VECTOR_REGISTERS, 0); kvm_vm_enable_cap(s, KVM_CAP_S390_USER_STSI, 0); @@ -889,37 +887,6 @@ int kvm_s390_mem_op_pv(S390CPU *cpu, uint64_t offset, = void *hostbuf, return ret; } =20 -/* - * Legacy layout for s390: - * Older S390 KVM requires the topmost vma of the RAM to be - * smaller than an system defined value, which is at least 256GB. - * Larger systems have larger values. We put the guest between - * the end of data segment (system break) and this value. We - * use 32GB as a base to have enough room for the system break - * to grow. We also have to use MAP parameters that avoid - * read-only mapping of guest pages. - */ -static void *legacy_s390_alloc(size_t size, uint64_t *align, bool shared) -{ - static void *mem; - - if (mem) { - /* we only support one allocation, which is enough for initial ram= */ - return NULL; - } - - mem =3D mmap((void *) 0x800000000ULL, size, - PROT_EXEC|PROT_READ|PROT_WRITE, - MAP_SHARED | MAP_ANONYMOUS | MAP_FIXED, -1, 0); - if (mem =3D=3D MAP_FAILED) { - mem =3D NULL; - } - if (mem && align) { - *align =3D QEMU_VMALLOC_ALIGN; - } - return mem; -} - static uint8_t const *sw_bp_inst; static uint8_t sw_bp_ilen; =20 --=20 2.26.3 From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615889808; cv=none; d=zohomail.com; s=zohoarc; b=QxV2q1vXsICDuRklXN70IMyld6SRWslnKefl659W8uZQCu357Z274FN7VvwuLc7nO//m0U7fbH1Zx6euY7229ajWakVaLYhcKXTKMe+h+6B+2ikECHQ9cyK5dUyfO56Szo3a8UgM3g+z4h8Z+XXA688BAem5lEZdG0O++/QvFCE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615889808; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=0BQF2OghH7o/2WAZ09l9Ywsqwlkjz0WPJd6YYPo9U24=; b=fSTDWp6zeHsqtFQQCI2xekXvG4GC97a4oXrujsb2yqsoB1f8869cvFoNJR6dVgLGXZmmHqvALC9crdefBpDP3/gij0UtCoyO537d2uaLlWvUkl7QLN95p9inypCr2ICGgOrdusOQO9bOrlRTBZy0R38vppIyHRp2orz1EvY8HVc= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615889808922555.9587429866132; Tue, 16 Mar 2021 03:16:48 -0700 (PDT) Received: from localhost ([::1]:47758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6kp-0001Jh-IL for importer@patchew.org; Tue, 16 Mar 2021 06:16:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38846) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6h1-0005aj-1W for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:51 -0400 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:25699) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6gz-0004kO-7S for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:50 -0400 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-594-C3yLNq-7MUagyVQHb4hzlg-1; Tue, 16 Mar 2021 06:12:45 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B7248189DB; Tue, 16 Mar 2021 10:12:44 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 462556C43A; Tue, 16 Mar 2021 10:12:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889568; 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; bh=0BQF2OghH7o/2WAZ09l9Ywsqwlkjz0WPJd6YYPo9U24=; b=KAnd3IlptUeolEWf96YwLkulomMY/lMU04jFqB2rS1bCPnUsEQHUU6YyqqyTgmMTVmAEel CaR2KuI1e3GQUY/0Rpmh35+IHYgB63/yt9yLEX65h8ijgvXvKeqhJyjwgLk35aCQ3PDiG3 HK4iXoSswFd2PyP7862+52SZOWKteOo= X-MC-Unique: C3yLNq-7MUagyVQHb4hzlg-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 2/6] exec: Get rid of phys_mem_set_alloc() Date: Tue, 16 Mar 2021 11:12:17 +0100 Message-Id: <20210316101221.1890034-3-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=63.128.21.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , qemu-devel@nongnu.org, Peter Xu , Halil Pasic , Christian Borntraeger , qemu-s390x@nongnu.org, Igor Mammedov , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Hildenbrand As the last user is gone, we can get rid of phys_mem_set_alloc() and simplify. Cc: Paolo Bonzini Cc: Richard Henderson Cc: Halil Pasic Cc: Cornelia Huck Cc: Christian Borntraeger Cc: Thomas Huth Cc: Igor Mammedov Cc: Peter Xu Signed-off-by: David Hildenbrand Reviewed-by: Thomas Huth Reviewed-by: Igor Mammedov Message-Id: <20210303130916.22553-3-david@redhat.com> Signed-off-by: Cornelia Huck --- include/sysemu/kvm.h | 4 ---- softmmu/physmem.c | 36 +++--------------------------------- 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h index 687c598be9b3..a1ab1ee12d32 100644 --- a/include/sysemu/kvm.h +++ b/include/sysemu/kvm.h @@ -249,10 +249,6 @@ int kvm_update_guest_debug(CPUState *cpu, unsigned lon= g reinject_trap); int kvm_on_sigbus_vcpu(CPUState *cpu, int code, void *addr); int kvm_on_sigbus(int code, void *addr); =20 -/* interface with exec.c */ - -void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align, bool share= d)); - /* internal API */ =20 int kvm_ioctl(KVMState *s, int type, ...); diff --git a/softmmu/physmem.c b/softmmu/physmem.c index 7e8b0fab89a9..9e5ef4828e9e 100644 --- a/softmmu/physmem.c +++ b/softmmu/physmem.c @@ -1144,19 +1144,6 @@ static int subpage_register(subpage_t *mmio, uint32_= t start, uint32_t end, uint16_t section); static subpage_t *subpage_init(FlatView *fv, hwaddr base); =20 -static void *(*phys_mem_alloc)(size_t size, uint64_t *align, bool shared) = =3D - qemu_anon_ram_alloc; - -/* - * Set a custom physical guest memory alloator. - * Accelerators with unusual needs may need this. Hopefully, we can - * get rid of it eventually. - */ -void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align, bool share= d)) -{ - phys_mem_alloc =3D alloc; -} - static uint16_t phys_section_add(PhysPageMap *map, MemoryRegionSection *section) { @@ -1962,8 +1949,9 @@ static void ram_block_add(RAMBlock *new_block, Error = **errp, bool shared) return; } } else { - new_block->host =3D phys_mem_alloc(new_block->max_length, - &new_block->mr->align, shared= ); + new_block->host =3D qemu_anon_ram_alloc(new_block->max_length, + &new_block->mr->align, + shared); if (!new_block->host) { error_setg_errno(errp, errno, "cannot set up guest memory '%s'", @@ -2047,17 +2035,6 @@ RAMBlock *qemu_ram_alloc_from_fd(ram_addr_t size, Me= moryRegion *mr, return NULL; } =20 - if (phys_mem_alloc !=3D qemu_anon_ram_alloc) { - /* - * file_ram_alloc() needs to allocate just like - * phys_mem_alloc, but we haven't bothered to provide - * a hook there. - */ - error_setg(errp, - "-mem-path not supported with this accelerator"); - return NULL; - } - size =3D HOST_PAGE_ALIGN(size); file_size =3D get_file_size(fd); if (file_size > 0 && file_size < size) { @@ -2247,13 +2224,6 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t leng= th) area =3D mmap(vaddr, length, PROT_READ | PROT_WRITE, flags, block->fd, offset); } else { - /* - * Remap needs to match alloc. Accelerators that - * set phys_mem_alloc never remap. If they did, - * we'd need a remap hook here. - */ - assert(phys_mem_alloc =3D=3D qemu_anon_ram_alloc); - flags |=3D MAP_PRIVATE | MAP_ANONYMOUS; area =3D mmap(vaddr, length, PROT_READ | PROT_WRITE, flags, -1, 0); --=20 2.26.3 From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615890011; cv=none; d=zohomail.com; s=zohoarc; b=NOZ0QEb3SbVqDSbkC4qqCpn8r35CCWCWZgYk+Tj4N+HviMNC+AFMGQusTxxRJO9foYXw9qZLFlyz6rEFclBsJ8QnXuwSvp+Z73Fz+eICaz6+oBhqSOq+mI+vKIKDD8Pzqu/MBOXIIB/6wcc71yZ4iVcI4bAHuvy9voPxLDgYsXY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615890011; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=42bgBTFd6RARHoYUt6pXKrZKmFed68slPu2X+TVQ/6M=; b=UR+W1JNPPseYtI0zlkMEhKDD5vUg2eALsINNXiUvVyA0C6PSj+NpUR0mT4y66qXQJAe0adItFGXW5Ef4Gi5377s/+hfi5LG9SMG2SVPtNhN0gmU3+hv4+u34ePtANcK3R2xtfxK98cC9MDhiztruBVqlQEE065sT68C46czEwSs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615890011915759.0768524863225; Tue, 16 Mar 2021 03:20:11 -0700 (PDT) Received: from localhost ([::1]:56346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6o6-00054P-QT for importer@patchew.org; Tue, 16 Mar 2021 06:20:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38924) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6h7-0005fB-Og for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27607) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6h3-0004mw-FS for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:57 -0400 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-291-FR50eD6cOL-b__fwEqUsLg-1; Tue, 16 Mar 2021 06:12:47 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4773380197D; Tue, 16 Mar 2021 10:12:46 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id E703B6C355; Tue, 16 Mar 2021 10:12:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889571; 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; bh=42bgBTFd6RARHoYUt6pXKrZKmFed68slPu2X+TVQ/6M=; b=aJDl0FCOBNoySht+aIajMo0vAv8kV9lp/cd/vKEObtvtvRAB6A+THC3IIhTCKMArRDid5v pLYBo5NKtLOlNyFG8CBBZblJ5A6hu6pllkXr+y3mcrOzL5ZuiYSHoLlUs2AfQnEOVcaf/K hg8htWp2EIhOfiNKZ81DI+t3tZRJB6w= X-MC-Unique: FR50eD6cOL-b__fwEqUsLg-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 3/6] s390x/cpu_model: use official name for 8562 Date: Tue, 16 Mar 2021 11:12:18 +0100 Message-Id: <20210316101221.1890034-4-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christian Borntraeger , qemu-s390x@nongnu.org, Cornelia Huck , qemu-devel@nongnu.org, David Hildenbrand Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The single-frame z15 is called "z15 T02" (and the multi-frame z15 "z15 T01"). Signed-off-by: Cornelia Huck Reviewed-by: David Hildenbrand Acked-by: Christian Borntraeger Message-Id: <20210311132746.1777754-1-cohuck@redhat.com> --- target/s390x/cpu_models.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index dd474c5e9ad1..050dcf2d42d2 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -86,8 +86,8 @@ static S390CPUDef s390_cpu_defs[] =3D { CPUDEF_INIT(0x3906, 14, 1, 47, 0x08000000U, "z14", "IBM z14 GA1"), CPUDEF_INIT(0x3906, 14, 2, 47, 0x08000000U, "z14.2", "IBM z14 GA2"), CPUDEF_INIT(0x3907, 14, 1, 47, 0x08000000U, "z14ZR1", "IBM z14 Model Z= R1 GA1"), - CPUDEF_INIT(0x8561, 15, 1, 47, 0x08000000U, "gen15a", "IBM z15 GA1"), - CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM 8562 GA1"), + CPUDEF_INIT(0x8561, 15, 1, 47, 0x08000000U, "gen15a", "IBM z15 T01 GA1= "), + CPUDEF_INIT(0x8562, 15, 1, 47, 0x08000000U, "gen15b", "IBM z15 T02 GA1= "), }; =20 #define QEMU_MAX_CPU_TYPE 0x2964 --=20 2.26.3 From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615889943; cv=none; d=zohomail.com; s=zohoarc; b=VoWN+jBR276Xd3RHpI2mZLfPvr5Xy6KBAWltRsSlVxcSfZG2qGbzCaLWm2/Z0XaDcu7a90GuXSfWWvxBfws2bamaekxWi3RqP393FvVHktjXb17zW9dPDrGTBYfTMscFEP02P35EqJv7f94RdNfhi/tXiJtUZSk03YZhUcUB3Fc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615889943; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=iHBnzR/AIVdeZ02qlpMxygvv9b5QOLSnCqpJ3WJFafU=; b=N41VCv1CcF9IbWVVpQQY5TKWosQXpzBCY4WJyZerQ40m68I7k7g7meQ9X32o3wogn0uqAyVzi36rZdvDkjzN+vL8pp1QXjiJ/OrrDLEuV0tBTFljyWwFLjD4pA/iak/x23ekhWP4axwvMsnnpZkES0lKwkoqtcYcZWr0dUdlyLE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615889943492782.6134648121752; Tue, 16 Mar 2021 03:19:03 -0700 (PDT) Received: from localhost ([::1]:51990 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6n0-0003H1-8j for importer@patchew.org; Tue, 16 Mar 2021 06:19:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38904) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6h6-0005eK-4X for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:57 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:21669) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6h3-0004mb-Em for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:55 -0400 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-228-Gkcubox6P9ipzS2z_jmWZw-1; Tue, 16 Mar 2021 06:12:49 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2B0D58030D1; Tue, 16 Mar 2021 10:12:48 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 955015B4B6; Tue, 16 Mar 2021 10:12:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889571; 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; bh=iHBnzR/AIVdeZ02qlpMxygvv9b5QOLSnCqpJ3WJFafU=; b=gtbBy1piZKox6JOPOvRS4SE+ZPTkU8Hdb2LdCTCSbSHI5ZtIyPQnNOH9V5UqNHKo/06fXN ZrTaJyzz2OdVNBJx9ZlNkWeRjJQprCpm6s9U3J56NEo8MgR/y34sxjzRCQv+Ny08NtQvx+ GqjvYguFejFFH/145aw+qwU+Y/DcJwQ= X-MC-Unique: Gkcubox6P9ipzS2z_jmWZw-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 4/6] target/s390x: Implement the MVPG condition-code-option bit Date: Tue, 16 Mar 2021 11:12:19 +0100 Message-Id: <20210316101221.1890034-5-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=170.10.133.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , qemu-devel@nongnu.org, qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson If the CCO bit is set, MVPG should not generate an exception but report page translation faults via a CC code. Create a new helper, access_prepare_nf, which can use probe_access_flags in non-faulting mode, and then handle watchpoints. Reviewed-by: Richard Henderson Signed-off-by: Richard Henderson [thuth: Added logic to still inject protection exceptions] Signed-off-by: Thomas Huth [david: Look at env->tlb_fill_exc to determine if there was an exception] Signed-off-by: David Hildenbrand Tested-by: Thomas Huth Message-Id: <20210315085449.34676-2-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/cpu.h | 5 ++ target/s390x/excp_helper.c | 3 + target/s390x/mem_helper.c | 136 ++++++++++++++++++++++++++++++------- 3 files changed, 121 insertions(+), 23 deletions(-) diff --git a/target/s390x/cpu.h b/target/s390x/cpu.h index 60d434d5edd5..468b4430f339 100644 --- a/target/s390x/cpu.h +++ b/target/s390x/cpu.h @@ -114,6 +114,11 @@ struct CPUS390XState { =20 uint64_t diag318_info; =20 +#if !defined(CONFIG_USER_ONLY) + uint64_t tlb_fill_tec; /* translation exception code during tlb_fill= */ + int tlb_fill_exc; /* exception number seen during tlb_fill */ +#endif + /* Fields up to this point are cleared by a CPU reset */ struct {} end_reset_fields; =20 diff --git a/target/s390x/excp_helper.c b/target/s390x/excp_helper.c index ce16af394b1f..c48cd6b46f49 100644 --- a/target/s390x/excp_helper.c +++ b/target/s390x/excp_helper.c @@ -164,6 +164,9 @@ bool s390_cpu_tlb_fill(CPUState *cs, vaddr address, int= size, tec =3D 0; /* unused */ } =20 + env->tlb_fill_exc =3D excp; + env->tlb_fill_tec =3D tec; + if (!excp) { qemu_log_mask(CPU_LOG_MMU, "%s: set tlb %" PRIx64 " -> %" PRIx64 " (%x)\n", diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index 25cfede806af..bab872dcad02 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -130,28 +130,103 @@ typedef struct S390Access { int mmu_idx; } S390Access; =20 -static S390Access access_prepare(CPUS390XState *env, vaddr vaddr, int size, - MMUAccessType access_type, int mmu_idx, - uintptr_t ra) +/* + * With nonfault=3D1, return the PGM_ exception that would have been injec= ted + * into the guest; return 0 if no exception was detected. + * + * For !CONFIG_USER_ONLY, the TEC is stored stored to env->tlb_fill_tec. + * For CONFIG_USER_ONLY, the faulting address is stored to env->__excp_add= r. + */ +static int s390_probe_access(CPUArchState *env, target_ulong addr, int siz= e, + MMUAccessType access_type, int mmu_idx, + bool nonfault, void **phost, uintptr_t ra) { - S390Access access =3D { - .vaddr1 =3D vaddr, - .size1 =3D MIN(size, -(vaddr | TARGET_PAGE_MASK)), - .mmu_idx =3D mmu_idx, - }; + int flags; =20 - g_assert(size > 0 && size <=3D 4096); - access.haddr1 =3D probe_access(env, access.vaddr1, access.size1, acces= s_type, - mmu_idx, ra); +#if defined(CONFIG_USER_ONLY) + flags =3D page_get_flags(addr); + if (!(flags & (access_type =3D=3D MMU_DATA_LOAD ? PAGE_READ : PAGE_WR= ITE))) { + env->__excp_addr =3D addr; + flags =3D (flags & PAGE_VALID) ? PGM_PROTECTION : PGM_ADDRESSING; + if (nonfault) { + return flags; + } + tcg_s390_program_interrupt(env, flags, ra); + } + *phost =3D g2h(env_cpu(env), addr); +#else + /* + * For !CONFIG_USER_ONLY, we cannot rely on TLB_INVALID_MASK or haddr= =3D=3DNULL + * to detect if there was an exception during tlb_fill(). + */ + env->tlb_fill_exc =3D 0; + flags =3D probe_access_flags(env, addr, access_type, mmu_idx, nonfault= , phost, + ra); + if (env->tlb_fill_exc) { + return env->tlb_fill_exc; + } =20 - if (unlikely(access.size1 !=3D size)) { - /* The access crosses page boundaries. */ - access.vaddr2 =3D wrap_address(env, vaddr + access.size1); - access.size2 =3D size - access.size1; - access.haddr2 =3D probe_access(env, access.vaddr2, access.size2, - access_type, mmu_idx, ra); + if (unlikely(flags & TLB_WATCHPOINT)) { + /* S390 does not presently use transaction attributes. */ + cpu_check_watchpoint(env_cpu(env), addr, size, + MEMTXATTRS_UNSPECIFIED, + (access_type =3D=3D MMU_DATA_STORE + ? BP_MEM_WRITE : BP_MEM_READ), ra); } - return access; +#endif + return 0; +} + +static int access_prepare_nf(S390Access *access, CPUS390XState *env, + bool nonfault, vaddr vaddr1, int size, + MMUAccessType access_type, + int mmu_idx, uintptr_t ra) +{ + void *haddr1, *haddr2 =3D NULL; + int size1, size2, exc; + vaddr vaddr2 =3D 0; + + assert(size > 0 && size <=3D 4096); + + size1 =3D MIN(size, -(vaddr1 | TARGET_PAGE_MASK)), + size2 =3D size - size1; + + exc =3D s390_probe_access(env, vaddr1, size1, access_type, mmu_idx, no= nfault, + &haddr1, ra); + if (exc) { + return exc; + } + if (unlikely(size2)) { + /* The access crosses page boundaries. */ + vaddr2 =3D wrap_address(env, vaddr1 + size1); + exc =3D s390_probe_access(env, vaddr2, size2, access_type, mmu_idx, + nonfault, &haddr2, ra); + if (exc) { + return exc; + } + } + + *access =3D (S390Access) { + .vaddr1 =3D vaddr1, + .vaddr2 =3D vaddr2, + .haddr1 =3D haddr1, + .haddr2 =3D haddr2, + .size1 =3D size1, + .size2 =3D size2, + .mmu_idx =3D mmu_idx + }; + return 0; +} + +static S390Access access_prepare(CPUS390XState *env, vaddr vaddr, int size, + MMUAccessType access_type, int mmu_idx, + uintptr_t ra) +{ + S390Access ret; + int exc =3D access_prepare_nf(&ret, env, false, vaddr, size, + access_type, mmu_idx, ra); + assert(!exc); + return ret; } =20 /* Helper to handle memset on a single page. */ @@ -845,8 +920,10 @@ uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0,= uint64_t r1, uint64_t r2) const int mmu_idx =3D cpu_mmu_index(env, false); const bool f =3D extract64(r0, 11, 1); const bool s =3D extract64(r0, 10, 1); + const bool cco =3D extract64(r0, 8, 1); uintptr_t ra =3D GETPC(); S390Access srca, desta; + int exc; =20 if ((f && s) || extract64(r0, 12, 4)) { tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); @@ -858,13 +935,26 @@ uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0= , uint64_t r1, uint64_t r2) /* * TODO: * - Access key handling - * - CC-option with surpression of page-translation exceptions * - Store r1/r2 register identifiers at real location 162 */ - srca =3D access_prepare(env, r2, TARGET_PAGE_SIZE, MMU_DATA_LOAD, mmu_= idx, - ra); - desta =3D access_prepare(env, r1, TARGET_PAGE_SIZE, MMU_DATA_STORE, mm= u_idx, - ra); + exc =3D access_prepare_nf(&srca, env, cco, r2, TARGET_PAGE_SIZE, + MMU_DATA_LOAD, mmu_idx, ra); + if (exc) { + return 2; + } + exc =3D access_prepare_nf(&desta, env, cco, r1, TARGET_PAGE_SIZE, + MMU_DATA_STORE, mmu_idx, ra); + if (exc) { + if (exc =3D=3D PGM_PROTECTION) { +#if !defined(CONFIG_USER_ONLY) + stq_phys(env_cpu(env)->as, + env->psa + offsetof(LowCore, trans_exc_code), + env->tlb_fill_tec); +#endif + tcg_s390_program_interrupt(env, PGM_PROTECTION, ra); + } + return 1; + } access_memmove(env, &desta, &srca, ra); return 0; /* data moved */ } --=20 2.26.3 From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615889664; cv=none; d=zohomail.com; s=zohoarc; b=Vr6SmXBzkpDjkrV3rKjANz8bah5wkb7MsPPgt5Lm8AvzfyfU7j8qAKsa5fYQEZwRQ8zexK6tTMpapnbhAiaiU7/V2nif7Is+HJYJJ2kjk9OKaiQxN70LU9TXE+sQ+qvUmjLwW7z2PFrDBYJguZM2BQgekr3t863/ZerTYOtTrOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615889664; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=cJjEWx1VJeO9nm6sd7qaUX+KYPawvIJM2p71+pMKZCg=; b=UmVQkqgQSfkLnVCx+TPizA1E+hyyDb/URH+Fvlx0GArPSlpRpmvY1zU3624Ul8Qy94n2HrGzn7/KOVA8+rVmi7nGhlqIv0C33UxsJmOWWcpUAkUSqK6KBArxo07oPpy6g/IWD06rTOGzofN7acega5R2Mh5LzH9WQY99luojws0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1615889664216669.3618873480848; Tue, 16 Mar 2021 03:14:24 -0700 (PDT) Received: from localhost ([::1]:42214 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6iV-0007TK-3a for importer@patchew.org; Tue, 16 Mar 2021 06:14:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38946) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6h8-0005hT-ON for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:58 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53904) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6h4-0004o7-7R for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:12:58 -0400 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-247-VdSoisFNOb-MTrG26kbEUg-1; Tue, 16 Mar 2021 06:12:51 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 24207814270; Tue, 16 Mar 2021 10:12:50 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7825C6C353; Tue, 16 Mar 2021 10:12:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889573; 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; bh=cJjEWx1VJeO9nm6sd7qaUX+KYPawvIJM2p71+pMKZCg=; b=PS/qQpDME3g1MLOrNKAeGmyt3Q5W8KwCjHHUKuivzeyUal/jSCscRy5FnZs0i2R9De+v8K Znib3T+yN8DhfQhuN7twPAvetSw+JUiX8lD8vZSuFIXpwfyVuoFNUwBc06s60ACQ3C/cor mVXPOGBgi45UeB1thvlaw/0eW0sVg4Y= X-MC-Unique: VdSoisFNOb-MTrG26kbEUg-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 5/6] target/s390x: Store r1/r2 for page-translation exceptions during MVPG Date: Tue, 16 Mar 2021 11:12:20 +0100 Message-Id: <20210316101221.1890034-6-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , David Hildenbrand , Cornelia Huck , Richard Henderson , qemu-devel@nongnu.org, qemu-s390x@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: David Hildenbrand The PoP states: When EDAT-1 does not apply, and a program interruption due to a page-translation exception is recognized by the MOVE PAGE instruction, the contents of the R1 field of the instruction are stored in bit positions 0-3 of location 162, and the contents of the R2 field are stored in bit positions 4-7. If [...] an ASCE-type, region-first-translation, region-second-translation, region-third-translation, or segment-translation exception was recognized, the contents of location 162 are unpredictable. So we have to write r1/r2 into the lowcore on page-translation exceptions. Simply handle all exceptions inside our mvpg helper now. Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand Tested-by: Thomas Huth Message-Id: <20210315085449.34676-3-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/helper.h | 2 +- target/s390x/insn-data.def | 2 +- target/s390x/mem_helper.c | 46 +++++++++++++++++++++++--------------- target/s390x/translate.c | 7 +++++- 4 files changed, 36 insertions(+), 21 deletions(-) diff --git a/target/s390x/helper.h b/target/s390x/helper.h index 55bd1551e604..d4e4f3388f81 100644 --- a/target/s390x/helper.h +++ b/target/s390x/helper.h @@ -18,7 +18,7 @@ DEF_HELPER_3(srstu, void, env, i32, i32) DEF_HELPER_4(clst, i64, env, i64, i64, i64) DEF_HELPER_FLAGS_4(mvn, TCG_CALL_NO_WG, void, env, i32, i64, i64) DEF_HELPER_FLAGS_4(mvo, TCG_CALL_NO_WG, void, env, i32, i64, i64) -DEF_HELPER_FLAGS_4(mvpg, TCG_CALL_NO_WG, i32, env, i64, i64, i64) +DEF_HELPER_FLAGS_4(mvpg, TCG_CALL_NO_WG, i32, env, i64, i32, i32) DEF_HELPER_FLAGS_4(mvz, TCG_CALL_NO_WG, void, env, i32, i64, i64) DEF_HELPER_3(mvst, i32, env, i32, i32) DEF_HELPER_4(ex, void, env, i32, i64, i64) diff --git a/target/s390x/insn-data.def b/target/s390x/insn-data.def index e5b6efabf323..0bb1886a2e16 100644 --- a/target/s390x/insn-data.def +++ b/target/s390x/insn-data.def @@ -641,7 +641,7 @@ /* MOVE NUMERICS */ C(0xd100, MVN, SS_a, Z, la1, a2, 0, 0, mvn, 0) /* MOVE PAGE */ - C(0xb254, MVPG, RRE, Z, r1_o, r2_o, 0, 0, mvpg, 0) + C(0xb254, MVPG, RRE, Z, 0, 0, 0, 0, mvpg, 0) /* MOVE STRING */ C(0xb255, MVST, RRE, Z, 0, 0, 0, 0, mvst, 0) /* MOVE WITH OPTIONAL SPECIFICATION */ diff --git a/target/s390x/mem_helper.c b/target/s390x/mem_helper.c index bab872dcad02..12e84a42855e 100644 --- a/target/s390x/mem_helper.c +++ b/target/s390x/mem_helper.c @@ -915,8 +915,10 @@ uint64_t HELPER(clst)(CPUS390XState *env, uint64_t c, = uint64_t s1, uint64_t s2) } =20 /* move page */ -uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0, uint64_t r1, uint64= _t r2) +uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0, uint32_t r1, uint32= _t r2) { + const uint64_t src =3D get_address(env, r2) & TARGET_PAGE_MASK; + const uint64_t dst =3D get_address(env, r1) & TARGET_PAGE_MASK; const int mmu_idx =3D cpu_mmu_index(env, false); const bool f =3D extract64(r0, 11, 1); const bool s =3D extract64(r0, 10, 1); @@ -929,34 +931,42 @@ uint32_t HELPER(mvpg)(CPUS390XState *env, uint64_t r0= , uint64_t r1, uint64_t r2) tcg_s390_program_interrupt(env, PGM_SPECIFICATION, GETPC()); } =20 - r1 =3D wrap_address(env, r1 & TARGET_PAGE_MASK); - r2 =3D wrap_address(env, r2 & TARGET_PAGE_MASK); - /* - * TODO: - * - Access key handling - * - Store r1/r2 register identifiers at real location 162 + * We always manually handle exceptions such that we can properly store + * r1/r2 to the lowcore on page-translation exceptions. + * + * TODO: Access key handling */ - exc =3D access_prepare_nf(&srca, env, cco, r2, TARGET_PAGE_SIZE, + exc =3D access_prepare_nf(&srca, env, true, src, TARGET_PAGE_SIZE, MMU_DATA_LOAD, mmu_idx, ra); if (exc) { - return 2; + if (cco) { + return 2; + } + goto inject_exc; } - exc =3D access_prepare_nf(&desta, env, cco, r1, TARGET_PAGE_SIZE, + exc =3D access_prepare_nf(&desta, env, true, dst, TARGET_PAGE_SIZE, MMU_DATA_STORE, mmu_idx, ra); if (exc) { - if (exc =3D=3D PGM_PROTECTION) { -#if !defined(CONFIG_USER_ONLY) - stq_phys(env_cpu(env)->as, - env->psa + offsetof(LowCore, trans_exc_code), - env->tlb_fill_tec); -#endif - tcg_s390_program_interrupt(env, PGM_PROTECTION, ra); + if (cco && exc !=3D PGM_PROTECTION) { + return 1; } - return 1; + goto inject_exc; } access_memmove(env, &desta, &srca, ra); return 0; /* data moved */ +inject_exc: +#if !defined(CONFIG_USER_ONLY) + if (exc !=3D PGM_ADDRESSING) { + stq_phys(env_cpu(env)->as, env->psa + offsetof(LowCore, trans_exc_= code), + env->tlb_fill_tec); + } + if (exc =3D=3D PGM_PAGE_TRANS) { + stb_phys(env_cpu(env)->as, env->psa + offsetof(LowCore, op_access_= id), + r1 << 4 | r2); + } +#endif + tcg_s390_program_interrupt(env, exc, ra); } =20 /* string copy */ diff --git a/target/s390x/translate.c b/target/s390x/translate.c index 61dd0341e477..4f953ddfbaf6 100644 --- a/target/s390x/translate.c +++ b/target/s390x/translate.c @@ -3513,7 +3513,12 @@ static DisasJumpType op_mvo(DisasContext *s, DisasOp= s *o) =20 static DisasJumpType op_mvpg(DisasContext *s, DisasOps *o) { - gen_helper_mvpg(cc_op, cpu_env, regs[0], o->in1, o->in2); + TCGv_i32 t1 =3D tcg_const_i32(get_field(s, r1)); + TCGv_i32 t2 =3D tcg_const_i32(get_field(s, r2)); + + gen_helper_mvpg(cc_op, cpu_env, regs[0], t1, t2); + tcg_temp_free_i32(t1); + tcg_temp_free_i32(t2); set_cc_static(s); return DISAS_NEXT; } --=20 2.26.3 From nobody Sun May 19 03:12:45 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1615889669; cv=none; d=zohomail.com; s=zohoarc; b=DC2cUJJ3oTa/tAYzcJPM2Y2rGl5C0N7yiCpNwuR+Rl3M+MUQqTkZqhDc+wL3SBKOYKb4gf/LWuA5j3izXSLCdYZUzuIQOnsZrkRJOmtdH1Y90Kpjh9H6rd5WMv98A7CsgjAWd4iqpDjv5vfF8JJc4VKL8C2gdq5SgRZPbkZD034= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1615889669; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=M/nN1ZRtMSGZS9U2Z0VTrBZDPHuSHhkcSk1Mn+85a+Q=; b=PGZDgHuU/3eh02ENqoSUa60elvW9bKMMtBURhtnRFSHbzKuxwQmc5odbg1wUdKzgichpTsRjuMOHv98P/oXNAT4e7/hleGH4LKNPR2UNM1uhsffydlQE5wBOrRX1bcSKtFSOL2IoXKVqVC3OukWFEJgtLfufF6cDX3Smmh6wCqA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 161588966936138.597813134777994; Tue, 16 Mar 2021 03:14:29 -0700 (PDT) Received: from localhost ([::1]:42344 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lM6iY-0007WY-98 for importer@patchew.org; Tue, 16 Mar 2021 06:14:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38990) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lM6hA-0005m3-PN for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:13:00 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:53344) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1lM6h8-0004pt-4X for qemu-devel@nongnu.org; Tue, 16 Mar 2021 06:13:00 -0400 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-347-RvcgILtjNFS8O5czCtZQsg-1; Tue, 16 Mar 2021 06:12:53 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2761F801817; Tue, 16 Mar 2021 10:12:52 +0000 (UTC) Received: from gondolin.redhat.com (ovpn-113-185.ams2.redhat.com [10.36.113.185]) by smtp.corp.redhat.com (Postfix) with ESMTP id 76DA25B4B6; Tue, 16 Mar 2021 10:12:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1615889577; 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; bh=M/nN1ZRtMSGZS9U2Z0VTrBZDPHuSHhkcSk1Mn+85a+Q=; b=IV/UQhjQ+ZdhyRZTmCQPVJ8gGh945BvI25BrUYxKV5Z6cm6AGIGX45H6Tg2cwMy1ZWxgeV TbIBD8x+SO2DOQMgsN+S5z7W6KUMPZWb8uDs1YZs+Y+GHcHPpTAou1cxY4G0Qv5NVuyz9w nB2V0I/h8CsRTvL10galShszmGaKHYE= X-MC-Unique: RvcgILtjNFS8O5czCtZQsg-1 From: Cornelia Huck To: Peter Maydell Subject: [PULL 6/6] s390x/pci: Add missing initialization for g_autofree variables Date: Tue, 16 Mar 2021 11:12:21 +0100 Message-Id: <20210316101221.1890034-7-cohuck@redhat.com> In-Reply-To: <20210316101221.1890034-1-cohuck@redhat.com> References: <20210316101221.1890034-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=cohuck@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=216.205.24.124; envelope-from=cohuck@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -29 X-Spam_score: -3.0 X-Spam_bar: --- X-Spam_report: (-3.0 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.25, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , Matthew Rosato , Cornelia Huck , qemu-devel@nongnu.org, qemu-s390x@nongnu.org, Miroslav Rezanina , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Miroslav Rezanina When declaring g_autofree variable without initialization, compiler will raise "may be used uninitialized in this function" warning due to automatic free handling. This is mentioned in docs/devel/style.rst (quote from section "Automatic memory deallocation"): * Variables declared with g_auto* MUST always be initialized, otherwise the cleanup function will use uninitialized stack memory Add initialization for these declarations to prevent the warning and comply with coding style. Signed-off-by: Miroslav Rezanina Reviewed-by: Philippe Mathieu-Daud=C3=A9 Fixes: cd7498d07fbb ("s390x/pci: Add routine to get the vfio dma available = count") Fixes: 1e7552ff5c34 ("s390x/pci: get zPCI function info from host") Reviewed-by: Thomas Huth Tested-by: Matthew Rosato Message-Id: <20210315101352.152888-1-mrezanin@redhat.com> Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-vfio.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-pci-vfio.c b/hw/s390x/s390-pci-vfio.c index ead4f222d55a..2a153fa8c9e2 100644 --- a/hw/s390x/s390-pci-vfio.c +++ b/hw/s390x/s390-pci-vfio.c @@ -29,14 +29,11 @@ */ bool s390_pci_update_dma_avail(int fd, unsigned int *avail) { - g_autofree struct vfio_iommu_type1_info *info; - uint32_t argsz; + uint32_t argsz =3D sizeof(struct vfio_iommu_type1_info); + g_autofree struct vfio_iommu_type1_info *info =3D g_malloc0(argsz); =20 assert(avail); =20 - argsz =3D sizeof(struct vfio_iommu_type1_info); - info =3D g_malloc0(argsz); - /* * If the specified argsz is not large enough to contain all capabilit= ies * it will be updated upon return from the ioctl. Retry until we have @@ -230,7 +227,7 @@ static void s390_pci_read_pfip(S390PCIBusDevice *pbdev, */ void s390_pci_get_clp_info(S390PCIBusDevice *pbdev) { - g_autofree struct vfio_device_info *info; + g_autofree struct vfio_device_info *info =3D NULL; VFIOPCIDevice *vfio_pci; uint32_t argsz; int fd; --=20 2.26.3