From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738194; cv=none; d=zoho.com; s=zohoarc; b=MiyXBhGJiJA/w7sZoSLYfr/RCx1KCfyNJQ6ZqAs++KrqjHW6xDyZ5qx4IVWMeF5ooi/qZzxCikxZ0LjxNbzyPkoJWq+4HhKlbbNSl2yMSP8naJl8MUd1jYiCOE/XmUXTwAfCGWreMqWHe/Sy58/4rcYdrq+1UlFD5JVWXnjpk7E= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738194; 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=Jrukwy3qLkjNpvlpQhyMtQtDCAAf6F741m0tR4j18s8=; b=S71NO86nciEcwl2TLiDWtYuhblq5vieluy0/Fo9j8ywb/IZSdsEc0dnhV0tlKhe3km54vuxI4P7XQUd5/Qhm4SILGHugxyfE+LyR0I2odA1/f1pERPJZ/gZzrDsDm/6Fedkit9LH/9V3br8alyXI6vwMbJ7Ay5iHB6YYG/QV/mI= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738194444726.158408006242; Tue, 22 Oct 2019 02:56:34 -0700 (PDT) Received: from localhost ([::1]:52588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqty-0007GC-7r for importer@patchew.org; Tue, 22 Oct 2019 05:56:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsD-0005Kd-Md for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsC-0005bh-Ms for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:41 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:58341 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsC-0005bW-J0 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:40 -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-330-R1jegDolMwuK-HCp6vD2Bw-1; Tue, 22 Oct 2019 05:54:36 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A7F2A107AD31; Tue, 22 Oct 2019 09:54:35 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1516460C5D; Tue, 22 Oct 2019 09:54:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738080; 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=Jrukwy3qLkjNpvlpQhyMtQtDCAAf6F741m0tR4j18s8=; b=LkXyUsXUyauyE200I0WyKYRDSc8rW8Ocw2iEF0guxueBCO3Dxuh9O5CWsQyQG83997+CKW iKzegDi8+0H1RsyhTjRMlFmuvXpoEU7YRsFcdi8BIw+COGGLz2eNMAUKcNKFdzaxOFTjmR ZIR1lY0i8l/zSwR+bqZV7noTPj9MDE4= From: Cornelia Huck To: Peter Maydell Subject: [PULL 1/9] s390x/cpumodel: Add missing visit_free Date: Tue, 22 Oct 2019 11:54:20 +0200 Message-Id: <20191022095428.20780-2-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: R1jegDolMwuK-HCp6vD2Bw-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: qemu-s390x@nongnu.org, Cornelia Huck , Andrew Jones , 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" From: Andrew Jones Beata Michalska noticed this missing visit_free() while reviewing arm's implementation of qmp_query_cpu_model_expansion(), which is modeled off this s390x implementation. Signed-off-by: Andrew Jones Message-Id: <20191016145434.7007-1-drjones@redhat.com> Reviewed-by: David Hildenbrand Signed-off-by: Cornelia Huck --- target/s390x/cpu_models.c | 1 + 1 file changed, 1 insertion(+) diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 009afc38b92d..7e92fb2e156d 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -515,6 +515,7 @@ static void cpu_model_from_info(S390CPUModel *model, co= nst CpuModelInfo *info, visitor =3D qobject_input_visitor_new(info->props); visit_start_struct(visitor, NULL, NULL, 0, errp); if (*errp) { + visit_free(visitor); object_unref(obj); return; } --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738428; cv=none; d=zoho.com; s=zohoarc; b=i0KkcfY3WBwWvOJ+AmgtNR79V4tadRbyobiOOmuT7nGFYEJfemMh/VWdWGQAQvEx/6xUdkv6d0wM31bbgfa/0Y2tKieN0jziBUYnWqrwIFYXHbYoFj3Vbq7YIwRwlvsPO7vx8z3Ir1t5OKKOGsFcfXzzdf3kvecz1cYBjf2NAaY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738428; 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=rYrcuE4hP5bXuO1tSuDw6IhWKt/x8/seD1ANTQVrpmQ=; b=RVRym8vv60Oyii7zTpNRNCMjGMAGSHcDY3wfKjbEq4zX4i3hHPEebNQh31LHXdHSrSatMHrHazXgoQWUXMO4i+g+Y7ZpH48qfbxVfGloSqz63O0DhNWcgC1MOMdYnL+k2wMRsVAIBf54aK5IPJofu8+7HMmq7+XqjyZk01m01mw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738428315864.5093785298815; Tue, 22 Oct 2019 03:00:28 -0700 (PDT) Received: from localhost ([::1]:52636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqxm-0002dG-BU for importer@patchew.org; Tue, 22 Oct 2019 06:00:26 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59285) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsI-0005Tw-7i for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsH-0005cs-6Z for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:46 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:58517 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsH-0005ca-3c for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:45 -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-105-GyXdYxFQPgOQCx56XlooKQ-1; Tue, 22 Oct 2019 05:54:41 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 1DC0C1005509; Tue, 22 Oct 2019 09:54:40 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 28BCA1001DC0; Tue, 22 Oct 2019 09:54:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738084; 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=rYrcuE4hP5bXuO1tSuDw6IhWKt/x8/seD1ANTQVrpmQ=; b=Vu2OLjqQlm5wstoQ6BXQHhWvd+AekbEueY2k8JftIpCUXN40STRinjbEoJfzgxanIIDSuK o6Y6UbGU51Em9NPO4SSqHyD7OVUC5Dkp+27xQFXukh1YMEJk+6Fqti0iO0KO3YMyntNEXg JPreDkBl6snckFxqqfCJioM66SJXkOA= From: Cornelia Huck To: Peter Maydell Subject: [PULL 2/9] s390x/mmu: Remove duplicate check for MMU_DATA_STORE Date: Tue, 22 Oct 2019 11:54:21 +0200 Message-Id: <20191022095428.20780-3-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: GyXdYxFQPgOQCx56XlooKQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand No need to double-check if we have a write. Found by Coverity (CID: 1406404). Fixes: 31b59419069e ("target/s390x: Return exception from mmu_translate_rea= l") Cc: Peter Maydell Signed-off-by: David Hildenbrand Message-Id: <20191017121922.18840-1-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Cornelia Huck --- target/s390x/mmu_helper.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/target/s390x/mmu_helper.c b/target/s390x/mmu_helper.c index 90b81335f920..c9f3f3475010 100644 --- a/target/s390x/mmu_helper.c +++ b/target/s390x/mmu_helper.c @@ -556,9 +556,7 @@ int mmu_translate_real(CPUS390XState *env, target_ulong= raddr, int rw, *flags |=3D PAGE_WRITE_INV; if (is_low_address(raddr) && rw =3D=3D MMU_DATA_STORE) { /* LAP sets bit 56 */ - *tec =3D (raddr & TARGET_PAGE_MASK) - | (rw =3D=3D MMU_DATA_STORE ? FS_WRITE : FS_READ) - | 0x80; + *tec =3D (raddr & TARGET_PAGE_MASK) | FS_WRITE | 0x80; return PGM_PROTECTION; } } --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738647; cv=none; d=zoho.com; s=zohoarc; b=f5k7Sj+A//G1XboVywmokXPflfpCNJL6T33JxPZXJXbbwxDh+wzH4G0QqAC3/bNNNdThYlw0EFQcC39fUgcPnNUsaCddP4mpYwaSsicjb2c4UjGdH3vGn9uRRoo1BRkbSqO1hSVRUin5+6WLbIkqTyVOitoYSKpuaIxah4UH0Rs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738647; 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=jFPWykuMsgieWlJGsSu8oB7ApcBbSMC9vXFxrVCBi0o=; b=YcOeKPxZZ+2tu4yVmhie5cayt9E+mKbHJI1OMtKZEhX2Q9B4SPP+MvWZlMqGVy95C4xaJUvxFWR7F9CqSERRKRU6Fl85aPZkeBOjQLquVncqUDmCcBg2hX4ecago+EhNVh3DSSRpz8p9g9Py4adlTJM+n9zogzvsnJwGlS7zuqA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738647910509.141490261826; Tue, 22 Oct 2019 03:04:07 -0700 (PDT) Received: from localhost ([::1]:52670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr1I-0006Nc-Mz for importer@patchew.org; Tue, 22 Oct 2019 06:04:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59315) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsM-0005bX-2g for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:51 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsL-0005eK-1H for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:49 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:32551 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsK-0005eA-UN for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54: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-284-FCPtEwf3NmeIaphByN-zWQ-1; Tue, 22 Oct 2019 05:54: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 2FB47800D53; Tue, 22 Oct 2019 09:54:44 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8ED8660126; Tue, 22 Oct 2019 09:54:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738088; 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=jFPWykuMsgieWlJGsSu8oB7ApcBbSMC9vXFxrVCBi0o=; b=JNK5/SNKnwkrsoqYwd7Gh/SI2OcaqJ8XK/p1LSIGvKAGsUjllhPAYTjwWweYW15sPQqyvN HjLSEmPK3pouEGS5XhPYGoN0wtGG2CpqYH53vke0/XIJrqubWiWyHXXaxhavOVs6NCgVAG Q/VLEnoITBiSYMGD/1+BFUH0G1yXfgc= From: Cornelia Huck To: Peter Maydell Subject: [PULL 3/9] s390x/tcg: Fix VECTOR MULTIPLY LOGICAL ODD Date: Tue, 22 Oct 2019 11:54:22 +0200 Message-Id: <20191022095428.20780-4-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-MC-Unique: FCPtEwf3NmeIaphByN-zWQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand We have to read from odd offsets. Fixes: 2bf3ee38f1f8 ("s390x/tcg: Implement VECTOR MULTIPLY *") Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-2-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/vec_int_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/s390x/vec_int_helper.c b/target/s390x/vec_int_helper.c index 68eaae407b47..03ae8631d958 100644 --- a/target/s390x/vec_int_helper.c +++ b/target/s390x/vec_int_helper.c @@ -488,7 +488,7 @@ void HELPER(gvec_vmlo##BITS)(void *v1, const void *v2, = const void *v3, \ { = \ int i, j; = \ = \ - for (i =3D 0, j =3D 0; i < (128 / TBITS); i++, j +=3D 2) { = \ + for (i =3D 0, j =3D 1; i < (128 / TBITS); i++, j +=3D 2) { = \ const uint##TBITS##_t a =3D s390_vec_read_element##BITS(v2, j); = \ const uint##TBITS##_t b =3D s390_vec_read_element##BITS(v3, j); = \ = \ --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738492; cv=none; d=zoho.com; s=zohoarc; b=g6F03D/V/F91DP5QclWrVdiW7zWgqOA91jaNxZtcKwbTcwiPHfGz2+hcXviSUuPbmZjQqRCGbBYFJqNoa8ukjZnUyFDSPOIzQ0fEAt8qKO8SoBjs+TxPCIjCmpPW5x2gV2zQQVEIs3EusZ+T9GNkm/Z+42DAkYX0AF+2Cc4ybt8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738492; 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=7KCr6i+4t+ywkOlX6JJoUgDJqdx6D7ofzVIFs9U50pA=; b=gSNTo8BfiQZ7DIfi6ji+tyHn3kirmOWtiIRzN+Gw5QFUkVfgDbImJTsslYhXuHvU6Svte6y7ZluwtlmXKMLOTROxRA8NP1YoePQuemPQeG3AxNT3zWLkJeNW5WYX3EIits9sO1iFQjNHv/P+8azKb6ChOv5iAHSEkiOvFgm//3c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738492198426.6613054227023; Tue, 22 Oct 2019 03:01:32 -0700 (PDT) Received: from localhost ([::1]:52648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqyo-0003eK-Jo for importer@patchew.org; Tue, 22 Oct 2019 06:01:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59357) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsQ-0005jo-VU for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsP-0005hH-Fv for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:54 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:59260 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsP-0005gx-CD for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:53 -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-346-7Y4BkShwNT2ve26Kejgd6w-1; Tue, 22 Oct 2019 05:54:49 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4956C1800D6A; Tue, 22 Oct 2019 09:54:48 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A0F7E194B2; Tue, 22 Oct 2019 09:54:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738092; 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=7KCr6i+4t+ywkOlX6JJoUgDJqdx6D7ofzVIFs9U50pA=; b=SlFPso1m2deNuX/znAY5jN2zbTmXB1tHxZ6copAAZfF2feRG/EA+HYx/NxcKeZBq++lhYq yhPxn7SuBPddIbv8BjV2jFaOrIrG1W6QtuwoPOM9EcHmc3QFTdEoZ4XowUBZ1FulsSBBSP fLNKVSvo5fofrYHnkErqBoHLWAM8vj4= From: Cornelia Huck To: Peter Maydell Subject: [PULL 4/9] s390x/tcg: Fix VECTOR MULTIPLY AND ADD * Date: Tue, 22 Oct 2019 11:54:23 +0200 Message-Id: <20191022095428.20780-5-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: 7Y4BkShwNT2ve26Kejgd6w-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand We missed that we always read a "double-wide even-odd element pair of the fourth operand". Fix it in all four variants. Fixes: 1b430aec4157 ("s390x/tcg: Implement VECTOR MULTIPLY AND ADD *") Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-3-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/vec_int_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/target/s390x/vec_int_helper.c b/target/s390x/vec_int_helper.c index 03ae8631d958..1b3aaecbdb3d 100644 --- a/target/s390x/vec_int_helper.c +++ b/target/s390x/vec_int_helper.c @@ -336,7 +336,7 @@ void HELPER(gvec_vmae##BITS)(void *v1, const void *v2, = const void *v3, \ for (i =3D 0, j =3D 0; i < (128 / TBITS); i++, j +=3D 2) { = \ int##TBITS##_t a =3D (int##BITS##_t)s390_vec_read_element##BITS(v2= , j); \ int##TBITS##_t b =3D (int##BITS##_t)s390_vec_read_element##BITS(v3= , j); \ - int##TBITS##_t c =3D (int##BITS##_t)s390_vec_read_element##BITS(v4= , j); \ + int##TBITS##_t c =3D s390_vec_read_element##TBITS(v4, i); = \ = \ s390_vec_write_element##TBITS(v1, i, a * b + c); = \ } = \ @@ -354,7 +354,7 @@ void HELPER(gvec_vmale##BITS)(void *v1, const void *v2,= const void *v3, \ for (i =3D 0, j =3D 0; i < (128 / TBITS); i++, j +=3D 2) { = \ uint##TBITS##_t a =3D s390_vec_read_element##BITS(v2, j); = \ uint##TBITS##_t b =3D s390_vec_read_element##BITS(v3, j); = \ - uint##TBITS##_t c =3D s390_vec_read_element##BITS(v4, j); = \ + uint##TBITS##_t c =3D s390_vec_read_element##TBITS(v4, i); = \ = \ s390_vec_write_element##TBITS(v1, i, a * b + c); = \ } = \ @@ -372,7 +372,7 @@ void HELPER(gvec_vmao##BITS)(void *v1, const void *v2, = const void *v3, \ for (i =3D 0, j =3D 1; i < (128 / TBITS); i++, j +=3D 2) { = \ int##TBITS##_t a =3D (int##BITS##_t)s390_vec_read_element##BITS(v2= , j); \ int##TBITS##_t b =3D (int##BITS##_t)s390_vec_read_element##BITS(v3= , j); \ - int##TBITS##_t c =3D (int##BITS##_t)s390_vec_read_element##BITS(v4= , j); \ + int##TBITS##_t c =3D s390_vec_read_element##TBITS(v4, i); = \ = \ s390_vec_write_element##TBITS(v1, i, a * b + c); = \ } = \ @@ -390,7 +390,7 @@ void HELPER(gvec_vmalo##BITS)(void *v1, const void *v2,= const void *v3, \ for (i =3D 0, j =3D 1; i < (128 / TBITS); i++, j +=3D 2) { = \ uint##TBITS##_t a =3D s390_vec_read_element##BITS(v2, j); = \ uint##TBITS##_t b =3D s390_vec_read_element##BITS(v3, j); = \ - uint##TBITS##_t c =3D s390_vec_read_element##BITS(v4, j); = \ + uint##TBITS##_t c =3D s390_vec_read_element##TBITS(v4, i); = \ = \ s390_vec_write_element##TBITS(v1, i, a * b + c); = \ } = \ --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738795; cv=none; d=zoho.com; s=zohoarc; b=dh6mUcPrm5LjYxAmML0rI95ItvZSQYapGl3lWLp30md1G/EVXb/J/4a/Ic/7jqjBnee9m043WAulrZ/7b+lzfiLBX7HXK29rlRPkb5cIo8JUsfW0DJ3VqMLTC3EekO0dXveHdOeELaWSRHnpsJqEPjWV7+F82nwX//Qno9hPnlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738795; 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=nGr4dBFYxGHxCcGYusZ15elORtCXZcgN+it4GugZNNg=; b=BvX8aVzrZr9YW4+HEVD20VZG0h/0MWLAgQ5Otc2QECKSwlyPMX+j4ERnyvKL1Q8p9DH4yM8rGGlcX6GRYg+ak94Ox/JoG97yHEWj9TGQx5NeQybWWcbNDnRpdCUTu2cLuuGa9IBceg2fzkwvQH9VfTn1auM7S3TOsUzWXwePW3c= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738795837690.6322596702498; Tue, 22 Oct 2019 03:06:35 -0700 (PDT) Received: from localhost ([::1]:52698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr3i-0000pf-Ch for importer@patchew.org; Tue, 22 Oct 2019 06:06:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59381) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsS-0005m9-8p for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsR-0005iJ-4b for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:56 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:26457 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsR-0005hy-16 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54: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-327-AuyqggneMd6LaexHorMubg-1; Tue, 22 Oct 2019 05:54:51 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 31BA78017D4; Tue, 22 Oct 2019 09:54:50 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BC3E960C5D; Tue, 22 Oct 2019 09:54:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738094; 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=nGr4dBFYxGHxCcGYusZ15elORtCXZcgN+it4GugZNNg=; b=PfmN8UckipHLuW2AVd34Ai6I+OXh7wUBYN2n1m4sYD9/XTEpn3GMy7SXIzlafTFL9uapTa GuAl+5rJpHlXPxDO+QcCZblyYRbE4q4ua/Y9Au1mfjo8Zd4+XRoAW/T5ecxIgI6J01iNot diwPBXAx+KgHHbS/AOczbIDyo78nVcc= From: Cornelia Huck To: Peter Maydell Subject: [PULL 5/9] s390x/tcg: Fix VECTOR SHIFT RIGHT ARITHMETIC BY BYTE Date: Tue, 22 Oct 2019 11:54:24 +0200 Message-Id: <20191022095428.20780-6-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-MC-Unique: AuyqggneMd6LaexHorMubg-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.120 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand We forgot to propagate the highest bit accross the high doubleword in two cases (shift >=3D64). Fixes: 5f724887e3dd ("s390x/tcg: Implement VECTOR SHIFT RIGHT ARITHMETIC") Reviewed-by: Richard Henderson Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-4-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/vec_int_helper.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/target/s390x/vec_int_helper.c b/target/s390x/vec_int_helper.c index 1b3aaecbdb3d..d38405848fed 100644 --- a/target/s390x/vec_int_helper.c +++ b/target/s390x/vec_int_helper.c @@ -70,15 +70,17 @@ static void s390_vec_sar(S390Vector *d, const S390Vecto= r *a, uint64_t count) d->doubleword[0] =3D a->doubleword[0]; d->doubleword[1] =3D a->doubleword[1]; } else if (count =3D=3D 64) { + tmp =3D (int64_t)a->doubleword[0] >> 63; d->doubleword[1] =3D a->doubleword[0]; - d->doubleword[0] =3D 0; + d->doubleword[0] =3D tmp; } else if (count < 64) { tmp =3D a->doubleword[1] >> count; d->doubleword[1] =3D deposit64(tmp, 64 - count, count, a->doublewo= rd[0]); d->doubleword[0] =3D (int64_t)a->doubleword[0] >> count; } else { + tmp =3D (int64_t)a->doubleword[0] >> 63; d->doubleword[1] =3D (int64_t)a->doubleword[0] >> (count - 64); - d->doubleword[0] =3D 0; + d->doubleword[0] =3D tmp; } } =20 --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738877; cv=none; d=zoho.com; s=zohoarc; b=QW1bie3uWc1nx7H+uo3C+7brzGYrDWj+f2Kahos7y3oE41uzOkxskhy48pNWgsQFsXe92PUXYLb9pajtCYQzxVlS+cje8mBDwDTTW46BdD36OzQ9O1Mc1dT2PSVtVsTfqdy68XPYy0tsOPcP5bTPJh3cdhjOeHr5i1uRyaiTLOQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738877; 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=T3B9vjpMKr00h9ZEq7Qqnt/7Ax1ma0913f7VWKa9L4o=; b=Zvqqqv5daflDiA8Qa0TqKYakWOg+x+PFIKpMHtvZQ9wx7jPdMcIODKhvRA4zL//0XPLoALDg6qCH823vMk5L8NrAGir+kvTq+TvrN6NBkXO3C/Qeoo2I7hoIotpAJ8hqMaYS2TbIz3E3YKqNFujffL9g40J1zXqwmq5dOGM4eBw= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738877646818.9010811404628; Tue, 22 Oct 2019 03:07:57 -0700 (PDT) Received: from localhost ([::1]:52732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr52-00035g-LB for importer@patchew.org; Tue, 22 Oct 2019 06:07:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59413) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsW-0005tj-O6 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsV-0005ld-JM for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:00 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:53886 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsV-0005lT-GQ for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:54:59 -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-371-YLae7-Y9PqqU0yODuFMXDQ-1; Tue, 22 Oct 2019 05:54:55 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5918C5E4; Tue, 22 Oct 2019 09:54:54 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A01FB60856; Tue, 22 Oct 2019 09:54:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738099; 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=T3B9vjpMKr00h9ZEq7Qqnt/7Ax1ma0913f7VWKa9L4o=; b=I2nVdcVpaSsmLN5EovJj7wFlcbrWRCB1G1TZStCIgk+pmV7KXk0j1bUbOOYUID/We5u9lJ P6Zn6ryXrRqX6AFhHCKN+HMl63M1kBATL3mH7D4xnSxwfdQfmuLCQpA1MKh+uElDnkvD5x UUt5KuThXTmiOM+6OdSar01m0+5tuQY= From: Cornelia Huck To: Peter Maydell Subject: [PULL 6/9] s390x/tcg: Fix VECTOR SUBTRACT COMPUTE BORROW INDICATION Date: Tue, 22 Oct 2019 11:54:25 +0200 Message-Id: <20191022095428.20780-7-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-MC-Unique: YLae7-Y9PqqU0yODuFMXDQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 207.211.31.81 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand Looks like my idea of what a "borrow" is was wrong. The PoP says: "If the resulting subtraction results in a carry out of bit zero, a value of one is placed in the corresponding element of the first operand; otherwise, a value of zero is placed in the corresponding element" As clarified by Richard, all we have to do is invert the result. Fixes: 1ee2d7ba72f6 ("s390x/tcg: Implement VECTOR SUBTRACT COMPUTE BORROW I= NDICATION") Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-5-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Cornelia Huck --- target/s390x/translate_vx.inc.c | 7 ++++--- target/s390x/vec_int_helper.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 5ce7bfb0afc5..6032021d82e7 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2132,12 +2132,12 @@ static DisasJumpType op_vs(DisasContext *s, DisasOp= s *o) =20 static void gen_scbi_i32(TCGv_i32 d, TCGv_i32 a, TCGv_i32 b) { - tcg_gen_setcond_i32(TCG_COND_LTU, d, a, b); + tcg_gen_setcond_i32(TCG_COND_GEU, d, a, b); } =20 static void gen_scbi_i64(TCGv_i64 d, TCGv_i64 a, TCGv_i64 b) { - tcg_gen_setcond_i64(TCG_COND_LTU, d, a, b); + tcg_gen_setcond_i64(TCG_COND_GEU, d, a, b); } =20 static void gen_scbi2_i64(TCGv_i64 dl, TCGv_i64 dh, TCGv_i64 al, @@ -2151,7 +2151,8 @@ static void gen_scbi2_i64(TCGv_i64 dl, TCGv_i64 dh, T= CGv_i64 al, tcg_gen_andi_i64(th, th, 1); tcg_gen_sub2_i64(tl, th, ah, zero, th, zero); tcg_gen_sub2_i64(tl, th, tl, th, bh, zero); - tcg_gen_andi_i64(dl, th, 1); + /* "invert" the result: -1 -> 0; 0 -> 1 */ + tcg_gen_addi_i64(dl, th, 1); tcg_gen_mov_i64(dh, zero); =20 tcg_temp_free_i64(th); diff --git a/target/s390x/vec_int_helper.c b/target/s390x/vec_int_helper.c index d38405848fed..0d6bc13dd603 100644 --- a/target/s390x/vec_int_helper.c +++ b/target/s390x/vec_int_helper.c @@ -593,7 +593,7 @@ void HELPER(gvec_vscbi##BITS)(void *v1, const void *v2,= const void *v3, \ const uint##BITS##_t a =3D s390_vec_read_element##BITS(v2, i); = \ const uint##BITS##_t b =3D s390_vec_read_element##BITS(v3, i); = \ = \ - s390_vec_write_element##BITS(v1, i, a < b); = \ + s390_vec_write_element##BITS(v1, i, a >=3D b); = \ } = \ } DEF_VSCBI(8) --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738332; cv=none; d=zoho.com; s=zohoarc; b=AuV565oECot+SYUIbmhIZ0hhs7kJH65rDumYZYCra2wjOK7T6jnWBMhqkNVzF/SYbhW3PjlYfBUUb6QxuDAvgYk8AcPSEjicoIwo4FMgkgh95jVxVCG4kZ1VqgXzmMi0WCTRJ19qZ3w6xb98p7QC3phHLiBTuos1wXhTvYqZsoQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738332; 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=un2KTAVd6ZU2512JadUGRYADd4HKwD1YIwHJQjkJQ5E=; b=GV1M6bGIw2SfRQwR8raFvg/N9K2IEIl9Fu4Ff5Qn/uil4KD9HTntrkEys7K+o0+yYpR1439B0/ByjMkFTijQSZW87pGTjTDFGsFX1iZx7lEMIXidIE+XtFqYaltASHRpNNB6T1nW+rNsg4eVX5M52bdWs9JLBMpvmUJMSJjB0/Q= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738332395273.921439992444; Tue, 22 Oct 2019 02:58:52 -0700 (PDT) Received: from localhost ([::1]:52608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqwF-0000d3-DR for importer@patchew.org; Tue, 22 Oct 2019 05:58:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59430) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsZ-0005y4-9F for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsY-0005mW-3b for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:03 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:31253 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsX-0005mJ-VI for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:02 -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-280-V6W5uMdqPiKAIDC40xrl9g-1; Tue, 22 Oct 2019 05:54:59 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AB865476; Tue, 22 Oct 2019 09:54:58 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CF8931001B39; Tue, 22 Oct 2019 09:54:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738101; 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=un2KTAVd6ZU2512JadUGRYADd4HKwD1YIwHJQjkJQ5E=; b=gF+aS/xoSaJocIc+TNrNm8j47FEGfbIOnLFw5X+dvXqZ9qWYtFJl74B2eMkgdy/iDDaVOF 4MBesdKVZEZdtp2ImP6CZItDxZA+9e0+Q8Wveq9YRe6dOwh5grRtUywi8rENkpWbIRIylR K5DhPzOzlrNCh8NF7Jm7i/JfoEWApKI= From: Cornelia Huck To: Peter Maydell Subject: [PULL 7/9] s390x/tcg: Fix VECTOR SUBTRACT WITH BORROW INDICATION Date: Tue, 22 Oct 2019 11:54:26 +0200 Message-Id: <20191022095428.20780-8-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-MC-Unique: V6W5uMdqPiKAIDC40xrl9g-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand Testing this, there seems to be something messed up. We are dealing with unsigned numbers. "Each operand is treated as an unsigned binary integer." Let's just implement as written in the PoP: "A subtraction is performed by adding the contents of the second operand with the bitwise complement of the third operand along with a borrow indication from the rightmost bit position of the fourth operand and the result is placed in the first operand." We can reuse gen_ac2_i64(). Fixes: 48390a7c2716 ("s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW INDI= CATION") Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-6-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Cornelia Huck --- target/s390x/translate_vx.inc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index 6032021d82e7..fd746ba35fb6 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2187,13 +2187,13 @@ static void gen_sbi2_i64(TCGv_i64 dl, TCGv_i64 dh, = TCGv_i64 al, TCGv_i64 ah, TCGv_i64 bl, TCGv_i64 bh, TCGv_i64 cl, TCGv_i64 c= h) { TCGv_i64 tl =3D tcg_temp_new_i64(); - TCGv_i64 zero =3D tcg_const_i64(0); + TCGv_i64 th =3D tcg_temp_new_i64(); =20 - tcg_gen_andi_i64(tl, cl, 1); - tcg_gen_sub2_i64(dl, dh, al, ah, bl, bh); - tcg_gen_sub2_i64(dl, dh, dl, dh, tl, zero); + tcg_gen_not_i64(tl, bl); + tcg_gen_not_i64(th, bh); + gen_ac2_i64(dl, dh, al, ah, tl, th, cl, ch); tcg_temp_free_i64(tl); - tcg_temp_free_i64(zero); + tcg_temp_free_i64(th); } =20 static DisasJumpType op_vsbi(DisasContext *s, DisasOps *o) --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738942; cv=none; d=zoho.com; s=zohoarc; b=YexPgnFU8xw2GPIqhWbOjU+yHnPUWI8vZkw3zROvGkSXmlIntUefhSjuVoYuH3bOimMV13r5/J1Z3D3UJds6W490X5LHchjY6fDe9ysUt50BiQ+X0iJ3bmg58qSO3DHiP4bxWTc1yWS7SfqPWvSBz/bUrHwymNkA9nfi68lYf00= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738942; 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=g7u+a8Xu34xzLa3Yrc9NKxMdoyG0YtRPO1KZeRJQ6V4=; b=Rdk/yV79Pzqxn+5p0d+/7DLhIv8JFT+qMCvq8Kmc2Fa830txuKb7rkM/vGOLAAtEnbpdqYQOOpcKRZkfCz6q6vycsu1itvn4RWynmNfJxjCRTYxJjXLyTwsOB8SYwgwC/mxfg4OeJagy3osbeUlBM2mHL4F6LvfPlagmVEhnhjM= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738942708510.12694455412054; Tue, 22 Oct 2019 03:09:02 -0700 (PDT) Received: from localhost ([::1]:52744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr65-00043U-Nd for importer@patchew.org; Tue, 22 Oct 2019 06:09:01 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59457) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsb-00061i-Fj for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsa-0005nO-Bb for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:05 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:46605 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsa-0005nA-7G for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:04 -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-74-HPKKE783MSKNM3S5qU9zWQ-1; Tue, 22 Oct 2019 05:55:01 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 81D2E80183E; Tue, 22 Oct 2019 09:55:00 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2F46119C4F; Tue, 22 Oct 2019 09:55:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738103; 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=g7u+a8Xu34xzLa3Yrc9NKxMdoyG0YtRPO1KZeRJQ6V4=; b=D9Qd+Yc9GyeoBO/hmUjO5R0k2WrlOnFKjKXTajzoyTQqILN0DJ0Z4Yu1jxf45Yj1HIKdkl 64ibfeiXctL6lykK5Ii+TWt+lalwBFkAuinghsxx3mQDN/22pzB6S0uJYQTSwk1lllj3oh WfQWHUHRaD5tm6z/RFj3WsjtiAmFU9U= From: Cornelia Huck To: Peter Maydell Subject: [PULL 8/9] s390x/tcg: Fix VECTOR SUBTRACT WITH BORROW COMPUTE BORROW INDICATION Date: Tue, 22 Oct 2019 11:54:27 +0200 Message-Id: <20191022095428.20780-9-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-MC-Unique: HPKKE783MSKNM3S5qU9zWQ-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.120 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: qemu-s390x@nongnu.org, Cornelia Huck , Richard Henderson , 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" From: David Hildenbrand The numbers are unsigned, the computation is wrong. "Each operand is treated as an unsigned binary integer". Let's implement as given in the PoP: "A subtraction is performed by adding the contents of the second operand with the bitwise complement of the third operand along with a borrow indication from the rightmost bit of the fourth operand." Reuse gen_accc2_i64(). Fixes: bc725e65152c ("s390x/tcg: Implement VECTOR SUBTRACT WITH BORROW COMP= UTE BORROW INDICATION") Signed-off-by: David Hildenbrand Message-Id: <20191021085715.3797-7-david@redhat.com> Reviewed-by: Richard Henderson Signed-off-by: Cornelia Huck --- target/s390x/translate_vx.inc.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/target/s390x/translate_vx.inc.c b/target/s390x/translate_vx.in= c.c index fd746ba35fb6..71059f9ca0a0 100644 --- a/target/s390x/translate_vx.inc.c +++ b/target/s390x/translate_vx.inc.c @@ -2214,20 +2214,13 @@ static void gen_sbcbi2_i64(TCGv_i64 dl, TCGv_i64 dh= , TCGv_i64 al, TCGv_i64 ah, { TCGv_i64 th =3D tcg_temp_new_i64(); TCGv_i64 tl =3D tcg_temp_new_i64(); - TCGv_i64 zero =3D tcg_const_i64(0); =20 - tcg_gen_andi_i64(tl, cl, 1); - tcg_gen_sub2_i64(tl, th, al, zero, tl, zero); - tcg_gen_sub2_i64(tl, th, tl, th, bl, zero); - tcg_gen_andi_i64(th, th, 1); - tcg_gen_sub2_i64(tl, th, ah, zero, th, zero); - tcg_gen_sub2_i64(tl, th, tl, th, bh, zero); - tcg_gen_andi_i64(dl, th, 1); - tcg_gen_mov_i64(dh, zero); + tcg_gen_not_i64(tl, bl); + tcg_gen_not_i64(th, bh); + gen_accc2_i64(dl, dh, al, ah, tl, th, cl, ch); =20 tcg_temp_free_i64(tl); tcg_temp_free_i64(th); - tcg_temp_free_i64(zero); } =20 static DisasJumpType op_vsbcbi(DisasContext *s, DisasOps *o) --=20 2.21.0 From nobody Sat May 4 01:48:03 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.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; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.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=1571738536; cv=none; d=zoho.com; s=zohoarc; b=eTsZ53ueWYtgf1mdX069nXu42ltqRzmThv6SXWcLyRBnpY/mf8vcdrbepGpGd5AY2vdLoZ8nIX4pgRvDcX+iko+EDspBRL1Dnh9zj0bICR/u6kmKsvN90IP5BnTZ3HdcQwuMaqmZQdt3aIOoMW5HTkMpW8/qI+kAAYJ2RZJXbww= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1571738536; 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=REel0uxylpp8LiKeGnsU0Tx+Qcl79+GyTo3iyWFgAIU=; b=WT5G2nkDyC8a17hGrc+rF7JiQ8zZNdS/G3aBGX7esJhmpSDRuU6uDPYu5Lh3QKXhZikDlqx00u1x3jM1BvrX2XvoVGUzrprTmmMJHtpvS00MUHXY/FgP7DP5023PcWzMcwGHCJsLEFCpNoE4knwd7IjSuGpzyWVi+WovDlszEnU= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.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 1571738536278885.1251071795991; Tue, 22 Oct 2019 03:02:16 -0700 (PDT) Received: from localhost ([::1]:52650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqzX-0004RM-5N for importer@patchew.org; Tue, 22 Oct 2019 06:02:15 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59521) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqsk-0006GI-8C for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iMqsi-0005ql-V6 for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:14 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:34230 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iMqsi-0005qV-Ru for qemu-devel@nongnu.org; Tue, 22 Oct 2019 05:55:12 -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-376-OGME-PpTOhe5mpuEFc-jTA-1; Tue, 22 Oct 2019 05:55:09 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E72FA80183E; Tue, 22 Oct 2019 09:55:07 +0000 (UTC) Received: from localhost (dhcp-192-218.str.redhat.com [10.33.192.218]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 013195C1D4; Tue, 22 Oct 2019 09:55:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1571738112; 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=REel0uxylpp8LiKeGnsU0Tx+Qcl79+GyTo3iyWFgAIU=; b=BuuStCrXOS3XL/qayCuj7yTeOs4/ZTkwCaZB0eFiKWU3QyNfr5nimrKWF5+80sZDUk26Wo e4arE1qOyHKegLFRvOH/cHvr8bz39CqbIFS/ScCsEuCduTqSIsBRFiZnZKBakb71MAjEXF CAoyf8Uk3gnX7FopmfHcA1nOp7lwCsI= From: Cornelia Huck To: Peter Maydell Subject: [PULL 9/9] s390x/kvm: Set default cpu model for all machine classes Date: Tue, 22 Oct 2019 11:54:28 +0200 Message-Id: <20191022095428.20780-10-cohuck@redhat.com> In-Reply-To: <20191022095428.20780-1-cohuck@redhat.com> References: <20191022095428.20780-1-cohuck@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: OGME-PpTOhe5mpuEFc-jTA-1 X-Mimecast-Spam-Score: 0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 205.139.110.61 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, qemu-s390x@nongnu.org, Igor Mammedov , Jiri Denemark 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 We have to set the default model of all machine classes, not just for the active one. Otherwise, "query-machines" will indicate the wrong CPU model ("qemu-s390x-cpu" instead of "host-s390x-cpu") as "default-cpu-type". Doing a {"execute":"query-machines"} under KVM now results in {"return": [ { "hotpluggable-cpus": true, "name": "s390-ccw-virtio-4.0", "numa-mem-supported": false, "default-cpu-type": "host-s390x-cpu", "cpu-max": 248, "deprecated": false}, { "hotpluggable-cpus": true, "name": "s390-ccw-virtio-2.7", "numa-mem-supported": false, "default-cpu-type": "host-s390x-cpu", "cpu-max": 248, "deprecated": false } ... Libvirt probes all machines via "-machine none,accel=3Dkvm:tcg" and will currently see the wrong CPU model under KVM. Reported-by: Jiri Denemark Reviewed-by: Thomas Huth Fixes: b6805e127c6b ("s390x: use generic cpu_model parsing") Cc: Igor Mammedov Signed-off-by: David Hildenbrand Message-Id: <20191021100515.6978-1-david@redhat.com> Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index c24c869e7703..0c9d14b4b115 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -320,11 +320,17 @@ void kvm_s390_set_max_pagesize(uint64_t pagesize, Err= or **errp) cap_hpage_1m =3D 1; } =20 -int kvm_arch_init(MachineState *ms, KVMState *s) +static void ccw_machine_class_foreach(ObjectClass *oc, void *opaque) { - MachineClass *mc =3D MACHINE_GET_CLASS(ms); + MachineClass *mc =3D MACHINE_CLASS(oc); =20 mc->default_cpu_type =3D S390_CPU_TYPE_NAME("host"); +} + +int kvm_arch_init(MachineState *ms, KVMState *s) +{ + object_class_foreach(ccw_machine_class_foreach, TYPE_S390_CCW_MACHINE, + false, NULL); =20 if (!kvm_check_extension(kvm_state, KVM_CAP_DEVICE_CTRL)) { error_report("KVM is missing capability KVM_CAP_DEVICE_CTRL - " --=20 2.21.0