From patchwork Tue Oct 13 14:05:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 271358 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 559F1C433E7 for ; Tue, 13 Oct 2020 14:07:13 +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 B4594247BF for ; Tue, 13 Oct 2020 14:07:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="j7ndtEqK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4594247BF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:52480 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSKxH-0000GJ-Pd for qemu-devel@archiver.kernel.org; Tue, 13 Oct 2020 10:07:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54456) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSKvz-0007VG-JA for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:05:47 -0400 Received: from mail-qt1-x841.google.com ([2607:f8b0:4864:20::841]:44436) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSKvx-0006KP-TV for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:05:47 -0400 Received: by mail-qt1-x841.google.com with SMTP id m65so1620122qte.11 for ; Tue, 13 Oct 2020 07:05:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=UycC6Mqg0Rldvi+xLfIHf2k2nJwmsZhNp06Zk4OLYro=; b=j7ndtEqKZgLfhAIljTN576v9T9UpCWsu0U9cLrcooB4UsntSbD8jLHzUpXYboRcdB6 xg24x4dJuq1mnuALDZ4kMJqlppQhKH646glr2UJe5kaF5x1YvONk2+Zm7qHJ0XRBBHfp Tz5IuAC4nBfmmMivSwG4PDO1BeOUw22sOu/iFiIUGPVvGXyiAnHUgCiun2c5ezeh9nFX vaZbC0dzmgtf70WiwI+mSNJVwmzm62rbfzirisiihcBm8LqUa+B6iZ93H3j1PwGSQye5 7B+SyxIKRZR61/xzJVz+b1BfEccu3Gu6qiEJJw0nSBLxsJJNMEBXNf1o/p1O2pz8Uptt h+xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UycC6Mqg0Rldvi+xLfIHf2k2nJwmsZhNp06Zk4OLYro=; b=PJlDpJrXJ+w9qWYOm4QZZpq1bHg78YtXT9a+XUalw2z/Ogi2B3hsB77aDkShL3yZVM 7RGUd0oRPVsaHQWT4DLQ+OyVNYJNaZywhU8GMaOsOXkrV8mlZmkL6wkKmoBz3Iqnx/x3 OM6k2rSxNSiVwrjKwjhYEODkdwqCnfg8CH8ZOKbhSJ+UO4jJpnQAYy8x/G3nNIl66SXP 1m8iSI8KU4uK3PdmffBd5+A0TQxpRnLqOi+zss5xtTEcM5UnQIcX7if8nONlbLEDbOyB sy7hX4nqRoDTYWWXpLSnho05/30H76P40UW3R0om7EVpRi0wIa6m/eGE/dwgT9RWultW 7HAg== X-Gm-Message-State: AOAM530oGHhJI6EwmUE9Vk0RWTMWKMAFOnJYNrC0e6EPjzKsk3ju2xlZ 02uBNO0KiMi9oiHhDp44pYWibxNuU38= X-Google-Smtp-Source: ABdhPJxUcSJMH0vexXm8bfZ5KPesXIY3PrRKUllw+uhLUbCprr03cyb2b3g9FvVW/5EEWgbjfajJcQ== X-Received: by 2002:ac8:3984:: with SMTP id v4mr15402217qte.240.1602597944593; Tue, 13 Oct 2020 07:05:44 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:2df1:3321:942a:fbce]) by smtp.gmail.com with ESMTPSA id z26sm13793609qki.40.2020.10.13.07.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 07:05:43 -0700 (PDT) From: Jason Andryuk To: qemu-devel@nongnu.org Subject: [PATCH v2 1/3] accel: Remove _WIN32 ifdef from qtest-cpus.c Date: Tue, 13 Oct 2020 10:05:09 -0400 Message-Id: <20201013140511.5681-2-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013140511.5681-1-jandryuk@gmail.com> References: <20201013140511.5681-1-jandryuk@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::841; envelope-from=jandryuk@gmail.com; helo=mail-qt1-x841.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Paolo Bonzini , Thomas Huth , Claudio Fontana , Jason Andryuk Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" dummy-cpus.c is only compiled with CONFIG_POSIX, so the _WIN32 condition will never evaluate true. Remove it. Signed-off-by: Jason Andryuk Reviewed-by: Claudio Fontana Reviewed-by: Thomas Huth --- v2: New in v2 --- accel/qtest/qtest-cpus.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/accel/qtest/qtest-cpus.c b/accel/qtest/qtest-cpus.c index 7c5399ed9d..db094201c1 100644 --- a/accel/qtest/qtest-cpus.c +++ b/accel/qtest/qtest-cpus.c @@ -29,10 +29,6 @@ static void *qtest_cpu_thread_fn(void *arg) { -#ifdef _WIN32 - error_report("qtest is not supported under Windows"); - exit(1); -#else CPUState *cpu = arg; sigset_t waitset; int r; @@ -69,7 +65,6 @@ static void *qtest_cpu_thread_fn(void *arg) qemu_mutex_unlock_iothread(); rcu_unregister_thread(); return NULL; -#endif } static void qtest_start_vcpu_thread(CPUState *cpu) From patchwork Tue Oct 13 14:05:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 302954 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 81AB6C433E7 for ; Tue, 13 Oct 2020 14:07:31 +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 E40CA247A3 for ; Tue, 13 Oct 2020 14:07:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BfqoSDg2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E40CA247A3 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:53390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSKxd-0000fU-Ts for qemu-devel@archiver.kernel.org; Tue, 13 Oct 2020 10:07:29 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54510) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSKw8-0007hn-SF for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:05:56 -0400 Received: from mail-qv1-xf41.google.com ([2607:f8b0:4864:20::f41]:44923) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSKw6-0006L0-Vu for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:05:56 -0400 Received: by mail-qv1-xf41.google.com with SMTP id s17so19764qvr.11 for ; Tue, 13 Oct 2020 07:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=6+g8uPOejQwBA3L5BeMjyy5nmgRlbyJPcNeaeTMUqfo=; b=BfqoSDg2lAx8yDZ2FN5kLj4me9VCGqs5t/tR3Ptz4H2JR5zC2XufHPEpmwFNXk/Y12 c5OwQMAJbQ8ZpfdnrboeDRZN3J9n3pZhQsXR/dMZWRwVdvONLK5Daja5DtYkW7eD8kNn PR8xH+qtCRoUb/GQNy+qkc7t1U9kftRwiByYbcNCT81E0CjLer9oCj6cDEg7QJJLFxnA ul2EXccejyh684ib45Er0rsF26tRCGr4LHdIyjtPLZMm16PUcucHwLD3vZRfjaFebP0P 0pHIAtO+86I721+B7MzEW89NRmD5GEAgokSnvBPxPuqwZplIcaToCVwre/h31i/iX7vW gFmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=6+g8uPOejQwBA3L5BeMjyy5nmgRlbyJPcNeaeTMUqfo=; b=UeT3hDpmQRYJ6ABXePnITqpYDr+hFJ9Bik0mDdoP1AeG9uxc07k+0yg+IbOXO9RStD SCsM2YIfcBqtZhdELF1T3N4vBgytPoUTGWLPQHYf1Lvz5AcV+DXwzKS8p+p74H3YfR5/ AewiXKM9idVi5wCdus6IJHXJuJzmwyHQhg0/vy/VSEyBvR36Y6JpMGSWZamE/eNjlyaL G//ZKXp9Z/SyaV5R74nf2V3Y7eAEwfEp3cFyesInunZfxXlGRx7JprJUMpJuCiM97oMr bbas96ateLHhahIUqXwDpnXb0K4Gr3jhc1bOweT+hHMBJiq2ZbZuANKpZvNOjWRDE0Vx 37Dg== X-Gm-Message-State: AOAM532nDgXDWyuEdxl7+66xBH58fScGO1pGfsGsed69XoYhLM5MtksH 00A7fUqIJIweer8MELW26p9tVduprrQ= X-Google-Smtp-Source: ABdhPJzN6wVrQ9U+RAuKI3YeHUAXbPyBvvRNyANqqUZQrv+6NASfi7VEs3T2R5pMIJDYrocA8Qzwvg== X-Received: by 2002:a05:6214:122a:: with SMTP id p10mr146394qvv.0.1602597950173; Tue, 13 Oct 2020 07:05:50 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:2df1:3321:942a:fbce]) by smtp.gmail.com with ESMTPSA id z26sm13793609qki.40.2020.10.13.07.05.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 07:05:49 -0700 (PDT) From: Jason Andryuk To: qemu-devel@nongnu.org Subject: [PATCH v2 2/3] accel: move qtest CpusAccel functions to a common location Date: Tue, 13 Oct 2020 10:05:10 -0400 Message-Id: <20201013140511.5681-3-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013140511.5681-1-jandryuk@gmail.com> References: <20201013140511.5681-1-jandryuk@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::f41; envelope-from=jandryuk@gmail.com; helo=mail-qv1-xf41.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Laurent Vivier , Thomas Huth , Jason Andryuk , Claudio Fontana , Paolo Bonzini , Richard Henderson Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Move and rename accel/qtest/qtest-cpus.c files to accel/dummy-cpus.c so it can be re-used by Xen. Signed-off-by: Jason Andryuk Reviewed-by: Claudio Fontana Acked-by: Thomas Huth --- v2: - Use accel/dummy-cpus.c - Put prototype in include/sysemu/cpus.h --- accel/{qtest/qtest-cpus.c => dummy-cpus.c} | 22 ++++------------------ accel/meson.build | 7 +++++++ accel/qtest/meson.build | 1 - accel/qtest/qtest-cpus.h | 17 ----------------- accel/qtest/qtest.c | 5 ++++- include/sysemu/cpus.h | 3 +++ 6 files changed, 18 insertions(+), 37 deletions(-) rename accel/{qtest/qtest-cpus.c => dummy-cpus.c} (75%) delete mode 100644 accel/qtest/qtest-cpus.h diff --git a/accel/qtest/qtest-cpus.c b/accel/dummy-cpus.c similarity index 75% rename from accel/qtest/qtest-cpus.c rename to accel/dummy-cpus.c index db094201c1..10429fdfb2 100644 --- a/accel/qtest/qtest-cpus.c +++ b/accel/dummy-cpus.c @@ -1,5 +1,5 @@ /* - * QTest accelerator code + * Dummy cpu thread code * * Copyright IBM, Corp. 2011 * @@ -13,21 +13,12 @@ #include "qemu/osdep.h" #include "qemu/rcu.h" -#include "qapi/error.h" -#include "qemu/module.h" -#include "qemu/option.h" -#include "qemu/config-file.h" -#include "sysemu/accel.h" -#include "sysemu/qtest.h" #include "sysemu/cpus.h" -#include "sysemu/cpu-timers.h" #include "qemu/guest-random.h" #include "qemu/main-loop.h" #include "hw/core/cpu.h" -#include "qtest-cpus.h" - -static void *qtest_cpu_thread_fn(void *arg) +static void *dummy_cpu_thread_fn(void *arg) { CPUState *cpu = arg; sigset_t waitset; @@ -67,7 +58,7 @@ static void *qtest_cpu_thread_fn(void *arg) return NULL; } -static void qtest_start_vcpu_thread(CPUState *cpu) +void dummy_start_vcpu_thread(CPUState *cpu) { char thread_name[VCPU_THREAD_NAME_SIZE]; @@ -76,11 +67,6 @@ static void qtest_start_vcpu_thread(CPUState *cpu) qemu_cond_init(cpu->halt_cond); snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/DUMMY", cpu->cpu_index); - qemu_thread_create(cpu->thread, thread_name, qtest_cpu_thread_fn, cpu, + qemu_thread_create(cpu->thread, thread_name, dummy_cpu_thread_fn, cpu, QEMU_THREAD_JOINABLE); } - -const CpusAccel qtest_cpus = { - .create_vcpu_thread = qtest_start_vcpu_thread, - .get_virtual_clock = qtest_get_virtual_clock, -}; diff --git a/accel/meson.build b/accel/meson.build index bb00d0fd13..9a417396bd 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -5,3 +5,10 @@ subdir('kvm') subdir('tcg') subdir('xen') subdir('stubs') + +dummy_ss = ss.source_set() +dummy_ss.add(files( + 'dummy-cpus.c', +)) + +specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss) diff --git a/accel/qtest/meson.build b/accel/qtest/meson.build index e477cb2ae2..a2f3276459 100644 --- a/accel/qtest/meson.build +++ b/accel/qtest/meson.build @@ -1,7 +1,6 @@ qtest_ss = ss.source_set() qtest_ss.add(files( 'qtest.c', - 'qtest-cpus.c', )) specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: qtest_ss) diff --git a/accel/qtest/qtest-cpus.h b/accel/qtest/qtest-cpus.h deleted file mode 100644 index 739519a472..0000000000 --- a/accel/qtest/qtest-cpus.h +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Accelerator CPUS Interface - * - * Copyright 2020 SUSE LLC - * - * This work is licensed under the terms of the GNU GPL, version 2 or later. - * See the COPYING file in the top-level directory. - */ - -#ifndef QTEST_CPUS_H -#define QTEST_CPUS_H - -#include "sysemu/cpus.h" - -extern const CpusAccel qtest_cpus; - -#endif /* QTEST_CPUS_H */ diff --git a/accel/qtest/qtest.c b/accel/qtest/qtest.c index 537e8b449c..b282cea5cf 100644 --- a/accel/qtest/qtest.c +++ b/accel/qtest/qtest.c @@ -25,7 +25,10 @@ #include "qemu/main-loop.h" #include "hw/core/cpu.h" -#include "qtest-cpus.h" +const CpusAccel qtest_cpus = { + .create_vcpu_thread = dummy_start_vcpu_thread, + .get_virtual_clock = qtest_get_virtual_clock, +}; static int qtest_init_accel(MachineState *ms) { diff --git a/include/sysemu/cpus.h b/include/sysemu/cpus.h index 231685955d..e8156728c6 100644 --- a/include/sysemu/cpus.h +++ b/include/sysemu/cpus.h @@ -25,6 +25,9 @@ typedef struct CpusAccel { /* register accel-specific cpus interface implementation */ void cpus_register_accel(const CpusAccel *i); +/* Create a dummy vcpu for CpusAccel->create_vcpu_thread */ +void dummy_start_vcpu_thread(CPUState *); + /* interface available for cpus accelerator threads */ /* For temporary buffers for forming a name */ From patchwork Tue Oct 13 14:05:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jason Andryuk X-Patchwork-Id: 302953 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_INVALID, DKIM_SIGNED, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B61AC433DF for ; Tue, 13 Oct 2020 14:09:44 +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 79DCB247CA for ; Tue, 13 Oct 2020 14:09:43 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CfvQXnZC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 79DCB247CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:59688 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kSKzm-0003Lg-JH for qemu-devel@archiver.kernel.org; Tue, 13 Oct 2020 10:09:42 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54572) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kSKwH-0007tS-KK for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:06:05 -0400 Received: from mail-qk1-x741.google.com ([2607:f8b0:4864:20::741]:47070) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kSKwB-0006LM-19 for qemu-devel@nongnu.org; Tue, 13 Oct 2020 10:06:05 -0400 Received: by mail-qk1-x741.google.com with SMTP id a23so20874737qkg.13 for ; Tue, 13 Oct 2020 07:05:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Z5sCn2g22QNClDVC8ApV+Mu5VWc6D2QWQMvZw+Aegos=; b=CfvQXnZCbKI+aeJIUwszdFQKsZPrD0OxTTWrzEaSn/d3DDvLCCcXgs0dyeR+jPToj2 ukNtrMP4s3qkhNcd4ZKW8eZc9hXTU5do+L9/1IXwwlil/SY1O+BoBGnTsV9LbPuRBOoW wLvovZjgplbCIvu7UWrbpYFfsq6LUq+KITh8knWtWOPyNIDkmkzgC/c/vjm/h9BKZtWR F3MUx8xrMrC6VFmBxyBfXPQUwvR2XyfQNtTxOgCECyVPgaWY048xCzZMVL3/JPU2XvOH +G7OLxyuA3UDUcVKDN5GSAS0q0FP/GZ8g0JPMLVvw8X0pYznkVSbSR2BOS0Poh4A+h+J J4RA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Z5sCn2g22QNClDVC8ApV+Mu5VWc6D2QWQMvZw+Aegos=; b=N8+Vrh3h6uXcFXH2xPOMEFb9GaiEmYPxTpIrz7j3gx8pFur6Vs/VGdf3VMPlBltydD 88cT5cuhUHDEnqUokA+rCduIvBOEj1cQKKBnaTzTc3TLsEraSRH7R14y8+xsegRonA5i fPa9BDuIokvF5egBlTDX5kwQLxvYdUdKZ1i2RD3XHSDMvT9o6kZ1ttZHlc25d8eLGbrl JDUmcg0AIJQKtdqp/+JtBcRRybYysR6c2NE9zd83Jh6ItAjc47FASMHpGBGiWjSSp4yd 8vS3mVbXfNY7uIy1U0vySr8jaMDN3FFyvJg9tDqyMjxLNIDkEZ9Eh1aYlAjn2XyVYyX9 qLlQ== X-Gm-Message-State: AOAM533fOC1OSHSWbTVt9dWsUoGkNmmOsqVm3vkBVqkmYrnAjLbSqkNW KSOZSM2T21XK5xePJOG6yrK+IjK9wUY= X-Google-Smtp-Source: ABdhPJwtxBEnRnNPjEHcuVVHof6O92obazL/vN2TmbQ5O2rfIz0/rAfUoxQkml2srmIG5IH2ZnkKwQ== X-Received: by 2002:ae9:ef56:: with SMTP id d83mr100087qkg.83.1602597956496; Tue, 13 Oct 2020 07:05:56 -0700 (PDT) Received: from shine.lan ([2001:470:8:67e:2df1:3321:942a:fbce]) by smtp.gmail.com with ESMTPSA id z26sm13793609qki.40.2020.10.13.07.05.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Oct 2020 07:05:55 -0700 (PDT) From: Jason Andryuk To: qemu-devel@nongnu.org Subject: [PATCH v2 3/3] accel: Add xen CpusAccel using dummy-cpus Date: Tue, 13 Oct 2020 10:05:11 -0400 Message-Id: <20201013140511.5681-4-jandryuk@gmail.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201013140511.5681-1-jandryuk@gmail.com> References: <20201013140511.5681-1-jandryuk@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::741; envelope-from=jandryuk@gmail.com; helo=mail-qk1-x741.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Stefano Stabellini , Paul Durrant , Jason Andryuk , Claudio Fontana , Anthony Perard , "open list:X86 Xen CPUs" Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Xen was broken by commit 1583a3898853 ("cpus: extract out qtest-specific code to accel/qtest"). Xen relied on qemu_init_vcpu() calling qemu_dummy_start_vcpu() in the default case, but that was replaced by g_assert_not_reached(). Add a minimal "CpusAccel" for Xen using the dummy-cpus implementation used by qtest. Signed-off-by: Jason Andryuk Reviewed-by: Claudio Fontana Acked-by: Anthony PERARD --- accel/meson.build | 1 + accel/xen/xen-all.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/accel/meson.build b/accel/meson.build index 9a417396bd..b26cca227a 100644 --- a/accel/meson.build +++ b/accel/meson.build @@ -12,3 +12,4 @@ dummy_ss.add(files( )) specific_ss.add_all(when: ['CONFIG_SOFTMMU', 'CONFIG_POSIX'], if_true: dummy_ss) +specific_ss.add_all(when: ['CONFIG_XEN'], if_true: dummy_ss) diff --git a/accel/xen/xen-all.c b/accel/xen/xen-all.c index 60b971d0a8..878a4089d9 100644 --- a/accel/xen/xen-all.c +++ b/accel/xen/xen-all.c @@ -16,6 +16,7 @@ #include "hw/xen/xen_pt.h" #include "chardev/char.h" #include "sysemu/accel.h" +#include "sysemu/cpus.h" #include "sysemu/xen.h" #include "sysemu/runstate.h" #include "migration/misc.h" @@ -153,6 +154,10 @@ static void xen_setup_post(MachineState *ms, AccelState *accel) } } +const CpusAccel xen_cpus = { + .create_vcpu_thread = dummy_start_vcpu_thread, +}; + static int xen_init(MachineState *ms) { MachineClass *mc = MACHINE_GET_CLASS(ms); @@ -180,6 +185,9 @@ static int xen_init(MachineState *ms) * opt out of system RAM being allocated by generic code */ mc->default_ram_id = NULL; + + cpus_register_accel(&xen_cpus); + return 0; }