From patchwork Tue Oct 22 09:54:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 33D651515 for ; Tue, 22 Oct 2019 09:55:56 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0740320B7C for ; Tue, 22 Oct 2019 09:55:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="LkXyUsXU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0740320B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52588 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqtO-0007GC-RR for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 05:55:54 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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, const CpuModelInfo *info, visitor = qobject_input_visitor_new(info->props); visit_start_struct(visitor, NULL, NULL, 0, errp); if (*errp) { + visit_free(visitor); object_unref(obj); return; } From patchwork Tue Oct 22 09:54:21 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204101 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B4FA51515 for ; Tue, 22 Oct 2019 09:59:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8B7B720B7C for ; Tue, 22 Oct 2019 09:59:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Vu2OLjqQ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8B7B720B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqx6-0002dG-OT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 05:59:44 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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_real") 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 |= PAGE_WRITE_INV; if (is_low_address(raddr) && rw == MMU_DATA_STORE) { /* LAP sets bit 56 */ - *tec = (raddr & TARGET_PAGE_MASK) - | (rw == MMU_DATA_STORE ? FS_WRITE : FS_READ) - | 0x80; + *tec = (raddr & TARGET_PAGE_MASK) | FS_WRITE | 0x80; return PGM_PROTECTION; } } From patchwork Tue Oct 22 09:54:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204127 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C3EFF112C for ; Tue, 22 Oct 2019 10:03:42 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9AB3D2064B for ; Tue, 22 Oct 2019 10:03:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="JNK5/SNK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9AB3D2064B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52670 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr0v-0006Nc-AT for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:03:41 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 = 0, j = 0; i < (128 / TBITS); i++, j += 2) { \ + for (i = 0, j = 1; i < (128 / TBITS); i++, j += 2) { \ const uint##TBITS##_t a = s390_vec_read_element##BITS(v2, j); \ const uint##TBITS##_t b = s390_vec_read_element##BITS(v3, j); \ \ From patchwork Tue Oct 22 09:54:23 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204103 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 29A4F913 for ; Tue, 22 Oct 2019 10:00:41 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 005FC20B7C for ; Tue, 22 Oct 2019 10:00:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SlFPso1m" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 005FC20B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqxz-0003eK-E1 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:00:39 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 = 0, j = 0; i < (128 / TBITS); i++, j += 2) { \ int##TBITS##_t a = (int##BITS##_t)s390_vec_read_element##BITS(v2, j); \ int##TBITS##_t b = (int##BITS##_t)s390_vec_read_element##BITS(v3, j); \ - int##TBITS##_t c = (int##BITS##_t)s390_vec_read_element##BITS(v4, j); \ + int##TBITS##_t c = 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 = 0, j = 0; i < (128 / TBITS); i++, j += 2) { \ uint##TBITS##_t a = s390_vec_read_element##BITS(v2, j); \ uint##TBITS##_t b = s390_vec_read_element##BITS(v3, j); \ - uint##TBITS##_t c = s390_vec_read_element##BITS(v4, j); \ + uint##TBITS##_t c = 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 = 0, j = 1; i < (128 / TBITS); i++, j += 2) { \ int##TBITS##_t a = (int##BITS##_t)s390_vec_read_element##BITS(v2, j); \ int##TBITS##_t b = (int##BITS##_t)s390_vec_read_element##BITS(v3, j); \ - int##TBITS##_t c = (int##BITS##_t)s390_vec_read_element##BITS(v4, j); \ + int##TBITS##_t c = 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 = 0, j = 1; i < (128 / TBITS); i++, j += 2) { \ uint##TBITS##_t a = s390_vec_read_element##BITS(v2, j); \ uint##TBITS##_t b = s390_vec_read_element##BITS(v3, j); \ - uint##TBITS##_t c = s390_vec_read_element##BITS(v4, j); \ + uint##TBITS##_t c = s390_vec_read_element##TBITS(v4, i); \ \ s390_vec_write_element##TBITS(v1, i, a * b + c); \ } \ From patchwork Tue Oct 22 09:54:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204143 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6C20613BD for ; Tue, 22 Oct 2019 10:06:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 429152064B for ; Tue, 22 Oct 2019 10:06:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PfmN8Uck" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 429152064B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52698 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr3D-0000pf-CR for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:06:03 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" From: David Hildenbrand We forgot to propagate the highest bit accross the high doubleword in two cases (shift >=64). 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 S390Vector *a, uint64_t count) d->doubleword[0] = a->doubleword[0]; d->doubleword[1] = a->doubleword[1]; } else if (count == 64) { + tmp = (int64_t)a->doubleword[0] >> 63; d->doubleword[1] = a->doubleword[0]; - d->doubleword[0] = 0; + d->doubleword[0] = tmp; } else if (count < 64) { tmp = a->doubleword[1] >> count; d->doubleword[1] = deposit64(tmp, 64 - count, count, a->doubleword[0]); d->doubleword[0] = (int64_t)a->doubleword[0] >> count; } else { + tmp = (int64_t)a->doubleword[0] >> 63; d->doubleword[1] = (int64_t)a->doubleword[0] >> (count - 64); - d->doubleword[0] = 0; + d->doubleword[0] = tmp; } } From patchwork Tue Oct 22 09:54:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204145 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD57013BD for ; Tue, 22 Oct 2019 10:07:45 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A402920700 for ; Tue, 22 Oct 2019 10:07:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="I2nVdcVp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A402920700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52732 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr4q-00035g-TO for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:07:44 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 INDICATION") 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.inc.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, DisasOps *o) 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); } 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); } 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, TCGv_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); 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 = s390_vec_read_element##BITS(v2, i); \ const uint##BITS##_t b = s390_vec_read_element##BITS(v3, i); \ \ - s390_vec_write_element##BITS(v1, i, a < b); \ + s390_vec_write_element##BITS(v1, i, a >= b); \ } \ } DEF_VSCBI(8) From patchwork Tue Oct 22 09:54:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204097 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23132139A for ; Tue, 22 Oct 2019 09:57:40 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EE17020B7C for ; Tue, 22 Oct 2019 09:57:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gF+aS/xo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EE17020B7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqv4-0000d3-Fm for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 05:57:38 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 INDICATION") 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.inc.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 ch) { TCGv_i64 tl = tcg_temp_new_i64(); - TCGv_i64 zero = tcg_const_i64(0); + TCGv_i64 th = tcg_temp_new_i64(); - 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); } static DisasJumpType op_vsbi(DisasContext *s, DisasOps *o) From patchwork Tue Oct 22 09:54:27 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204147 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CC87D1895 for ; Tue, 22 Oct 2019 10:08:51 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A349120700 for ; Tue, 22 Oct 2019 10:08:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="D9Qd+Yc9" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A349120700 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52744 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMr5u-00043U-Pv for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:08:50 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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 COMPUTE 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.inc.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 = tcg_temp_new_i64(); TCGv_i64 tl = tcg_temp_new_i64(); - TCGv_i64 zero = tcg_const_i64(0); - 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); tcg_temp_free_i64(tl); tcg_temp_free_i64(th); - tcg_temp_free_i64(zero); } static DisasJumpType op_vsbcbi(DisasContext *s, DisasOps *o) From patchwork Tue Oct 22 09:54:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 11204121 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 96D771515 for ; Tue, 22 Oct 2019 10:01:37 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6DCC42064B for ; Tue, 22 Oct 2019 10:01:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="BuuStCrX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DCC42064B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Received: from localhost ([::1]:52650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iMqyt-0004RM-Be for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Oct 2019 06:01:36 -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 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= 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) 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 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" 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=kvm: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, Error **errp) cap_hpage_1m = 1; } -int kvm_arch_init(MachineState *ms, KVMState *s) +static void ccw_machine_class_foreach(ObjectClass *oc, void *opaque) { - MachineClass *mc = MACHINE_GET_CLASS(ms); + MachineClass *mc = MACHINE_CLASS(oc); mc->default_cpu_type = 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); if (!kvm_check_extension(kvm_state, KVM_CAP_DEVICE_CTRL)) { error_report("KVM is missing capability KVM_CAP_DEVICE_CTRL - "