From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020629; cv=none; d=zohomail.com; s=zohoarc; b=WlA86UOFYZqBjWNLQm3vCAL2QjeuefEdxxpCRARwTh9vGOwPUOcdi+VUsMitrU3SoDHCRq23iQavrPYxiEfva5z715ocUYklykeZbNneVgH5WJnUGp3TA7M12LdvcxeB5zgo533nl5AvM7CpLXsmaqQu9DEq2HXbHatWqYVTbyQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020629; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=36Lm0Bi7svE+whLJ15hKmgqYhOIWjqV9aJsJr4usng4=; b=RkAMpiNXoV9zoyD9dDs0gFK/s86D51LY4vReVHbzx06iLLq6LWk40Qj5ekwcPER0XJUsAtNhl2+GJFOB9E71aIcWlrZmrLlugyCXCIRpHDQfigxv/tgKxAOBnCJsdF3AbAtU9t5DhWG1ZPq2cMjE/sdmeC4UZdHIY0r45rjHEuQ= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594020629338159.0047494715185; Mon, 6 Jul 2020 00:30:29 -0700 (PDT) Received: from localhost ([::1]:34906 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLa7-0004kR-Qm for importer@patchew.org; Mon, 06 Jul 2020 03:30:27 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47286) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYY-0003PK-6E for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:51 -0400 Received: from us-smtp-2.mimecast.com ([207.211.31.81]:35024 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYU-0004Iz-G6 for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:49 -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-427-dddrdE6nPraz4zQ06hwXvg-1; Mon, 06 Jul 2020 03:28:41 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 63A21EC1A0; Mon, 6 Jul 2020 07:28:40 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58D8B5D9CC; Mon, 6 Jul 2020 07:28:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=36Lm0Bi7svE+whLJ15hKmgqYhOIWjqV9aJsJr4usng4=; b=XE3p99cpPi4lkxuWh2eNNK09UMHlnKWQg7Dm5m3WwmDk/vGj8fnSFYJOxVBWkH18KFx9YL sC4UfaCBSonVw5K4f9GR1yJPgUKoB40Igs2DUBlt7dZl6GW1rSFirsrNVw0ytwD8Ao6juK DUTpnUjYIBxPlB7hoIsJFNCC6vwyU+Q= X-MC-Unique: dddrdE6nPraz4zQ06hwXvg-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 1/6] fuzz: fix broken qtest check at rcu_disable_atfork Date: Mon, 6 Jul 2020 09:28:30 +0200 Message-Id: <20200706072835.23582-2-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:39:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Bulekov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov The qtest_enabled check introduced in d6919e4 always returns false, as it is called prior to configure_accelerators(). Instead of trying to skip rcu_disable_atfork in qemu_main, simply call rcu_enable_atfork in the fuzzer, after qemu_main returns. Reported-by: Thomas Huth Signed-off-by: Alexander Bulekov Message-Id: <20200618160516.2817-1-alxndr@bu.edu> Signed-off-by: Thomas Huth --- softmmu/vl.c | 12 +----------- tests/qtest/fuzz/fuzz.c | 3 +++ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/softmmu/vl.c b/softmmu/vl.c index 3e15ee2435..9da2e23144 100644 --- a/softmmu/vl.c +++ b/softmmu/vl.c @@ -3832,17 +3832,7 @@ void qemu_init(int argc, char **argv, char **envp) machine_class); =20 os_daemonize(); - - /* - * If QTest is enabled, keep the rcu_atfork enabled, since system proc= esses - * may be forked testing purposes (e.g. fork-server based fuzzing) The= fork - * should happen before a signle cpu instruction is executed, to preve= nt - * deadlocks. See commit 73c6e40, rcu: "completely disable pthread_atf= ork - * callbacks as soon as possible" - */ - if (!qtest_enabled()) { - rcu_disable_atfork(); - } + rcu_disable_atfork(); =20 if (pid_file && !qemu_write_pidfile(pid_file, &err)) { error_reportf_err(err, "cannot create PID file: "); diff --git a/tests/qtest/fuzz/fuzz.c b/tests/qtest/fuzz/fuzz.c index a44fe479db..a36d9038e0 100644 --- a/tests/qtest/fuzz/fuzz.c +++ b/tests/qtest/fuzz/fuzz.c @@ -211,5 +211,8 @@ int LLVMFuzzerInitialize(int *argc, char ***argv, char = ***envp) =20 qemu_init(result.we_wordc, result.we_wordv, NULL); =20 + /* re-enable the rcu atfork, which was previously disabled in qemu_ini= t */ + rcu_enable_atfork(); + return 0; } --=20 2.18.1 From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020631; cv=none; d=zohomail.com; s=zohoarc; b=SGbgJ9Gop4nCxCyZkpDZ56FUK3FUMfIeUOPUZI7TC/x9j8uamOV+4kkIW2hjUVUvMMoREruzQM5APeKW6J0idVE+BGjMWfCWR5wa2AsRiQBn/0ILOYJ4txrbGg7XRiwl6NFqdpMhLQUUggHYzyF7AUZYoySp7ei77gGTj9XMJXs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020631; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=sl4lnePHTVMyRzh87za++kiW+h7Hwz5DLgCYMcy9GQQ=; b=gepy6rJU96e25ceg3lQezJ7WcDWaidVvG/YNehyrou9Ty/F3gCepFOHdP6pR1QoGnleSFQGGxs67l/KI+gjCCegmA/RwWMrqd6ABL/u0FiJImcrBfF6Fk5p7aTLEzO2kGzV5VGUED5ppVXUyjnsC2UG/8uA8VJ815Cly4HcJcb0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594020631209896.6172386554647; Mon, 6 Jul 2020 00:30:31 -0700 (PDT) Received: from localhost ([::1]:34972 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLa9-0004m6-PS for importer@patchew.org; Mon, 06 Jul 2020 03:30:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYW-0003Oe-BP for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:48 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:26308 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYU-0004Iu-9z for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28: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-375-m7SLHQaIOGO8X9RdE7hMWw-1; Mon, 06 Jul 2020 03:28:42 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id B46A0EC1A1; Mon, 6 Jul 2020 07:28:41 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id B87095D9CC; Mon, 6 Jul 2020 07:28:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020525; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=sl4lnePHTVMyRzh87za++kiW+h7Hwz5DLgCYMcy9GQQ=; b=ii8JoFWKK5BlYjzdMi6W41kIvmSrAtuEXN5cuUxnSbO8/84WnBHndJE3N1synKbcrDbPGE Hr315sAJpnZ0rD4XT8Z5sdu8UwOQeTTbuofrqiCO3NYclCXW3dTzjRWdBOF+2Avfd78y1v NaX3y1/7Q3yndm4ldFQ8y5SaT7ySsmI= X-MC-Unique: m7SLHQaIOGO8X9RdE7hMWw-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 2/6] fuzz: do not use POSIX shm for coverage bitmap Date: Mon, 6 Jul 2020 09:28:31 +0200 Message-Id: <20200706072835.23582-3-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:39:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Alexander Bulekov , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Alexander Bulekov We used shm_open with mmap to share libfuzzer's coverage bitmap with child (runner) processes. The same functionality can be achieved with MAP_SHARED | MAP_ANONYMOUS, since we do not care about naming or permissioning the shared memory object. Signed-off-by: Alexander Bulekov Message-Id: <20200622165040.15121-1-alxndr@bu.edu> Reviewed-by: Darren Kenny Reviewed-by: Stefan Hajnoczi Signed-off-by: Thomas Huth --- tests/qtest/fuzz/fork_fuzz.c | 40 ++++++++++++------------------------ 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/tests/qtest/fuzz/fork_fuzz.c b/tests/qtest/fuzz/fork_fuzz.c index 2bd0851903..6ffb2a7937 100644 --- a/tests/qtest/fuzz/fork_fuzz.c +++ b/tests/qtest/fuzz/fork_fuzz.c @@ -17,39 +17,25 @@ =20 void counter_shm_init(void) { - char *shm_path =3D g_strdup_printf("/qemu-fuzz-cntrs.%d", getpid()); - int fd =3D shm_open(shm_path, O_CREAT | O_RDWR, S_IRUSR | S_IWUSR); - g_free(shm_path); - - if (fd =3D=3D -1) { - perror("Error: "); - exit(1); - } - if (ftruncate(fd, &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START) =3D= =3D -1) { - perror("Error: "); - exit(1); - } - /* Copy what's in the counter region to the shm.. */ - void *rptr =3D mmap(NULL , - &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START, - PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0); - memcpy(rptr, + /* Copy what's in the counter region to a temporary buffer.. */ + void *copy =3D malloc(&__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START); + memcpy(copy, &__FUZZ_COUNTERS_START, &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START); =20 - munmap(rptr, &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START); - - /* And map the shm over the counter region */ - rptr =3D mmap(&__FUZZ_COUNTERS_START, - &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START, - PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED, fd, 0); - - close(fd); - - if (!rptr) { + /* Map a shared region over the counter region */ + if (mmap(&__FUZZ_COUNTERS_START, + &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START, + PROT_READ | PROT_WRITE, MAP_SHARED | MAP_FIXED | MAP_ANONYMOU= S, + 0, 0) =3D=3D MAP_FAILED) { perror("Error: "); exit(1); } + + /* Copy the original data back to the counter-region */ + memcpy(&__FUZZ_COUNTERS_START, copy, + &__FUZZ_COUNTERS_END - &__FUZZ_COUNTERS_START); + free(copy); } =20 =20 --=20 2.18.1 From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020799; cv=none; d=zohomail.com; s=zohoarc; b=FpFOLd3u/9eb03DrE8hwce+FC9T1uRgap81OfHXqgoiCF7n9pSYFc88PBohD9GLjkizhvOhJZSRPdI1zUgyYk1+WiiW5z4TtbLQEHN2Jd55jfmjJUd/Jx6hzmnKvPmD3YivFL4E61oiqUTJ2fwpCtUKsdfGsGsvnlGOSE6X9suE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020799; 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=cOkxXc0ueiZaRz5g1RX9AYMF0NElufVcQ7OAgBddovc=; b=kP4MN8WZ15fxMVvd0hJyxklrZdSa/Kz2wmMYI/vEqqsNOuaPj2rWRkuIZ5ujyPnXs5XRUvl2R2j47OYK+Hu7sgVS5as31YlgGVZMAqZ6i9BisXvINR2B60RzDI1e+FqPMXCSRbW9dGSFJbstSXyQfiH77S3X+M7+bZIJNjXld+E= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass 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 1594020799409921.6837975348351; Mon, 6 Jul 2020 00:33:19 -0700 (PDT) Received: from localhost ([::1]:43552 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLcs-0000MD-4M for importer@patchew.org; Mon, 06 Jul 2020 03:33:18 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYa-0003Pp-7T for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:53 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42364 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYW-0004Je-HG for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:51 -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-215-a0KkDMrvMJyprIJimDnk8A-1; Mon, 06 Jul 2020 03:28:43 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EC1A980183C; Mon, 6 Jul 2020 07:28:42 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FB4A5D9CC; Mon, 6 Jul 2020 07:28:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020527; 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=cOkxXc0ueiZaRz5g1RX9AYMF0NElufVcQ7OAgBddovc=; b=dLFjaNQqXbFCEls8Ds234g97NOV8hbzE+8i9SBbnn35bV4nCeZqxszbzViVIxDLyCREqTm 7xAYoFeA6dU6eRtW/rLEzNMvR3kLct+S4CIFxvdOjOhxAEGuvhceveKLFhUKfkKDICWlhW Q2NEVJyWvJcBKNtGUwfll++cVpkbUr0= X-MC-Unique: a0KkDMrvMJyprIJimDnk8A-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 3/6] tests/qtest: Unify the test for the xenfv and xenpv machines Date: Mon, 6 Jul 2020 09:28:32 +0200 Message-Id: <20200706072835.23582-4-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.120; envelope-from=thuth@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:52:41 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -40 X-Spam_score: -4.1 X-Spam_bar: ---- X-Spam_report: (-4.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) We have the same check in three places. Let's unify it in a central place instead. Message-Id: <20200622104339.21000-1-thuth@redhat.com> Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- tests/qtest/device-introspect-test.c | 5 ----- tests/qtest/libqtest.c | 4 ++++ tests/qtest/qom-test.c | 5 ----- tests/qtest/test-hmp.c | 5 ----- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/tests/qtest/device-introspect-test.c b/tests/qtest/device-intr= ospect-test.c index f2c1576cae..9abb5ec889 100644 --- a/tests/qtest/device-introspect-test.c +++ b/tests/qtest/device-introspect-test.c @@ -287,11 +287,6 @@ static void add_machine_test_case(const char *mname) { char *path, *args; =20 - /* Ignore blacklisted machines */ - if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { - return; - } - path =3D g_strdup_printf("device/introspect/concrete/defaults/%s", mna= me); args =3D g_strdup_printf("-M %s", mname); qtest_add_data_func(path, args, test_device_intro_concrete); diff --git a/tests/qtest/libqtest.c b/tests/qtest/libqtest.c index 49075b55a1..fd4680590d 100644 --- a/tests/qtest/libqtest.c +++ b/tests/qtest/libqtest.c @@ -1232,6 +1232,10 @@ void qtest_cb_for_every_machine(void (*cb)(const cha= r *machine), qstr =3D qobject_to(QString, qobj); g_assert(qstr); mname =3D qstring_get_str(qstr); + /* Ignore machines that cannot be used for qtests */ + if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { + continue; + } if (!skip_old_versioned || !qtest_is_old_versioned_machine(mname))= { cb(mname); } diff --git a/tests/qtest/qom-test.c b/tests/qtest/qom-test.c index e338a41194..1acf0d7369 100644 --- a/tests/qtest/qom-test.c +++ b/tests/qtest/qom-test.c @@ -81,11 +81,6 @@ static void add_machine_test_case(const char *mname) { char *path; =20 - /* Ignore blacklisted machines that have known problems */ - if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { - return; - } - path =3D g_strdup_printf("qom/%s", mname); qtest_add_data_func(path, g_strdup(mname), test_machine); g_free(path); diff --git a/tests/qtest/test-hmp.c b/tests/qtest/test-hmp.c index b8b1271b9e..d5e7ebd176 100644 --- a/tests/qtest/test-hmp.c +++ b/tests/qtest/test-hmp.c @@ -143,11 +143,6 @@ static void add_machine_test_case(const char *mname) { char *path; =20 - /* Ignore blacklisted machines that have known problems */ - if (!memcmp("xenfv", mname, 5) || g_str_equal("xenpv", mname)) { - return; - } - path =3D g_strdup_printf("hmp/%s", mname); qtest_add_data_func(path, g_strdup(mname), test_machine); g_free(path); --=20 2.18.1 From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020726; cv=none; d=zohomail.com; s=zohoarc; b=m8VPsVWu3kPUQNQBDxWMF5keb3EhPk1ZOxrIF2FX2LTefeiui2DINVpy9KWUPxnZgYuIv9FMzt5vcvjvgGBMpf/wPMp5E3xrqWPD2LKi6OHWDan+sITzqWICYsyWq6Yajb4GenxbBMKuqRs8DJ/ZWf1Ea8v90fvBmeM73dwrrN0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020726; h=Content-Type:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:Message-ID:References:Sender:Subject:To; bh=jGUD4WlCyQd1mVPrOaPOyVNr+AJza26/lZEXObIon+Y=; b=BrjKk4pSClncmM3oWWwAYDhZLSmCB3MFVTeCwaVxbRDFC7IRSG9DZUsa0Gv640ilv4GTRhUK5Ut9cQPyhkQEg9FJBdog0cnmftksrlUe6lb4XytgLfKnmrGIk5lggHR5Onqvv+sTQ1ZM5MCdHu2O41gu5gRkQMzwySQTyb5serg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass 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 1594020726149241.13917905599703; Mon, 6 Jul 2020 00:32:06 -0700 (PDT) Received: from localhost ([::1]:40240 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLbg-0007BO-Ty for importer@patchew.org; Mon, 06 Jul 2020 03:32:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYZ-0003PV-9X for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:51 -0400 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:56784 helo=us-smtp-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYW-0004JT-7s for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:50 -0400 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-260-gWOa-RSwMR6EpfLydGNjLg-1; Mon, 06 Jul 2020 03:28:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 300408014D4; Mon, 6 Jul 2020 07:28:44 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 578985D9CC; Mon, 6 Jul 2020 07:28:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020527; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:content-type:content-type:in-reply-to:in-reply-to: references:references; bh=jGUD4WlCyQd1mVPrOaPOyVNr+AJza26/lZEXObIon+Y=; b=ahJlcNplroVJqZLHVKT6GJ94kWjoYfnQ7BuXrWKAEvw35diZpfcSToLwk5gV254tzHSNjK TM0rmafPExVPYfI93AzN0dlTV0jfaFMx2onX3s0uOesaXYPg5LA/LILBIMmLs/yS055Ay2 5DU+Rkys4/2GZfQ9P4DH6d05wj120Ig= X-MC-Unique: gWOa-RSwMR6EpfLydGNjLg-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 4/6] configure / util: Auto-detect the availability of openpty() Date: Mon, 6 Jul 2020 09:28:33 +0200 Message-Id: <20200706072835.23582-5-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.120; envelope-from=thuth@redhat.com; helo=us-smtp-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:22:37 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Recent versions of Solaris (v11.4) now feature an openpty() function, too, causing a build failure since we ship our own implementation of openpty() for Solaris in util/qemu-openpty.c so far. Since there are now both variants available in the wild, with and without this function (and illumos is said to not have this function yet), let's introduce a proper HAVE_OPENPTY define for this to fix the build failure. Message-Id: <20200702143955.678-1-thuth@redhat.com> Tested-by: Michele Denber Signed-off-by: Thomas Huth --- configure | 9 ++++++++- util/qemu-openpty.c | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 8a65240d4a..f8dc64beab 100755 --- a/configure +++ b/configure @@ -5134,10 +5134,14 @@ extern int openpty(int *am, int *as, char *name, vo= id *termp, void *winp); int main(void) { return openpty(0, 0, 0, 0, 0); } EOF =20 -if ! compile_prog "" "" ; then +have_openpty=3D"no" +if compile_prog "" "" ; then + have_openpty=3D"yes" +else if compile_prog "" "-lutil" ; then libs_softmmu=3D"-lutil $libs_softmmu" libs_tools=3D"-lutil $libs_tools" + have_openpty=3D"yes" fi fi =20 @@ -7380,6 +7384,9 @@ fi if test "$have_broken_size_max" =3D "yes" ; then echo "HAVE_BROKEN_SIZE_MAX=3Dy" >> $config_host_mak fi +if test "$have_openpty" =3D "yes" ; then + echo "HAVE_OPENPTY=3Dy" >> $config_host_mak +fi =20 # Work around a system header bug with some kernel/XFS header # versions where they both try to define 'struct fsxattr': diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c index 2e8b43bdf5..4b8df96f38 100644 --- a/util/qemu-openpty.c +++ b/util/qemu-openpty.c @@ -52,7 +52,9 @@ #endif =20 #ifdef __sun__ -/* Once Solaris has openpty(), this is going to be removed. */ + +#if !defined(HAVE_OPENPTY) +/* Once illumos has openpty(), this is going to be removed. */ static int openpty(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) { @@ -93,6 +95,7 @@ err: close(mfd); return -1; } +#endif =20 static void cfmakeraw (struct termios *termios_p) { --=20 2.18.1 From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020864; cv=none; d=zohomail.com; s=zohoarc; b=jf9rjKPFqCUob925bfFNcwCiS5xiSfHe0Ik69txmKljnqVwRXb0bFzQMpfUOA32pUx8AFh1M14VlNJjLY6lGT5fQo9RBlcZDcvBIdjDzHylA9LNB2s17DBsZTUNtnjyzdlESpEUAkM/OI4MuytQ8HlZtSTzVtvywOhQY/KRDegY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020864; 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=NpLhPcTzNcz5EtG/xYX0R96tjV4b1A8773ZUPrdDRUg=; b=EAnFFDixheDdU4K5uGuEzm8jIFL0t/gFT7e7mE7iznu8HOdnldcNNnYcB7FK6zmBtol6l7bxYXhStrLcfKGtFIsL5/sphxw5S/hrM2iIOYouYgptA5AmR6Acu8VtbB2dlvh7lOYIm/NjRDFKD0NqcX6D+zuAVsIRrvZALHHSU5s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1594020864195937.7667004972963; Mon, 6 Jul 2020 00:34:24 -0700 (PDT) Received: from localhost ([::1]:45672 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLdv-0001G3-16 for importer@patchew.org; Mon, 06 Jul 2020 03:34:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47370) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYb-0003QL-Nd for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:53 -0400 Received: from us-smtp-1.mimecast.com ([207.211.31.81]:52266 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYY-0004Lt-VK for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28: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-123-LecQw-LdOfGZXFgyTts6KQ-1; Mon, 06 Jul 2020 03:28:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D3AC28014D7; Mon, 6 Jul 2020 07:28:46 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8F3235D9CC; Mon, 6 Jul 2020 07:28:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020530; 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=NpLhPcTzNcz5EtG/xYX0R96tjV4b1A8773ZUPrdDRUg=; b=CLqDLsb6CVKUaG7UCVGgtVYAPkOFzeQJsfMCsAzmphoRP5nk44drYG91Vu9j5UGtUwS8lO NHPJRvmwUqPF3gzQec1x/I38C7H0sXC1uGO9rj5rEZEfhPKEM+NVArulagxfXgDzAkUBxO sMlgeOpJfv39WvdRgQHw9zpoOOVWED8= X-MC-Unique: LecQw-LdOfGZXFgyTts6KQ-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 5/6] hw/m68k/mcf5206: Replace remaining hw_error()s by qemu_log_mask() Date: Mon, 6 Jul 2020 09:28:34 +0200 Message-Id: <20200706072835.23582-6-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=207.211.31.81; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:39:15 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Huth , qemu-devel@nongnu.org, Thomas Huth Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) From: Thomas Huth hw_error() dumps the CPU state and exits QEMU. This is ok during initial code development (to see where the guest code is currently executing), but it is certainly not the desired behavior that we want to present to normal users, and it can also cause trouble when e.g. fuzzing devices. Thus let's replace these hw_error()s by qemu_log_mask()s instead. Message-Id: <20200611055807.15921-1-huth@tuxfamily.org> Reviewed-by: Laurent Vivier Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- hw/m68k/mcf5206.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/hw/m68k/mcf5206.c b/hw/m68k/mcf5206.c index a2fef04f8e..94a37a1a46 100644 --- a/hw/m68k/mcf5206.c +++ b/hw/m68k/mcf5206.c @@ -10,7 +10,6 @@ #include "qemu/error-report.h" #include "qemu/log.h" #include "cpu.h" -#include "hw/hw.h" #include "hw/irq.h" #include "hw/m68k/mcf.h" #include "qemu/timer.h" @@ -69,10 +68,16 @@ static void m5206_timer_recalibrate(m5206_timer_state *= s) if (mode =3D=3D 2) prescale *=3D 16; =20 - if (mode =3D=3D 3 || mode =3D=3D 0) - hw_error("m5206_timer: mode %d not implemented\n", mode); - if ((s->tmr & TMR_FRR) =3D=3D 0) - hw_error("m5206_timer: free running mode not implemented\n"); + if (mode =3D=3D 3 || mode =3D=3D 0) { + qemu_log_mask(LOG_UNIMP, "m5206_timer: mode %d not implemented\n", + mode); + goto exit; + } + if ((s->tmr & TMR_FRR) =3D=3D 0) { + qemu_log_mask(LOG_UNIMP, + "m5206_timer: free running mode not implemented\n"); + goto exit; + } =20 /* Assume 66MHz system clock. */ ptimer_set_freq(s->timer, 66000000 / prescale); @@ -391,7 +396,9 @@ static uint32_t m5206_mbar_readb(void *opaque, hwaddr o= ffset) m5206_mbar_state *s =3D (m5206_mbar_state *)opaque; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR read offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_P= RIX, + offset); + return 0; } if (m5206_mbar_width[offset >> 2] > 1) { uint16_t val; @@ -410,7 +417,9 @@ static uint32_t m5206_mbar_readw(void *opaque, hwaddr o= ffset) int width; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR read offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_P= RIX, + offset); + return 0; } width =3D m5206_mbar_width[offset >> 2]; if (width > 2) { @@ -434,7 +443,9 @@ static uint32_t m5206_mbar_readl(void *opaque, hwaddr o= ffset) int width; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR read offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR read offset 0x%" HWADDR_P= RIX, + offset); + return 0; } width =3D m5206_mbar_width[offset >> 2]; if (width < 4) { @@ -458,7 +469,9 @@ static void m5206_mbar_writeb(void *opaque, hwaddr offs= et, int width; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR write offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_= PRIX, + offset); + return; } width =3D m5206_mbar_width[offset >> 2]; if (width > 1) { @@ -482,7 +495,9 @@ static void m5206_mbar_writew(void *opaque, hwaddr offs= et, int width; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR write offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_= PRIX, + offset); + return; } width =3D m5206_mbar_width[offset >> 2]; if (width > 2) { @@ -510,7 +525,9 @@ static void m5206_mbar_writel(void *opaque, hwaddr offs= et, int width; offset &=3D 0x3ff; if (offset >=3D 0x200) { - hw_error("Bad MBAR write offset 0x%x", (int)offset); + qemu_log_mask(LOG_GUEST_ERROR, "Bad MBAR write offset 0x%" HWADDR_= PRIX, + offset); + return; } width =3D m5206_mbar_width[offset >> 2]; if (width < 4) { --=20 2.18.1 From nobody Sun May 5 12:39:00 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1594020728; cv=none; d=zohomail.com; s=zohoarc; b=aFCD93Mo81u+2AnEb2W9wjVChGnegqWsOT/bYpte3p2kcyfAf7Luf1tJTtJe2SB5leKgnTg/GZjPGociUBgmU0DlCEq5c34UbXbSD/RzH381pNRVzQoUG1elL8lOAYW5WXPZLQzZbbyEgXpeeFzSvQpjCV+kMMYJDH1nF8RB2kA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1594020728; 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=w7fayRfJ+K1Jey/JgnKgo/mWJTVh1oMX96XU6QaK7nY=; b=U1wNzeHwsmOsvCTBk9bEWKUVrzfVdUAK4VyJtK9yGDcp9qfamxLhQr52GDBzff2UXdtq+i6w4uVRzJo9HmdBLZ8u/xgFjDSrJqp3mdzoAzWDKR/82dgNteM+rVyMY5ZMMF9GnVCKuq1ZpQWkGM+nHWhOY9P03VTy3mAQue9DohM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass 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 1594020728467430.5444511154029; Mon, 6 Jul 2020 00:32:08 -0700 (PDT) Received: from localhost ([::1]:40324 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jsLbj-0007FD-3I for importer@patchew.org; Mon, 06 Jul 2020 03:32:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:47390) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jsLYe-0003Rh-Li for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:57 -0400 Received: from us-smtp-2.mimecast.com ([205.139.110.61]:35590 helo=us-smtp-delivery-1.mimecast.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.90_1) (envelope-from ) id 1jsLYc-0004OD-JV for qemu-devel@nongnu.org; Mon, 06 Jul 2020 03:28:56 -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-486-ihA_DYXXNsiQptRpw_1KaQ-1; Mon, 06 Jul 2020 03:28:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 159A5107ACF3; Mon, 6 Jul 2020 07:28:48 +0000 (UTC) Received: from thuth.com (ovpn-112-144.ams2.redhat.com [10.36.112.144]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3D09C5D9CC; Mon, 6 Jul 2020 07:28:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1594020533; 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=w7fayRfJ+K1Jey/JgnKgo/mWJTVh1oMX96XU6QaK7nY=; b=M0gvpWVjRjXGa/YEwQYPPfkQA3Nm99sM6Thm1K6b2Y6g9WkCMgsEHDhsKuVzFRPZ8YdMLR 57VvlUMS+9fJUGQxifUPDy9SYvGYCdKGIrhGl+Xn46yQi4guO3PzpMaomBab1dbO1SCbVx D1ARAe9/PAeNG0PVDgJnqAjvTtJHAPA= X-MC-Unique: ihA_DYXXNsiQptRpw_1KaQ-1 From: Thomas Huth To: Peter Maydell Subject: [PULL 6/6] tests/acceptance: Add a test for the sun4u sparc64 machine Date: Mon, 6 Jul 2020 09:28:35 +0200 Message-Id: <20200706072835.23582-7-thuth@redhat.com> In-Reply-To: <20200706072835.23582-1-thuth@redhat.com> References: <20200706072835.23582-1-thuth@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=thuth@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=205.139.110.61; envelope-from=thuth@redhat.com; helo=us-smtp-delivery-1.mimecast.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/06 01:59:39 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -30 X-Spam_score: -3.1 X-Spam_bar: --- X-Spam_report: (-3.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=_AUTOLEARN X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: pass (identity @redhat.com) We can use the image from the advent calendar 2018 to test the sun4u machine. It's not using the "QEMU advent calendar" string, so we can not use the do_test_advcal_2018() from boot_linux_console.py, thus let's also put it into a separate file to also be able to add an entry to the MAINTAINERS file. Message-Id: <20200704173519.26087-1-thuth@redhat.com> Tested-by: Mark Cave-Ayland Tested-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Thomas Huth --- MAINTAINERS | 1 + tests/acceptance/machine_sparc64_sun4u.py | 36 +++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 tests/acceptance/machine_sparc64_sun4u.py diff --git a/MAINTAINERS b/MAINTAINERS index c31c878c63..a8e2d46e9d 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -1319,6 +1319,7 @@ F: include/hw/pci-host/sabre.h F: hw/pci-bridge/simba.c F: include/hw/pci-bridge/simba.h F: pc-bios/openbios-sparc64 +F: tests/acceptance/machine_sparc64_sun4u.py =20 Sun4v M: Artyom Tarasenko diff --git a/tests/acceptance/machine_sparc64_sun4u.py b/tests/acceptance/m= achine_sparc64_sun4u.py new file mode 100644 index 0000000000..458165500e --- /dev/null +++ b/tests/acceptance/machine_sparc64_sun4u.py @@ -0,0 +1,36 @@ +# Functional test that boots a Linux kernel and checks the console +# +# Copyright (c) 2020 Red Hat, Inc. +# +# Author: +# Thomas Huth +# +# This work is licensed under the terms of the GNU GPL, version 2 or +# later. See the COPYING file in the top-level directory. + +import os + +from avocado_qemu import wait_for_console_pattern +from avocado.utils import archive +from boot_linux_console import LinuxKernelTest + +class Sun4uMachine(LinuxKernelTest): + """Boots the Linux kernel and checks that the console is operational""" + + timeout =3D 90 + + def test_sparc64_sun4u(self): + """ + :avocado: tags=3Darch:sparc64 + :avocado: tags=3Dmachine:sun4u + """ + tar_url =3D ('https://www.qemu-advent-calendar.org' + '/2018/download/day23.tar.xz') + tar_hash =3D '142db83cd974ffadc4f75c8a5cad5bcc5722c240' + file_path =3D self.fetch_asset(tar_url, asset_hash=3Dtar_hash) + archive.extract(file_path, self.workdir) + self.vm.set_console() + self.vm.add_args('-kernel', self.workdir + '/day23/vmlinux', + '-append', self.KERNEL_COMMON_COMMAND_LINE) + self.vm.launch() + wait_for_console_pattern(self, 'Starting logging: OK') --=20 2.18.1