Message ID | 20191025063713.23374-37-alex.bennee@linaro.org |
---|---|
State | Accepted |
Commit | 30865f316856cc346f4af7ec28586c4a636b0109 |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3264228ill; Fri, 25 Oct 2019 00:12:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqxI2usRpxDX+v/c4VFd0lJVC7t5iVFIDljLjF9Mq/uDkZwN4cXkyPRY+yVNGaTnEitZsNXf X-Received: by 2002:ac8:542:: with SMTP id c2mr1649583qth.338.1571987540530; Fri, 25 Oct 2019 00:12:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571987540; cv=none; d=google.com; s=arc-20160816; b=qQQ6y7YyEUvzzdRX8edNZ56LeDdHV9yQFclXKRQ95LtT0P3J0+6ChUVHWxY2KYoI/Y 4Rf3rHsZsQO+a6vh5cSzWz1By8oN/qGHVfZlnaqA6EuNzdx6kGtGiev4L3XfzZs/hx82 XHYuXg0PVuzo+vWqPPRGsJUmlEZC6gdB/UFuCIkcm2RKEZ4Pneh/SjJ8S1k2ZbYsfVjI Yk7pclEfZ532DXIVe8Joxw7hjQ36D8E40sSzwxbg0bRZ1cLBmtVFPqiBjyT5xdqkdfzA gAts5V5+cpDLSHUSukimlMIu7Dr0v30IizKCOofQtwX6pJXW9/gCWHbRQbREZwSC/JVq 2p6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=on+lWgdyGbMgyiiocbkSh3WSaQjkHBt1xgT/j3s/5iJWOiuBIt5caBozBuCk+mqsjn tEbiypXMNSyB7JEoecoitSfrp5bB7UC5ivAt4ZcDxpbrwksGLTTq6g7JJ43yotEEXNHl hUSztT8w255vXBczJaHAEpc3svwtcSNgYPWv2qBz0l96M5AYWIq+ZeihDcS5IroEISX/ iN57Rax5bOvm4vVYwuZtUmL9zzNGRIDzccza4higSiifnf24TU2WgEzXUCPkoKmEFw9e pKQ/GYSPMXbwVTgXkrgdgSrnvH1QeYYHYW5e2W+0KisGCz8uofK+elfzAxaoV+yppkPD gOWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QYJFGeGq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id m47si800717qvc.214.2019.10.25.00.12.20 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 Oct 2019 00:12:20 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=QYJFGeGq; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:56456 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <qemu-devel-bounces+patch=linaro.org@nongnu.org>) id 1iNtlj-00056M-FH for patch@linaro.org; Fri, 25 Oct 2019 03:12:19 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37068) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <alex.bennee@linaro.org>) id 1iNtN7-00088Q-Vv for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1iNtN6-0003HW-Sn for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:53 -0400 Received: from mail-wr1-x435.google.com ([2a00:1450:4864:20::435]:44173) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from <alex.bennee@linaro.org>) id 1iNtN4-0003Bu-Oe for qemu-devel@nongnu.org; Fri, 25 Oct 2019 02:46:52 -0400 Received: by mail-wr1-x435.google.com with SMTP id z11so914806wro.11 for <qemu-devel@nongnu.org>; Thu, 24 Oct 2019 23:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=QYJFGeGq0sSo9sbz/GAMzd1EHA0zEkKRQJYiSnce21KSMl5ACw9b3zfx0+xncshEcW kWr5FMUW0V+b/TeQd27lqsEc3NyD+NXC3+RiJebvHcZe0j8jNux6tSCF2LYOS9klsbZQ oQKH9iyBFfO0P83MZhIFUyBsa6Ku/8+QgbyGd847gBlgeEmzhEBLIWSKC9gzkHIffmKj jEG18/r2tU1g7TevfBOUVBHj+C5kdLKaqhPmN2Brxbo35F5mdDZuZhEUWu2RN0JIt8iR QLqZV9NUM9oAkLkQmIpqG/kwhvw9j5Oi6VF+dKezf0Xm47h+EMmNDGreNUnuFvsH+IUA 4UFg== 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=EkCfQWBEx+5L5dxa6UBDFdtT+LYaodC4KvARVIxtPwY=; b=QY30FWx8kNmlT5AQCNQvL7+nMKmN9V2aHQRfaHtMbTcHdRiajvi5sS+qlMKd8a6Xoc 2gLhC/ems2PLh9wQ2HyBhTcnC+9UKMSkttHQEMK9aLBiq6GiJ4C/WqLItj9qGcvBj2FO 8dAW1CBohkmNsVyu799gd2/SpzgADnKAiHuV7x/un0whZXEE0iibzUEcSrIWlxfk111h lZxLa1G3f6qQvb2PO9W9X1b3U1lUXdIhWmLcBX2N6X0HCVAG+UJb+p2eAh2DpZRstmLO OLzoso2/Gblu92MD4xvvEFyPgbBWpPosXFCRfu1b4W/syrMSiuHvDzVkqECK3E7kWUzG tqyA== X-Gm-Message-State: APjAAAUrR3S715/qTnHBpNW5L7SlXsVlgiHlD/0lJ0r7eBi7UFHGMveB 0i5moegXuqCRyOT9+aMevlpDjHcV00M= X-Received: by 2002:a05:6000:34f:: with SMTP id e15mr1436825wre.232.1571986002905; Thu, 24 Oct 2019 23:46:42 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id j19sm1777794wre.0.2019.10.24.23.46.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Oct 2019 23:46:37 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3660B1FFBD; Fri, 25 Oct 2019 07:37:17 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org> To: peter.maydell@linaro.org Subject: [PULL v2 36/73] cpu: hook plugin vcpu events Date: Fri, 25 Oct 2019 07:36:36 +0100 Message-Id: <20191025063713.23374-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191025063713.23374-1-alex.bennee@linaro.org> References: <20191025063713.23374-1-alex.bennee@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::435 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <richard.henderson@linaro.org>, qemu-devel@nongnu.org, "Emilio G. Cota" <cota@braap.org>, Paolo Bonzini <pbonzini@redhat.com>, =?utf-8?q?Alex?= =?utf-8?q?_Benn=C3=A9e?= <alex.bennee@linaro.org>, Richard Henderson <rth@twiddle.net> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patch=linaro.org@nongnu.org> |
Series |
tcg plugins and testing updates
|
expand
|
diff --git a/cpus.c b/cpus.c index fabbeca6f46..63bda152f57 100644 --- a/cpus.c +++ b/cpus.c @@ -45,6 +45,7 @@ #include "exec/exec-all.h" #include "qemu/thread.h" +#include "qemu/plugin.h" #include "sysemu/cpus.h" #include "sysemu/qtest.h" #include "qemu/main-loop.h" @@ -1264,9 +1265,18 @@ static void qemu_tcg_rr_wait_io_event(void) static void qemu_wait_io_event(CPUState *cpu) { + bool slept = false; + while (cpu_thread_is_idle(cpu)) { + if (!slept) { + slept = true; + qemu_plugin_vcpu_idle_cb(cpu); + } qemu_cond_wait(cpu->halt_cond, &qemu_global_mutex); } + if (slept) { + qemu_plugin_vcpu_resume_cb(cpu); + } #ifdef _WIN32 /* Eat dummy APC queued by qemu_cpu_kick_thread. */ diff --git a/exec.c b/exec.c index fb0943cfed6..1feda0ca761 100644 --- a/exec.c +++ b/exec.c @@ -975,6 +975,8 @@ void cpu_exec_realizefn(CPUState *cpu, Error **errp) } tlb_init(cpu); + qemu_plugin_vcpu_init_hook(cpu); + #ifndef CONFIG_USER_ONLY if (qdev_get_vmsd(DEVICE(cpu)) == NULL) { vmstate_register(NULL, cpu->cpu_index, &vmstate_cpu_common, cpu); diff --git a/hw/core/cpu.c b/hw/core/cpu.c index 73b1ee34d04..db1a03c6bbb 100644 --- a/hw/core/cpu.c +++ b/hw/core/cpu.c @@ -32,6 +32,7 @@ #include "hw/boards.h" #include "hw/qdev-properties.h" #include "trace-root.h" +#include "qemu/plugin.h" CPUInterruptHandler cpu_interrupt_handler; @@ -352,6 +353,7 @@ static void cpu_common_unrealizefn(DeviceState *dev, Error **errp) CPUState *cpu = CPU(dev); /* NOTE: latest generic point before the cpu is fully unrealized */ trace_fini_vcpu(cpu); + qemu_plugin_vcpu_exit_hook(cpu); cpu_exec_unrealizefn(cpu); }