From patchwork Thu Apr 1 11:22:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 1460970 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=Z40ifjb5; dkim-atps=neutral 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 ozlabs.org (Postfix) with ESMTPS id 4FB15c028Dz9sPf for ; Thu, 1 Apr 2021 22:23:32 +1100 (AEDT) Received: from localhost ([::1]:59758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lRvQA-0000ox-1e for incoming@patchwork.ozlabs.org; Thu, 01 Apr 2021 07:23:30 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34158) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lRvPF-0000jy-Am for qemu-devel@nongnu.org; Thu, 01 Apr 2021 07:22:33 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:37532) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lRvPD-0006h3-TV for qemu-devel@nongnu.org; Thu, 01 Apr 2021 07:22:33 -0400 Received: by mail-ej1-x62c.google.com with SMTP id w3so2338900ejc.4 for ; Thu, 01 Apr 2021 04:22:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=4FACbZ/ff7TqFtcB9utnNWMNn2f00Di6NIXduzRvbc4=; b=Z40ifjb5sl2ZBU7owkyFN6CWhnjICrIB7SYKHyLw5KYbIXNd9n/l2U/y6AZPnfJnpQ EC7AnI5ral0VYAHENXFL8l2Uip274820qrB2mcInZqvZ0nO4g6FYqelmFkKPiV8fb1Oh m9Gs826RlF+/1gK/IjdjMbaMxP9sxYEGddoq8nH5N+8RPZIhP0hCud71bIsHHRM9Be5g i66Eo6hPMsk5hAYgiB7VwuktGqK095KqfptQeWHXwUb5ElrV1MNtGE+Z34LxSuat9nUj hLPz6fROFXW6+LrG2Fg687MT1BJBvu9T17OX9JY+N8CXRyrpkWMg23Yz0/dkR1UsJjnD rUyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=4FACbZ/ff7TqFtcB9utnNWMNn2f00Di6NIXduzRvbc4=; b=cY8H6xklbxZ+3l1fUpRntnNyhjxlxwBlPr0e1t8saJ2dxEhN0JUkgljuHfeL9zijIK QsFFNkRnEW9DiITEbQGNK8XGueDCDziQJZYbunNCwFzHQCNsMPuJ7+0yC2nrXuUt9Usw J/mQwkQk+nBw8KruYz/iP0gQiSgCR3KRQdv4dTAh/Ys/NmZbxLDy8TAtXwkcgt6CPc0Q 3CvwBygXu6pohIRUl2D9oA7P3w/YO9DtZE9QAoCitLxLJp9tTLfkoL62oIZ5ZD9bH2x/ AG4glfPXTPE2a/+bGmKVrYk2wLw4yiMkVsXuJ1qokdFJIH56MsELFhtN3aYChDL0VskT tSQA== X-Gm-Message-State: AOAM533J+G1B5fcF8YEfNLRuNA28313kf+6AhFANrHlurptrQ7PKsVEm zysUfm8LNUmgREfbaU3BR/8u9s0h85w= X-Google-Smtp-Source: ABdhPJyR1XW//ps6yl8v25TSziefnTxjqGjrfP9Ji6GqHM/Ogv2TWu7d6iPMCsQtSGOH+EA5Mb2/jg== X-Received: by 2002:a17:906:af6f:: with SMTP id os15mr8686331ejb.279.1617276149576; Thu, 01 Apr 2021 04:22:29 -0700 (PDT) Received: from avogadro.lan ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id d15sm3383516edx.62.2021.04.01.04.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Apr 2021 04:22:29 -0700 (PDT) From: Paolo Bonzini To: qemu-devel@nongnu.org Subject: [PULL 07/12] replay: notify CPU on event Date: Thu, 1 Apr 2021 13:22:18 +0200 Message-Id: <20210401112223.55711-8-pbonzini@redhat.com> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210401112223.55711-1-pbonzini@redhat.com> References: <20210401112223.55711-1-pbonzini@redhat.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=paolo.bonzini@gmail.com; helo=mail-ej1-x62c.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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: Pavel Dovgalyuk Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Pavel Dovgalyuk This patch enables vCPU notification to wake it up when new async event comes in replay mode. The motivation of this patch is the following. Consider recorded block async event. It is saved into the log with one of the checkpoints. This checkpoint may be passed in vCPU loop. In replay mode when this async event is read from the log, and block thread task is not finished yet, vCPU thread goes to sleep. That is why this patch adds waking up the vCPU to process this finished event. Signed-off-by: Pavel Dovgalyuk Message-Id: <161726519158.1476949.7614181684462079836.stgit@pasha-ThinkPad-X280> Signed-off-by: Paolo Bonzini --- replay/replay-events.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/replay/replay-events.c b/replay/replay-events.c index a1c6bb934e..15983dd250 100644 --- a/replay/replay-events.c +++ b/replay/replay-events.c @@ -15,6 +15,7 @@ #include "replay-internal.h" #include "block/aio.h" #include "ui/input.h" +#include "hw/core/cpu.h" typedef struct Event { ReplayAsyncEventKind event_kind; @@ -126,6 +127,7 @@ void replay_add_event(ReplayAsyncEventKind event_kind, g_assert(replay_mutex_locked()); QTAILQ_INSERT_TAIL(&events_list, event, events); + qemu_cpu_kick(first_cpu); } void replay_bh_schedule_event(QEMUBH *bh)