From patchwork Wed Mar 17 07:22:02 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454514 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=UORXKIcU; 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 4F0hSr57JSz9sVm for ; Wed, 17 Mar 2021 18:22:51 +1100 (AEDT) Received: from localhost ([::1]:53038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQVz-0003Tg-UI for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:22:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44134) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVa-0003T8-If for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:22 -0400 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:45378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVY-0007pg-OL for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:22 -0400 Received: by mail-ej1-x630.google.com with SMTP id mm21so887551ejb.12 for ; Wed, 17 Mar 2021 00:22:19 -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=+prPljAtmIqrEMFGTEBz16szSwQnlu6kpSMTs/hIZA0=; b=UORXKIcUG5n4UzvWb8EbzTjc9BfNYWGsdjOje07zeq1wGm5j5tHyGE493oYtYkotE8 o7hNwnmKK1mowD7FDPeLhIF+o8lol9Q4yzUwPBTecOx1Ibj1HL5ywzL0qXypWeqeHBZ/ ECZybV76jFkLDy4KYDPW4fTsueA/tM9fD+EQX9zXq9piQ6ClUeVvKr3uLRgYR35P83uB /74jgV0t3l61wjMF6I3PFqRmUmI76p2yWfAeuRWo28MdACj/kdz7eD+iDDPvz53EptNQ 6iMr21E54CKYGBH/khRrYda3ZsS9n3swdvAST5Isu+6UR6Nj21vIWZ/P6cpxpCOmEUeb PWAA== 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=+prPljAtmIqrEMFGTEBz16szSwQnlu6kpSMTs/hIZA0=; b=KAoQWTby7HcWW45b2RJCIF+n9LnubZL9alVoEWUkCcPJUUr3zkgvHUW1LSIWrTtirD EF3Y9HZtSpcIUbkLEta9y8YrEh9o0Ii2sKvsKeYrng8MULTenDGmc0twQmg9Ve3pKOks vOYJh+FwZNTXukrit/hoYA1k42b0cj2bNFRYAvOziQdEMntT7TmpbVpBp6jDUJWtRFUR 83GeQVkSifbFE/gG6Jq5bQvK+6SyRTY0rqlTgE/v8LVyJHpV1/iz0boUq0zr8RU5OINw GG96f7rocVBjZI1LSmnaBVrYCexmXBERM5zSea6NS2o1Le/PfeTZDuW7i05tNyjcfG/m 627g== X-Gm-Message-State: AOAM533/lrY9wmNJl0FeLHaU1U9vlL84P4nZbfc4OUKheXEPuKw3H1mf FZY7hpHx5+v0uqupwU9m3OIhBw== X-Google-Smtp-Source: ABdhPJx+ImiZo3DGVvBXb4Cx2FYIC4611xdZDUQeUj9F7Yio8xoF+fzObHajglpBUMRZd5CUZprvzw== X-Received: by 2002:a17:907:2672:: with SMTP id ci18mr21594533ejc.384.1615965738432; Wed, 17 Mar 2021 00:22:18 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id be27sm11790335edb.47.2021.03.17.00.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id BDC111FF87; Wed, 17 Mar 2021 07:22:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 01/15] utils: Use fixed-point arithmetic in qemu_strtosz Date: Wed, 17 Mar 2021 07:22:02 +0000 Message-Id: <20210317072216.16316-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x630.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Richard Henderson , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Once we've parsed the fractional value, extract it into an integral 64-bit fraction. Perform the scaling with integer arithmetic, and simplify the overflow detection. Reviewed-by: Eric Blake Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée Message-Id: <20210315185117.1986240-2-richard.henderson@linaro.org> diff --git a/tests/unit/test-cutils.c b/tests/unit/test-cutils.c index bad3a60993..e025b54c05 100644 --- a/tests/unit/test-cutils.c +++ b/tests/unit/test-cutils.c @@ -2128,7 +2128,7 @@ static void test_qemu_strtosz_float(void) str = "12.345M"; err = qemu_strtosz(str, &endptr, &res); g_assert_cmpint(err, ==, 0); - g_assert_cmpint(res, ==, (uint64_t) (12.345 * MiB)); + g_assert_cmpint(res, ==, (uint64_t) (12.345 * MiB + 0.5)); g_assert(endptr == str + 7); } diff --git a/util/cutils.c b/util/cutils.c index d89a40a8c3..c442882b88 100644 --- a/util/cutils.c +++ b/util/cutils.c @@ -275,10 +275,9 @@ static int do_strtosz(const char *nptr, const char **end, int retval; const char *endptr, *f; unsigned char c; - bool mul_required = false, hex = false; - uint64_t val; + bool hex = false; + uint64_t val, valf = 0; int64_t mul; - double fraction = 0.0; /* Parse integral portion as decimal. */ retval = qemu_strtou64(nptr, &endptr, 10, &val); @@ -308,17 +307,19 @@ static int do_strtosz(const char *nptr, const char **end, * without fractional digits. If we see an exponent, treat * the entire input as invalid instead. */ + double fraction; + f = endptr; retval = qemu_strtod_finite(f, &endptr, &fraction); if (retval) { - fraction = 0.0; endptr++; } else if (memchr(f, 'e', endptr - f) || memchr(f, 'E', endptr - f)) { endptr = nptr; retval = -EINVAL; goto out; - } else if (fraction != 0) { - mul_required = true; + } else { + /* Extract into a 64-bit fixed-point fraction. */ + valf = (uint64_t)(fraction * 0x1p64); } } c = *endptr; @@ -333,16 +334,35 @@ static int do_strtosz(const char *nptr, const char **end, mul = suffix_mul(default_suffix, unit); assert(mul > 0); } - if (mul == 1 && mul_required) { - endptr = nptr; - retval = -EINVAL; - goto out; - } - if (val > (UINT64_MAX - ((uint64_t) (fraction * mul))) / mul) { - retval = -ERANGE; - goto out; + if (mul == 1) { + /* When a fraction is present, a scale is required. */ + if (valf != 0) { + endptr = nptr; + retval = -EINVAL; + goto out; + } + } else { + uint64_t valh, tmp; + + /* Compute exact result: 64.64 x 64.0 -> 128.64 fixed point */ + mulu64(&val, &valh, val, mul); + mulu64(&valf, &tmp, valf, mul); + val += tmp; + valh += val < tmp; + + /* Round 0.5 upward. */ + tmp = valf >> 63; + val += tmp; + valh += val < tmp; + + /* Report overflow. */ + if (valh != 0) { + retval = -ERANGE; + goto out; + } } - *result = val * mul + (uint64_t) (fraction * mul); + + *result = val; retval = 0; out: From patchwork Wed Mar 17 07:22:03 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454515 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=zEIvbP6Y; 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 4F0hSv3pCwz9sWH for ; Wed, 17 Mar 2021 18:22:55 +1100 (AEDT) Received: from localhost ([::1]:53184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQW5-0003Xo-Fd for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:22:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44170) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVc-0003UA-US for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:24 -0400 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]:41049) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVa-0007rZ-Ve for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:24 -0400 Received: by mail-ej1-x633.google.com with SMTP id lr13so907173ejb.8 for ; Wed, 17 Mar 2021 00:22:22 -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=/MsPYBm57DQLiBlktTb2qPsZxAfsZ5w/VN9k4u6Nxq8=; b=zEIvbP6YrSwaEwjLsS7E8X7QHFVknUKc9VNx8etRBrlVWTxLUYMXT1U3pfSz0S/vjV bEU/P7HuEp5nmab62SmcgsgSH7ql5SpF7Z4tF+OtMLhTZChgm/RLMs6zaz/oji96IdZY D9QwfwkueME2/TEWAJwsrqBFI6HPo+PAJF1v7Ck0APOtePrMmluyJR86VG8fSMtYAy1J m08hR/DxQyhD1fensEGhOb/qW3guEmJmPoLH4rCHL+q3LuDxEJj0qj7eUCZwlvlhcy4A 4d9a1KDb5TB5pfjkEsnyL3DcMkcbctkFGBaCMhiuhpbQ6GeS6IiFDZQj5SJpB73D3mAD 4yTA== 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=/MsPYBm57DQLiBlktTb2qPsZxAfsZ5w/VN9k4u6Nxq8=; b=OV2GjcNo8n+uBWe74el/ZzqTXvCZpF2jH9iC2ygKOukZIizHU4HfaCip6+Mb6SG+D3 Pck3XApEFBPQiAgoxvCMMmsA9PMMLAwSqiPKgfD/lT0d+NZ5v8tzyyWeemD+XqeGqgtL l1hsC+pfaPePHI1QD194Qx3LxFLYTLVFnbrwQ0RjIwOEVunt9O0gUFekYOu+y9Jlhe34 oPcf4af4J6tIcZ8MsRyuRjUErJEIl5XLZkluOfbG1CoQIJqchSuuKNWorKjRWPcNgupU ThUNlc67pcKZGUcqJ6uZ3wEZ+eUXa/u+Y0CuVjPgBBELBFT4FNgC8nx8gX4ErhcfNKm/ 1+Zg== X-Gm-Message-State: AOAM530R0TukJBUvxa/pvk0sDXDLxjSspha7LVAFU6NQaEgH+cZUbDTb OleJJ8cc7be0mFqk5tLFmcBTFA== X-Google-Smtp-Source: ABdhPJwHEb3T3solJjKrCfQuAKkBECPSfyBd0UXTyIQG6AVGnX+r1zRRo5Wm+hZTvFsy0uqlfprQCg== X-Received: by 2002:a17:906:c45a:: with SMTP id ck26mr33208496ejb.125.1615965741643; Wed, 17 Mar 2021 00:22:21 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id bh4sm4179545ejb.24.2021.03.17.00.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:17 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id D47051FF8C; Wed, 17 Mar 2021 07:22:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 02/15] plugins: new syscalls plugin Date: Wed, 17 Mar 2021 07:22:03 +0000 Message-Id: <20210317072216.16316-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::633; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x633.google.com 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, 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: Matthias Weckbecker , =?utf-8?q?Alex_Benn?= =?utf-8?q?=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Matthias Weckbecker This commit adds a new syscalls plugin that displays the syscalls as they are executed and returned. This plugin outputs the number of the syscall as well as the syscall return value. Works in *-user only. Essentially, this commit restores: https://lists.gnu.org/archive/html/qemu-devel/2018-06/msg00846.html by using the new QEMU plugin API. Signed-off-by: Matthias Weckbecker Signed-off-by: Alex Bennée Message-Id: <20200812115816.4454-1-matthias@weckbecker.name> Message-Id: <20210312172821.31647-2-alex.bennee@linaro.org> diff --git a/tests/plugin/syscall.c b/tests/plugin/syscall.c new file mode 100644 index 0000000000..53ee2ab6c4 --- /dev/null +++ b/tests/plugin/syscall.c @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2020, Matthias Weckbecker + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#include +#include +#include +#include +#include +#include +#include + +#include + +QEMU_PLUGIN_EXPORT int qemu_plugin_version = QEMU_PLUGIN_VERSION; + +static void vcpu_syscall(qemu_plugin_id_t id, unsigned int vcpu_index, + int64_t num, uint64_t a1, uint64_t a2, + uint64_t a3, uint64_t a4, uint64_t a5, + uint64_t a6, uint64_t a7, uint64_t a8) +{ + g_autofree gchar *out = g_strdup_printf("syscall #%" PRIi64 "\n", num); + qemu_plugin_outs(out); +} + +static void vcpu_syscall_ret(qemu_plugin_id_t id, unsigned int vcpu_idx, + int64_t num, int64_t ret) +{ + g_autofree gchar *out; + out = g_strdup_printf("syscall #%" PRIi64 " returned -> %" PRIi64 "\n", + num, ret); + qemu_plugin_outs(out); +} + +/* ************************************************************************* */ + +static void plugin_exit(qemu_plugin_id_t id, void *p) {} + +QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, + const qemu_info_t *info, + int argc, char **argv) +{ + qemu_plugin_register_vcpu_syscall_cb(id, vcpu_syscall); + qemu_plugin_register_vcpu_syscall_ret_cb(id, vcpu_syscall_ret); + qemu_plugin_register_atexit_cb(id, plugin_exit, NULL); + return 0; +} diff --git a/tests/plugin/meson.build b/tests/plugin/meson.build index 1eacfa6e35..2bbfc4b19e 100644 --- a/tests/plugin/meson.build +++ b/tests/plugin/meson.build @@ -1,5 +1,5 @@ t = [] -foreach i : ['bb', 'empty', 'insn', 'mem'] +foreach i : ['bb', 'empty', 'insn', 'mem', 'syscall'] t += shared_module(i, files(i + '.c'), include_directories: '../../include/qemu', dependencies: glib) From patchwork Wed Mar 17 07:22:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454522 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=T/VeUJEt; 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 4F0hYb6C6Nz9sWH for ; Wed, 17 Mar 2021 18:26:59 +1100 (AEDT) Received: from localhost ([::1]:41438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQa1-0001p5-Sv for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:26:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVd-0003Uv-Jt for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:25 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:45378) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVb-0007sY-NR for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:25 -0400 Received: by mail-ej1-x62f.google.com with SMTP id mm21so887769ejb.12 for ; Wed, 17 Mar 2021 00:22:23 -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=frvWeWkE0HLi8OnAGFQ6yFN2uwXNepdq5oonZmdE2hY=; b=T/VeUJEtbH5PdGg0JgO38rtGO2jSFFCinL6WZDb8gfGbA4bzGqaHnF+suGcgDMI83H zFpuu0s0PdgHeKGnHclucn+m3FWwzWqgEXrL3+XEAzXuICU1c1O3ojszmd6kSOQTQbl9 bquriywD8XTmT9aL+KGldITXdwZXmr89GmssLviHwWnLp2ZxOw4ZdjEGkyjVYVx+Boc9 mElEXO5Ema59lKJx7q/ESSI7vzq01V2OU5GZg1mQptJVE8xTQ4OC3cXvvJfMJ/hg1Ux/ 8f9qHzPQNaBGk+ESmIvUuJxkxzVMJcEVWEJdrgeR1MvEKNppAbxRFhONIgSctDKu0OpM 0hHQ== 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=frvWeWkE0HLi8OnAGFQ6yFN2uwXNepdq5oonZmdE2hY=; b=k2Gaf6MlsFUEaeImRLeuSBvUquDN8S6Apd2CQh8OMYKX2u57olx1PHBhC12/CieFy3 z4u3UJ1hre9c7NUs3bSghwSekYr0kcFaFIIqzCqnZM5LQkgQ+QAXEOYVHQwJ7qKfLMKc YUcKfnTASwIFHHnbKw4O3qnYwHADdnl3tVS3uLGT76lIEiohELJ99XiupulTVaFzlwOF gilE/P8cDVdcCyIiP3VzF+4964DWhHVOJUKM5Yby6/9lNKZvP407LGP96gP7+E5Xok5w yhDtw1yq6MWG6PKs2WbQaEGFZ5Gh0qlMXzLMXpofhW75rnzBlDanGzHFxn7/Ko7gjeh+ jZqw== X-Gm-Message-State: AOAM531K9OATj+o7/1Y9PMs6YUEc5D59iRWDX+MFBv4MSeJglBXD0BJ9 U0QguB9AMKAVcR1amqx8VpACVg== X-Google-Smtp-Source: ABdhPJyOGoA431knzsbTUrKsHol+Ua2xj2tLA2GkMgUcTOqrJ0NUYQGpEyrkYviT2ctQTqSDQ4Y8zQ== X-Received: by 2002:a17:906:b0d8:: with SMTP id bk24mr34718162ejb.252.1615965742426; Wed, 17 Mar 2021 00:22:22 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id c10sm11718549edt.64.2021.03.17.00.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id F03EF1FF8F; Wed, 17 Mar 2021 07:22:16 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 03/15] plugins: Expose physical addresses instead of device offsets Date: Wed, 17 Mar 2021 07:22:04 +0000 Message-Id: <20210317072216.16316-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com 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, 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: Aaron Lindsay , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Aaron Lindsay This allows plugins to query for full virtual-to-physical address translation for a given `qemu_plugin_hwaddr` and stops exposing the offset within the device itself. As this change breaks the API, QEMU_PLUGIN_VERSION is incremented. Signed-off-by: Aaron Lindsay Signed-off-by: Alex Bennée Message-Id: <20210309202802.211756-1-aaron@os.amperecomputing.com> Message-Id: <20210312172821.31647-3-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index c66507fe8f..3303dce862 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -47,7 +47,7 @@ typedef uint64_t qemu_plugin_id_t; extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; -#define QEMU_PLUGIN_VERSION 0 +#define QEMU_PLUGIN_VERSION 1 typedef struct { /* string describing architecture */ @@ -307,8 +307,8 @@ bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); -/* - * qemu_plugin_get_hwaddr(): +/** + * qemu_plugin_get_hwaddr() - return handle for memory operation * @vaddr: the virtual address of the memory operation * * For system emulation returns a qemu_plugin_hwaddr handle to query @@ -323,12 +323,30 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr); /* - * The following additional queries can be run on the hwaddr structure - * to return information about it. For non-IO accesses the device - * offset will be into the appropriate block of RAM. + * The following additional queries can be run on the hwaddr structure to + * return information about it - namely whether it is for an IO access and the + * physical address associated with the access. + */ + +/** + * qemu_plugin_hwaddr_is_io() - query whether memory operation is IO + * @haddr: address handle from qemu_plugin_get_hwaddr() + * + * Returns true if the handle's memory operation is to memory-mapped IO, or + * false if it is to RAM */ bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr); -uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr); + +/** + * qemu_plugin_hwaddr_phys_addr() - query physical address for memory operation + * @haddr: address handle from qemu_plugin_get_hwaddr() + * + * Returns the physical address associated with the memory operation + * + * Note that the returned physical address may not be unique if you are dealing + * with multiple address spaces. + */ +uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr); /* * Returns a string representing the device. The string is valid for diff --git a/contrib/plugins/hotpages.c b/contrib/plugins/hotpages.c index eacc678eac..bf53267532 100644 --- a/contrib/plugins/hotpages.c +++ b/contrib/plugins/hotpages.c @@ -122,7 +122,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, } } else { if (hwaddr && !qemu_plugin_hwaddr_is_io(hwaddr)) { - page = (uint64_t) qemu_plugin_hwaddr_device_offset(hwaddr); + page = (uint64_t) qemu_plugin_hwaddr_phys_addr(hwaddr); } else { page = vaddr; } diff --git a/contrib/plugins/hwprofile.c b/contrib/plugins/hwprofile.c index 6dac1d5f85..faf216ac00 100644 --- a/contrib/plugins/hwprofile.c +++ b/contrib/plugins/hwprofile.c @@ -201,7 +201,7 @@ static void vcpu_haddr(unsigned int cpu_index, qemu_plugin_meminfo_t meminfo, return; } else { const char *name = qemu_plugin_hwaddr_device_name(hwaddr); - uint64_t off = qemu_plugin_hwaddr_device_offset(hwaddr); + uint64_t off = qemu_plugin_hwaddr_phys_addr(hwaddr); bool is_write = qemu_plugin_mem_is_store(meminfo); DeviceCounts *counts; diff --git a/plugins/api.c b/plugins/api.c index 0b04380d57..3c7dc406e3 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -40,6 +40,7 @@ #include "sysemu/sysemu.h" #include "tcg/tcg.h" #include "exec/exec-all.h" +#include "exec/ram_addr.h" #include "disas/disas.h" #include "plugin.h" #ifndef CONFIG_USER_ONLY @@ -298,19 +299,25 @@ bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) #endif } -uint64_t qemu_plugin_hwaddr_device_offset(const struct qemu_plugin_hwaddr *haddr) +uint64_t qemu_plugin_hwaddr_phys_addr(const struct qemu_plugin_hwaddr *haddr) { #ifdef CONFIG_SOFTMMU if (haddr) { if (!haddr->is_io) { - ram_addr_t ram_addr = qemu_ram_addr_from_host((void *) haddr->v.ram.hostaddr); - if (ram_addr == RAM_ADDR_INVALID) { + RAMBlock *block; + ram_addr_t offset; + void *hostaddr = (void *) haddr->v.ram.hostaddr; + + block = qemu_ram_block_from_host(hostaddr, false, &offset); + if (!block) { error_report("Bad ram pointer %"PRIx64"", haddr->v.ram.hostaddr); abort(); } - return ram_addr; + + return block->offset + offset + block->mr->addr; } else { - return haddr->v.io.offset; + MemoryRegionSection *mrs = haddr->v.io.section; + return haddr->v.io.offset + mrs->mr->addr; } } #endif From patchwork Wed Mar 17 07:22:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454516 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=A4CeZuku; 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 4F0hSv4RD7z9sWQ for ; Wed, 17 Mar 2021 18:22:55 +1100 (AEDT) Received: from localhost ([::1]:53216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQW5-0003Yt-Hj for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:22:53 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44192) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVe-0003W9-Qb for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:26 -0400 Received: from mail-ej1-x62f.google.com ([2a00:1450:4864:20::62f]:40136) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVd-0007tD-AB for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:26 -0400 Received: by mail-ej1-x62f.google.com with SMTP id ci14so912230ejc.7 for ; Wed, 17 Mar 2021 00:22:24 -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=Z/GsiICGeaT2/Why33IGYP3Vu7Bpn+W4JV5DMBIlNpM=; b=A4CeZukubX6Yq7d7NiYXfsDHyPgGgxjGn57BYQ1gwkX3XuN7FWHaFs9zbqgGGfv3ze AR4Tan3xrivTQkUCGUvo7SFzD0K636lozGfI3qUs19wKg7oif0ZemEppnuj1HG332FvC QNk+Nb9FIb379G+VN9D3C1kIkHZ3wHlD2LOhofDJIjHOzJ2+q5cDed4wqpQou5ohus6h yHnf02522hkOK45rMPF6XI8JILXvAHdltzw0cCxDv0KQl/rpzkTav/KM90udKIEJL2zb 7MzdHB+kfmGihZ2CIl8kICG4TqArf9bsdwerhiPPgvegOPES818GHMp2oIynNgXkMSA4 +8xQ== 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=Z/GsiICGeaT2/Why33IGYP3Vu7Bpn+W4JV5DMBIlNpM=; b=Vua72NZGZieSZW6/90oM7mOkVOmfwjHE0UJQBZipiFGh9xzfAd6tmQFsZ4wNOvtJe/ r1mE3CojncQgnV6blzvESw4CJC8Ku4uUGR5qbDZvqikKg/hDydJ0z2lFE/zd7tXDq6Li VsjHgN122A96OiFqR7mM+JIQdtgDzvu43NGrmOPa0ORlCZB1lXgyCjLABmj/usIuas/p ZmW8Dr8Q19hRU+G19IezwEZIwc7LU2d1uS8hWe2XHxXAcj7u+M1cvwsjIPyqYRr81LZ4 vEuLMb5Kvvx3ewo2cslsw3GcTFuDzuh+Knn7RPA7D5yJoymZlm+b/zgbpSmxuwfI+rjr oaeQ== X-Gm-Message-State: AOAM531mb44UueV31pX0WEuCMmCdTh2lmCCYZgw8rWKp6C++ZKIXwhCe flK7+i7RadyPAZfHOaL2P4fLRQ== X-Google-Smtp-Source: ABdhPJxKw2wqGpRXe1fLvV/79Sl1uAED6JKjJzU/P927OAlQ/HHK1yWh6eQQNXPPwCr5bzHBz4sJdg== X-Received: by 2002:a17:906:2dda:: with SMTP id h26mr33465820eji.163.1615965744072; Wed, 17 Mar 2021 00:22:24 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id hd37sm10401176ejc.114.2021.03.17.00.22.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:20 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 128C51FF90; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 04/15] plugins: expand kernel-doc for qemu_info_t Date: Wed, 17 Mar 2021 07:22:05 +0000 Message-Id: <20210317072216.16316-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62f; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62f.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It seems kernel-doc struggles a bit with typedef structs but with enough encouragement we can get something out of it. Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-5-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 3303dce862..4b84c6c293 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -49,22 +49,30 @@ extern QEMU_PLUGIN_EXPORT int qemu_plugin_version; #define QEMU_PLUGIN_VERSION 1 -typedef struct { - /* string describing architecture */ +/** + * struct qemu_info_t - system information for plugins + * + * This structure provides for some limited information about the + * system to allow the plugin to make decisions on how to proceed. For + * example it might only be suitable for running on some guest + * architectures or when under full system emulation. + */ +typedef struct qemu_info_t { + /** @target_name: string describing architecture */ const char *target_name; + /** @version: minimum and current plugin API level */ struct { int min; int cur; } version; - /* is this a full system emulation? */ + /** @system_emulation: is this a full system emulation? */ bool system_emulation; union { - /* - * smp_vcpus may change if vCPUs can be hot-plugged, max_vcpus - * is the system-wide limit. - */ + /** @system: information relevant to system emulation */ struct { + /** @system.smp_vcpus: initial number of vCPUs */ int smp_vcpus; + /** @system.max_vcpus: maximum possible number of vCPUs */ int max_vcpus; } system; }; From patchwork Wed Mar 17 07:22:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454517 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=FQqUNzxO; 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 4F0hSy3dZsz9sWH for ; Wed, 17 Mar 2021 18:22:58 +1100 (AEDT) Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQW8-0003e8-Fo for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:22:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVh-0003Zp-Fe for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:29 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:43757) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVf-0007uo-Um for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:29 -0400 Received: by mail-ed1-x531.google.com with SMTP id e7so964264edu.10 for ; Wed, 17 Mar 2021 00:22:27 -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=rOvOpng9pl80hnu05BmVHMESelx8rLsVtqsYPb3j22s=; b=FQqUNzxOE6I0/9DHE8+Zuwg2PSFKku2HQYvQOWd5xwH/J+XaXGb5KeXH+qupO9uLWQ goP2WbFjlW3ydSBitXslhQT1wkuqicERkvQ2fs5CI64l2Ip/hVyzuKzsmSxQlbHng7PI oUMM/UGTW4JZJXhgrRQagA8Yc93Enr/pl74SXroseFQr6nRfVkly5mNVNwLS70Sosuyx y0YlRgggVYAEk0Plil0z35EU4XMrM18s2CZcBe9VPBje7MG5/BkVCD8WhbFjRugVo9Vo jgs7Q3F0rn94yH72Uj6ZoUQLcWzOKYqmquML184ctFUW5f4NfjgKyuTS6GF/pE5Qokez oSXg== 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=rOvOpng9pl80hnu05BmVHMESelx8rLsVtqsYPb3j22s=; b=GzIL/ANjCrQfa69hWO7ATVREehiYv7KqnRhpdS9s+xssYWvj2qIaoyIrZxEMhxacRU MXW4c36/aIKmnwGHHFtY6Fy0gr+IUStQ1F895NpTUPxcZPJQWyd3DevtFaO99f3xYuZq VWwyFJRGnfvcjGXIPyseYzeJKdsYIV+72fgCTFFmAQbEhP200kGYUQIvLfphUFvhAAKJ 20/7SFXA++s+AISlug0Dq7i4TEErYJfn0RtE02gNaFcXy6IqZmvptDPA2wptzEXVeaSp S5yUcSzh/J3Wom3QPigCKmXrnfSJziAVoww1dvbT3V30uU8Pb6IG3tZUv+0InprYUNFn JwDg== X-Gm-Message-State: AOAM532AkjB5AqBmU31JLUtM+/dqdTlq+ommNDyaub/gkE6O/8WJhygY imGaUEfGcm/7fmEhZwcZ4h9pOJW7ua+bIrH5 X-Google-Smtp-Source: ABdhPJxDwOlJmd8XJ5GrfhRGEjSsqrUsbwp1ApEZ10u93Ezfl9oM05X5D49chAfSDnqOQ5SiCGaWBQ== X-Received: by 2002:a05:6402:447:: with SMTP id p7mr40402399edw.89.1615965746649; Wed, 17 Mar 2021 00:22:26 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id br13sm10728949ejb.87.2021.03.17.00.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 2761B1FF91; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 05/15] plugins: cleanup kernel-doc for qemu_plugin_install Date: Wed, 17 Mar 2021 07:22:06 +0000 Message-Id: <20210317072216.16316-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" kernel-doc doesn't like multiple Note sections. Also add an explicit Return. Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-6-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 4b84c6c293..ac1bb318da 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -85,15 +85,15 @@ typedef struct qemu_info_t { * @argc: number of arguments * @argv: array of arguments (@argc elements) * - * All plugins must export this symbol. - * - * Note: Calling qemu_plugin_uninstall() from this function is a bug. To raise - * an error during install, return !0. + * All plugins must export this symbol which is called when the plugin + * is first loaded. Calling qemu_plugin_uninstall() from this function + * is a bug. * * Note: @info is only live during the call. Copy any information we - * want to keep. + * want to keep. @argv remains valid throughout the lifetime of the + * loaded plugin. * - * Note: @argv remains valid throughout the lifetime of the loaded plugin. + * Return: 0 on successful loading, !0 for an error. */ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, From patchwork Wed Mar 17 07:22:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454527 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=lu7JtU8b; 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 4F0hf23G7qz9sWH for ; Wed, 17 Mar 2021 18:30:50 +1100 (AEDT) Received: from localhost ([::1]:51352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQdk-0005o3-GW for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:30:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44248) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVk-0003fm-3W for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:32 -0400 Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]:40924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVi-0007wG-Ho for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:31 -0400 Received: by mail-ed1-x52c.google.com with SMTP id b16so977600eds.7 for ; Wed, 17 Mar 2021 00:22:30 -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=8reQeX3pGa2B4FJO8BMXlygofe+ASszosdyj7RtuxBU=; b=lu7JtU8bg7I/BC4Rt5wNHFQ6WWC58SSihpK6CiFGrW0tH2ROZTLZlfAklfdot/Ba4c i3ciYfFBPd7IJAVJpT9/DiWOLgedY1BeJymKlEtv6Pna8NKBcjX+qIdF1Rp+KwkFPEtT LMb85CxvDYo+MKN7OMugkMKPIZCkJXMgrSaTY0nImPoTiiqRQESV8YE5Fpgon+c6JZcC MtyySOk+zPqdqAPBc/Y//gX5I4dd/VE46Eg5z/xFW47rtY5D6MDN0MohpMyXasIuHwf3 ivbOUJXLd/U/Rxfr4s16SiKk4plfxCKsyLICwqoQGbzWfqfcDDQNRcwQoj7IcknbX4EQ adeQ== 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=8reQeX3pGa2B4FJO8BMXlygofe+ASszosdyj7RtuxBU=; b=RoX4t1lWSr4F3zgOZ92L+hT69ztun8ROzTPUb/sUZEjeuIyOBDxBr7lve/g6QaEiig s4P/pi4nS6QtlJbWb/sTXtycLZOvbw6mPFNp/e+HkKeK9u2QzSBWhOow6fG2NFy5BPbF MXe3s2iNaqs5Infe97FGxC+meBdxIRxeNqQZXVkqW9TO2VASP3aAm0hWBJCH1wvZ/UQj SZQJHlIF7F9JanZX042D+prZh2yHWDe18ueqIM4xsk3VJZG4xLF+CwwTi2zc87zY1tf6 hfXGfoiJTxwpdz48rwGU2J6/4rpP8WeDmpRkw69WvueZvx4Lx9/FOPxO9iHQhpxl/FCf ySCQ== X-Gm-Message-State: AOAM530W42Ii6Ax9S72rvGUuDuZzs7kF0gY44kFzt/HxWdr+ugxu60xz +q3sAz/K95OXcxuZHyBzL4qKew== X-Google-Smtp-Source: ABdhPJxHSG4x9CYkU2MssABgEvzoL9Rl9A7mdcQwcpoyHc5C88nWi5HRSInMyKk2HaSYchsXtDKkyQ== X-Received: by 2002:a50:f9c8:: with SMTP id a8mr40649492edq.270.1615965749213; Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id bi26sm10778079ejb.120.2021.03.17.00.22.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 3C0641FF92; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 06/15] plugins: expand the callback typedef kernel-docs Date: Wed, 17 Mar 2021 07:22:07 +0000 Message-Id: <20210317072216.16316-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x52c.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-7-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index ac1bb318da..09b235f0b4 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -99,17 +99,36 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, const qemu_info_t *info, int argc, char **argv); -/* - * Prototypes for the various callback styles we will be registering - * in the following functions. +/** + * typedef qemu_plugin_simple_cb_t - simple callback + * @id: the unique qemu_plugin_id_t + * + * This call-back passes no information aside from the unique @id. */ typedef void (*qemu_plugin_simple_cb_t)(qemu_plugin_id_t id); +/** + * typedef qemu_plugin_udata_cb_t - callback with user data + * @id: the unique qemu_plugin_id_t + * @userdata: a pointer to some user data supplied when the call-back + * was registered. + */ typedef void (*qemu_plugin_udata_cb_t)(qemu_plugin_id_t id, void *userdata); +/** + * typedef qemu_plugin_vcpu_simple_cb_t - vcpu callback + * @id: the unique qemu_plugin_id_t + * @vcpu_index: the current vcpu context + */ typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plugin_id_t id, unsigned int vcpu_index); +/** + * typedef qemu_plugin_vcpu_udata_cb_t - vcpu callback + * @vcpu_index: the current vcpu context + * @userdata: a pointer to some user data supplied when the call-back + * was registered. + */ typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, void *userdata); From patchwork Wed Mar 17 07:22:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454519 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=N18RdG97; 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 4F0hWH6Wg6z9sWH for ; Wed, 17 Mar 2021 18:24:59 +1100 (AEDT) Received: from localhost ([::1]:33434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQY5-0006y3-P8 for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:24:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVi-0003bh-Hf for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:30 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:43762) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVg-0007vZ-RM for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:30 -0400 Received: by mail-ed1-x536.google.com with SMTP id e7so964297edu.10 for ; Wed, 17 Mar 2021 00:22:28 -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=WwdIc1nYUBWZsiYa6eZD17PeQKNBn/C2DU9VKz8Ljaw=; b=N18RdG9755grdkkzGNAk0y68rAsroFK588yDpenODp9Pd5COmfewhiXYVyB6TJCV8r c2oyd0V+XzzjBnDgsCJT6aUC00WxvY/WT7TFiSttpIF0LCEuiJ5YlJjGZNWUf/JAT9y5 xT31jxRtaB8JrwywJ0+mLaXMJV0hXFYfcbXwcLlo3qqjT5gde6GfrzsI3sNp5Oh1SZmA M4v7dvaRb52QpHFtfqv3nBlJJjhpZzWaSxR9WLm3+nEePDygsHAbBUOXshQL4QpNVTnl WqgJrwE0hTp7EJhNKBfxzmA+dd67KLZ4qcIIBeOCzITTGsR4loSxkyJzySK8EfgdiT1o pUKQ== 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=WwdIc1nYUBWZsiYa6eZD17PeQKNBn/C2DU9VKz8Ljaw=; b=ojfmVaTKMSfwh1QwbbsssHz8TPpWFPoIz2dJzqw/imS7mpeg6leruCuMYKSZR0/QKC coDMeCl2sYekcZ08ew9LpxF8tTDEAWSd6GoK9QQ6KmAh2LoDOmNaRfuanl4GOFavXgiq xHL0E9et8rya3L39pVj0nX/S1ZayyW/N8jTMtOUYrdt3VAC6Wz2Y/o4DXtBxCXT1DwhV kkKaQ0l4MtAVWaLUxQmlYGirygbzZJ7WcJ7jHUNoOPRhfZ7sbrLvSrJ2BGre3ZNq4y/h Uv1UXG05gfq9I87pl1fLE5RVeSivui2EgnbXJcQUTbAg4QXGjFZdlXJGx3C/NVIIpfqi PiSA== X-Gm-Message-State: AOAM5304fh12AjC3ZUtTDXBa5KriRuTAZ/0zI2e3HVuTXCBMxN/94FL4 xC5Wkm1TOLpiUZUtRHyRPGHv2g== X-Google-Smtp-Source: ABdhPJyISPsPvQc3hN+YCjZs7X/BF/IPUbKQFu+ZsLYBK8jsL7ann4FhWSXm6zTbT5eLl8N7iktdNg== X-Received: by 2002:a50:ed83:: with SMTP id h3mr41597550edr.140.1615965747515; Wed, 17 Mar 2021 00:22:27 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id e16sm2977649ejc.63.2021.03.17.00.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 5101C1FF93; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 07/15] plugins: expand the typedef kernel-docs for translation Date: Wed, 17 Mar 2021 07:22:08 +0000 Message-Id: <20210317072216.16316-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x536.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-8-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 09b235f0b4..529fe3e16b 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -103,14 +103,14 @@ QEMU_PLUGIN_EXPORT int qemu_plugin_install(qemu_plugin_id_t id, * typedef qemu_plugin_simple_cb_t - simple callback * @id: the unique qemu_plugin_id_t * - * This call-back passes no information aside from the unique @id. + * This callback passes no information aside from the unique @id. */ typedef void (*qemu_plugin_simple_cb_t)(qemu_plugin_id_t id); /** * typedef qemu_plugin_udata_cb_t - callback with user data * @id: the unique qemu_plugin_id_t - * @userdata: a pointer to some user data supplied when the call-back + * @userdata: a pointer to some user data supplied when the callback * was registered. */ typedef void (*qemu_plugin_udata_cb_t)(qemu_plugin_id_t id, void *userdata); @@ -126,7 +126,7 @@ typedef void (*qemu_plugin_vcpu_simple_cb_t)(qemu_plugin_id_t id, /** * typedef qemu_plugin_vcpu_udata_cb_t - vcpu callback * @vcpu_index: the current vcpu context - * @userdata: a pointer to some user data supplied when the call-back + * @userdata: a pointer to some user data supplied when the callback * was registered. */ typedef void (*qemu_plugin_vcpu_udata_cb_t)(unsigned int vcpu_index, @@ -202,11 +202,9 @@ void qemu_plugin_register_vcpu_idle_cb(qemu_plugin_id_t id, void qemu_plugin_register_vcpu_resume_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_simple_cb_t cb); -/* - * Opaque types that the plugin is given during the translation and - * instrumentation phase. - */ +/** struct qemu_plugin_tb - Opaque handle for a translation block */ struct qemu_plugin_tb; +/** struct qemu_plugin_insn - Opaque handle for a translated instruction */ struct qemu_plugin_insn; enum qemu_plugin_cb_flags { @@ -221,6 +219,14 @@ enum qemu_plugin_mem_rw { QEMU_PLUGIN_MEM_RW, }; +/** + * typedef qemu_plugin_vcpu_tb_trans_cb_t - translation callback + * @id: unique plugin id + * @tb: opaque handle used for querying and instrumenting a block. + */ +typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, + struct qemu_plugin_tb *tb); + /** * qemu_plugin_register_vcpu_tb_trans_cb() - register a translate cb * @id: plugin ID @@ -233,9 +239,6 @@ enum qemu_plugin_mem_rw { * callbacks to be triggered when the block or individual instruction * executes. */ -typedef void (*qemu_plugin_vcpu_tb_trans_cb_t)(qemu_plugin_id_t id, - struct qemu_plugin_tb *tb); - void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_tb_trans_cb_t cb); From patchwork Wed Mar 17 07:22:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454525 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OnzRCfFh; 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 4F0hbB0v3Rz9sWH for ; Wed, 17 Mar 2021 18:28:20 +1100 (AEDT) Received: from localhost ([::1]:46338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQbJ-0003lG-OI for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:28:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44202) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVf-0003XD-TX for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:27 -0400 Received: from mail-ed1-x532.google.com ([2a00:1450:4864:20::532]:40929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVe-0007tQ-Bs for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:27 -0400 Received: by mail-ed1-x532.google.com with SMTP id b16so977426eds.7 for ; Wed, 17 Mar 2021 00:22:25 -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=RWi98yBYxFr5e8I4Wn7WdxDUPeaj7H5bHss1HaZsEQE=; b=OnzRCfFhmmG9h0GYKqx2kuurRjBXeL9PlzpNeMxvaYp40gt5/NpZLMeuDVCilhhJ7Q nWO8uJAHMg8T70CS/Oa3ajof+E5LbpAI2MnpYeKR1uuFZegTnShkC4CPv8/IkVaQggJX 9b+g+0mNACxk5D/0WpmXCP4uTrCFCiEnt1OYMNLDB7JdgQ7aBdx6kmoI44I58Cw1YS2S uF00zLJjV7kD97SoXX3ZMiKJDgWfSQSigwdJCik8lyOVfOFE7MtJnPcchmvu/FsKfkqa yZZbOTBFJHW/fhs++LJ/5wo69QFv1rYcG55rkfxjffElqmGyQ8jJZOUWJQq9fr0c0x4I aSTA== 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=RWi98yBYxFr5e8I4Wn7WdxDUPeaj7H5bHss1HaZsEQE=; b=aVfTHK26nzJrWJl6vbLepLlqLeu9f1UrrSQwXu8VW+zlfWT15sAwRNfLzCg/qaoxBt uydjyiJexfeo08UBErUf3AjQbd2z+qqpsKDNRADtgBKcQB8YXeyeAiSgZRVsBcW4hV// fqSt0yAIkweb3/LkJRcHU38Va0oQEaBy32WJRSGpWxtz0kSpX/95Rkl5+9Os7lGixKVC kLbdcWk72ChKfgI8oelJc/gMAA0l/J7aosHLJbY75IrW/ev1sRIZFU7PnrDhDwJBlyOC TTr3cb/iDqDQOVa3r4m5pyzyLk32laRLJEfVicMMh6FCaenUGgf1haoKwgOp6GkDeE32 iDdQ== X-Gm-Message-State: AOAM531qdwE/WjeTOnTlCyifY2YJvjJcW2m0gjQjDFSBbnfqgYUjTCAn wBOgkl4mCe650te36R7NkqNVGg== X-Google-Smtp-Source: ABdhPJxf1FjsWuDyea39uIBquZwtVXu6WuCgfZhy5EzxwEvAn0xhTxMYw1pD+clU0fLfMqtLJoL6Gg== X-Received: by 2002:aa7:c550:: with SMTP id s16mr40404500edr.98.1615965745027; Wed, 17 Mar 2021 00:22:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id q26sm10743054eja.45.2021.03.17.00.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:21 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 658F51FF96; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 08/15] plugins: add qemu_plugin_cb_flags to kernel-doc Date: Wed, 17 Mar 2021 07:22:09 +0000 Message-Id: <20210317072216.16316-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::532; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x532.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Also add a note to explain currently they are unused. Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-9-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 529fe3e16b..e4d782b628 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -207,10 +207,20 @@ struct qemu_plugin_tb; /** struct qemu_plugin_insn - Opaque handle for a translated instruction */ struct qemu_plugin_insn; +/** + * enum qemu_plugin_cb_flags - type of callback + * + * @QEMU_PLUGIN_CB_NO_REGS: callback does not access the CPU's regs + * @QEMU_PLUGIN_CB_R_REGS: callback reads the CPU's regs + * @QEMU_PLUGIN_CB_RW_REGS: callback reads and writes the CPU's regs + * + * Note: currently unused, plugins cannot read or change system + * register state. + */ enum qemu_plugin_cb_flags { - QEMU_PLUGIN_CB_NO_REGS, /* callback does not access the CPU's regs */ - QEMU_PLUGIN_CB_R_REGS, /* callback reads the CPU's regs */ - QEMU_PLUGIN_CB_RW_REGS, /* callback reads and writes the CPU's regs */ + QEMU_PLUGIN_CB_NO_REGS, + QEMU_PLUGIN_CB_R_REGS, + QEMU_PLUGIN_CB_RW_REGS, }; enum qemu_plugin_mem_rw { From patchwork Wed Mar 17 07:22:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454520 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=gy62vv54; 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 4F0hWJ0Y8dz9sWP for ; Wed, 17 Mar 2021 18:25:00 +1100 (AEDT) Received: from localhost ([::1]:33494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQY6-0006zU-1w for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:24:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44282) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVn-0003nl-Gz for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:35 -0400 Received: from mail-ed1-x531.google.com ([2a00:1450:4864:20::531]:33714) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVl-0007xn-SW for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:35 -0400 Received: by mail-ed1-x531.google.com with SMTP id w18so1028826edc.0 for ; Wed, 17 Mar 2021 00:22:33 -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=oZoHAKKtaXp3YWXMdf36XUZYzFbYS4h/e3YtWNeuchc=; b=gy62vv54ZkbveyrTseLe9Ytdnu2+mMur/EF87SV7aEfRn3m+Td/zG2qtIOeeTq3cAe s5Yv8MOfsFSXNIHRwV/q2YR6DIits+y1xAQ0Jxhmj/7XvL8ZBQBZ09LPc6oSXZWnPQVC XAblA+c99vyxoAwBOqxy3JyQNntruUS8VDlE5U4toOBhpCfWsvxFic1jgBn0QWKDD1uE 0VSR02csYyBPl2ys0plRXmVc5XBbygDB1fBvsbwDJCF0tcOWjLu7IMbVE21LYsTcv+4Z wNm7NWgT25b8Hk/stUVzoYO3d7huueuRqgam3+a9NiK3ueagFyv3oBd3kZdao3GjYEtP nPow== 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=oZoHAKKtaXp3YWXMdf36XUZYzFbYS4h/e3YtWNeuchc=; b=gAhaFN9biHC9QqgMY3JV4CDLeob+C9EO0XVxUECFwhUm3Sd/u5kERo6wKF5jEUJVSL 23FAF4lGQjOjpbQLqs34LG6Ero6bLZW4aq8WC5EM2RXHQ0LKeuFT3dzX8etcV5Cz+PKm 1RRc1J0xZTq4X5A1w8Qqj7hl5Sl32gbJaceGlHDtJndlhtEnWCWVtgHAAozqnm5n5Ah4 Cs5gfhf0g7Vno6iMRUZD9EoUn4hoFpwLm8BECmVp+P90R9NZXC3wWzUJlQ28QvHqc7cc lfSIrTkgUzvU9x2oNXa+n77VeJu1HcXa+JG3Qmc5AjcjC6XWXg76e8DbUuE9+sciKYZk p96A== X-Gm-Message-State: AOAM531BcFosz54alt0dUCylI1UPXXwfa04Sta1hw8zt78LMKn2Ea6X4 5O8nscGZbBy+SfLvGxEc1G1MxQ== X-Google-Smtp-Source: ABdhPJxnOfDFMkTGx1o4BqjzC1r+hIOwDvoc80ITVlDB/J+6/b1RoHwFZeqBJip99XPn6g6Y5hr66Q== X-Received: by 2002:a05:6402:32d:: with SMTP id q13mr40632958edw.17.1615965752655; Wed, 17 Mar 2021 00:22:32 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id a26sm12622593edm.15.2021.03.17.00.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 78EF31FF98; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 09/15] plugins: add qemu_plugin_id_t to kernel-doc Date: Wed, 17 Mar 2021 07:22:10 +0000 Message-Id: <20210317072216.16316-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::531; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x531.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-10-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index e4d782b628..272d240a8f 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -32,6 +32,9 @@ #define QEMU_PLUGIN_LOCAL __attribute__((visibility("hidden"))) #endif +/** + * typedef qemu_plugin_id_t - Unique plugin ID + */ typedef uint64_t qemu_plugin_id_t; /* From patchwork Wed Mar 17 07:22:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454526 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=B8zu3exm; 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 4F0hbC3fRqz9sWH for ; Wed, 17 Mar 2021 18:28:23 +1100 (AEDT) Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQbN-0003s7-IZ for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:28:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44318) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVr-0003wO-10 for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:39 -0400 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]:40929) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVo-0007zV-Ed for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:38 -0400 Received: by mail-ed1-x530.google.com with SMTP id b16so977850eds.7 for ; Wed, 17 Mar 2021 00:22:36 -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=rQc1qB+dj1Aep27H7tyCH6v/LAf+f1B6hR9k7rulrqQ=; b=B8zu3exmsDI27bxT/ZQdAn2bvvSL81LymVUnEUr8oOWiLHZWkxMhARDhD//mMIO5Mj nhLT27cC2gaiq8YmzZ7P+ds+eiwC9BkS0ftukDbPZQEe4ThIRmrn/fO4qllEManRJ8nL VcocpmUPibYF9c6y+/VZy2kFuoBku7ePIz2EDUfnfN/mGvRMhf13R32y1k3qOYHdZJFy tYNJ+yPvTXyg8hrfjeMv4PhDfZa6qaAyD8gReehvodfKDlgDodvnSoD8HOZ2+P0kHGAH xWg56ObmhpeYMnKn43IIOx0gBvwX48tyrEN/wwcB90SaDOUb8Ire6w1X0Pm8vutHU68E wjrA== 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=rQc1qB+dj1Aep27H7tyCH6v/LAf+f1B6hR9k7rulrqQ=; b=MDX99z9Hpt3LS6zVopKvegD+wjp4kNOhyTXunlHoLxm+m7usK6V5MBpDvRh8QOgQ8z /vjzyGVpJnO0K2+UQimNEw2l7tvzcMCImBwReGrfcZ2JJ5RehV7r2dw0mU1qHLisJ1Ma i1Tcpw3KBbQzH9rBZxzTyecGcVnQzTaI6U29Yc31WBF545VpKNz4JuMzSfFGR1Pzz1zd +5dnLe3AT7ZvOFZBdN7qD7u/TNVSZEbLnCMfVoUjnp5RR2hXj7F8gyiZngirCDvnoXyS aJnHynALuCBRt3FfAD/BZXzzAyr1rEIxd1Tbv2h0rPGkL7wIFm0A9iiZffrOBKsnkF2Y nbKg== X-Gm-Message-State: AOAM533xPYvxQhWDp05UArHS9ld8xuhI/6tkt4Rl6ZIkwnuGT4Il5brm HZaiw/HKL6yG/gAWGvnxPUWksg== X-Google-Smtp-Source: ABdhPJzWZeQsq8RHBLr3LUcO2Nw+1p4LMFjyoXma+bQOJM1aDChSpZ9gcGYfAOzI2MbV6d38XOZvZw== X-Received: by 2002:a05:6402:48c:: with SMTP id k12mr40595149edv.237.1615965755118; Wed, 17 Mar 2021 00:22:35 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v1sm10347142ejd.3.2021.03.17.00.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 8CBE91FF99; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 10/15] plugins: expand inline exec kernel-doc documentation. Date: Wed, 17 Mar 2021 07:22:11 +0000 Message-Id: <20210317072216.16316-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=alex.bennee@linaro.org; helo=mail-ed1-x530.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove the extraneous @cb parameter and document the non-atomic nature of the INLINE_ADD_U64 operation. Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-11-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 272d240a8f..a3805bb299 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -269,6 +269,14 @@ void qemu_plugin_register_vcpu_tb_exec_cb(struct qemu_plugin_tb *tb, enum qemu_plugin_cb_flags flags, void *userdata); +/** + * enum qemu_plugin_op - describes an inline op + * + * @QEMU_PLUGIN_INLINE_ADD_U64: add an immediate value uint64_t + * + * Note: currently only a single inline op is supported. + */ + enum qemu_plugin_op { QEMU_PLUGIN_INLINE_ADD_U64, }; @@ -283,6 +291,9 @@ enum qemu_plugin_op { * Insert an inline op to every time a translated unit executes. * Useful if you just want to increment a single counter somewhere in * memory. + * + * Note: ops are not atomic so in multi-threaded/multi-smp situations + * you will get inexact results. */ void qemu_plugin_register_vcpu_tb_exec_inline(struct qemu_plugin_tb *tb, enum qemu_plugin_op op, @@ -305,7 +316,6 @@ void qemu_plugin_register_vcpu_insn_exec_cb(struct qemu_plugin_insn *insn, /** * qemu_plugin_register_vcpu_insn_exec_inline() - insn execution inline op * @insn: the opaque qemu_plugin_insn handle for an instruction - * @cb: callback function * @op: the type of qemu_plugin_op (e.g. ADD_U64) * @ptr: the target memory location for the op * @imm: the op data (e.g. 1) From patchwork Wed Mar 17 07:22:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454528 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=YIg0u2dF; 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 4F0hfF2CsNz9sWH for ; Wed, 17 Mar 2021 18:31:01 +1100 (AEDT) Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQdv-0005wQ-1p for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:30:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVs-0003zO-9V for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:40 -0400 Received: from mail-ej1-x62c.google.com ([2a00:1450:4864:20::62c]:33152) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVq-00080I-9H for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:40 -0400 Received: by mail-ej1-x62c.google.com with SMTP id jt13so954249ejb.0 for ; Wed, 17 Mar 2021 00:22:37 -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=V1k83nSOBQHKX3KyY5kO2YVliDyi+4QoKl7OCC4rWPk=; b=YIg0u2dFh5+c3E5JAVrd5/R9nhrSIV/kDrAHKzyXxpSzPVvJRL1gk9d6NGmE7nbOsb xqYAQWq/JdV8M6AemeTVIfJOgp1qdTB8f/3yXW6HpofR7w+FfRXGVUV+TQhZoUvIhpeI cnGi7CM3Dhz5yUJi1AOF4J+lgF4ijjvjER9N2rHyhTbL8ecxrklzJVZJF5sIy/6MKfy1 u7IV35VeIeWTzZtqexox2CX7sZebKHxg6lXjMiRTS+Mcbt9NOAAXTivJgzHm8kS8EdQm ywmckWVxlHyBq0Y2478WJaHBFGQDTteVx+zq3mNWBFpBxD/78drJZZpUTMgPoUicLMFn eq3A== 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=V1k83nSOBQHKX3KyY5kO2YVliDyi+4QoKl7OCC4rWPk=; b=jt4P4LbTpHkd4Y5+XOHaL+AspDgeGrIhsx5pY1LbHGx9lsGeeDzJWrFwhvZULDYzjc BAY/zXRBGWhwLUSYlUCld/jWSRHbcDEOrxWJeoGZ4/pd5pS3SuC4PjBYMhOd6tV3kcRJ egKQT5u6f0YXLlGRfElsils73QQcm2P1MILHte9V+SEAac9GvY041SqTETTWP9TLNlCY oXm36OKNe/pSvFZFf8NzQPkEmQEL4ai1hOoA0gpdMmLiBWzxF/LnyHU2JlBr6e/ygPI2 iWnHRBCDmdxmAXIzP2HzxHkScBHNcDjFrk1XEEipnd9uk5u/KAZ81yBJoDodXDEudgqc +LQg== X-Gm-Message-State: AOAM532w0+phwa9i/QjEF7SbDOjeYe5fED5TqV+4FzT/LjvnD9fJjip0 kryBXnI44qf8C14hg+wdbVUYgw== X-Google-Smtp-Source: ABdhPJxr4uOpN9vOwGtM3xKGofY047n+uNTz5lE49/6c/AFMGbaL7kpI8K4HKxujaW/e3mWrkVnp+g== X-Received: by 2002:a17:906:1c41:: with SMTP id l1mr33671066ejg.299.1615965756888; Wed, 17 Mar 2021 00:22:36 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id v1sm10347155ejd.3.2021.03.17.00.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id A07021FF9A; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 11/15] plugins: expand kernel-doc for instruction query and instrumentation Date: Wed, 17 Mar 2021 07:22:12 +0000 Message-Id: <20210317072216.16316-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62c; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62c.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-12-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index a3805bb299..ad9dc4b69d 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -327,21 +327,70 @@ void qemu_plugin_register_vcpu_insn_exec_inline(struct qemu_plugin_insn *insn, enum qemu_plugin_op op, void *ptr, uint64_t imm); -/* - * Helpers to query information about the instructions in a block +/** + * qemu_plugin_tb_n_insns() - query helper for number of insns in TB + * @tb: opaque handle to TB passed to callback + * + * Returns: number of instructions in this block */ size_t qemu_plugin_tb_n_insns(const struct qemu_plugin_tb *tb); +/** + * qemu_plugin_tb_vaddr() - query helper for vaddr of TB start + * @tb: opaque handle to TB passed to callback + * + * Returns: virtual address of block start + */ uint64_t qemu_plugin_tb_vaddr(const struct qemu_plugin_tb *tb); +/** + * qemu_plugin_tb_get_insn() - retrieve handle for instruction + * @tb: opaque handle to TB passed to callback + * @idx: instruction number, 0 indexed + * + * The returned handle can be used in follow up helper queries as well + * as when instrumenting an instruction. It is only valid for the + * lifetime of the callback. + * + * Returns: opaque handle to instruction + */ struct qemu_plugin_insn * qemu_plugin_tb_get_insn(const struct qemu_plugin_tb *tb, size_t idx); +/** + * qemu_plugin_insn_data() - return ptr to instruction data + * @insn: opaque instruction handle from qemu_plugin_tb_get_insn() + * + * Note: data is only valid for duration of callback. See + * qemu_plugin_insn_size() to calculate size of stream. + * + * Returns: pointer to a stream of bytes containing the value of this + * instructions opcode. + */ const void *qemu_plugin_insn_data(const struct qemu_plugin_insn *insn); +/** + * qemu_plugin_insn_size() - return size of instruction + * @insn: opaque instruction handle from qemu_plugin_tb_get_insn() + * + * Returns: size of instruction in bytes + */ size_t qemu_plugin_insn_size(const struct qemu_plugin_insn *insn); +/** + * qemu_plugin_insn_vaddr() - return vaddr of instruction + * @insn: opaque instruction handle from qemu_plugin_tb_get_insn() + * + * Returns: virtual address of instruction + */ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); + +/** + * qemu_plugin_insn_haddr() - return hardware addr of instruction + * @insn: opaque instruction handle from qemu_plugin_tb_get_insn() + * + * Returns: hardware (physical) target address of instruction + */ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); /* From patchwork Wed Mar 17 07:22:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454523 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=lDnaYUdH; 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 4F0hYh3hkPz9sWH for ; Wed, 17 Mar 2021 18:27:04 +1100 (AEDT) Received: from localhost ([::1]:42032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQa6-00023H-GY for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:27:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44294) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVo-0003pk-Cx for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:36 -0400 Received: from mail-ej1-x62a.google.com ([2a00:1450:4864:20::62a]:39011) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVm-0007ye-Kt for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:36 -0400 Received: by mail-ej1-x62a.google.com with SMTP id p7so925350eju.6 for ; Wed, 17 Mar 2021 00:22:34 -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=R7lizkJGrEEFe1N4Cl40O7ejnX+xPKrdbbOuYdIm6D8=; b=lDnaYUdHTckIdUm09Ly+CVcaUZPb8AeaLbbcVN0FrExOZn45nJpXcYxZC9S4IcVoQW agr1/0jDkul7SSJonFCx50L8ITLvvfil/aq3V5qbtL75QdMwPiC+eOyCJXokhIGpM12A ww2/nHIr1REeaWMhmij5+Z2vewc0FNnn6ta/aL1LtFjbqVAqrQ1anvvNLutTxv3eNSpC zS7qjJE7bPzkq6Llz/U0B0QtCX2G9cOaCqzvxEFGwjO9VfkcBfahP3neOYSwSlzqQj/E boVIp2cdwa0zMcbhe0zbgBaffjiGx3lK/7UeCDncEaXRlGqFjojDJ/gI4/SV537byH/p /Q2w== 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=R7lizkJGrEEFe1N4Cl40O7ejnX+xPKrdbbOuYdIm6D8=; b=KHPMlA7+cJnEvwwUTWgUjdj70MvqNMxO5Z4eX8kbGkdp3iGTTSobcWeg6RM7GIRWoF 1DrGf/wZiF6nfOqIZ/T96Ud8WYs8vNH80oSwWn53iTYOnJoe034lXSZTj/tFwe/qgZR8 JxTa+OZIKAKDWT7KSvYd+Eh52Xe6J0eRIj5F/Mdcpjtv+2izJTIlObq30w0PfmazvAl3 4PC8jakez+icxocdBKpNEy2ziNA3R+sU6OQRWmMxoE3snRoOSGCQwW6up7EAgazM7tng 0pmR/lpqeTUs5Mk1Bo+N6F3URxx9QYiARotRuU+lA1uDCDFdY4kAsPzU3t4m3hAd3/CW qBfA== X-Gm-Message-State: AOAM530zrlF+0xeNrYKjMwHnymNntRP06c5fGYCNQ/+g4BvsQ9wUheqZ Pg0uDfp1/8kukSpzYDquRr+oyQ== X-Google-Smtp-Source: ABdhPJyFTsGpL4sjt9jUEkuwv+FkqQl+ER1qxTF/io/UtWJNF7UJcLBOudCQSs/09qFCfdbjqQhDQw== X-Received: by 2002:a17:906:4410:: with SMTP id x16mr34070802ejo.446.1615965753355; Wed, 17 Mar 2021 00:22:33 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s11sm11792072edt.27.2021.03.17.00.22.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id B53A11FF9B; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 12/15] plugins: expand kernel-doc for memory query and instrumentation Date: Wed, 17 Mar 2021 07:22:13 +0000 Message-Id: <20210317072216.16316-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62a; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62a.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-13-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index ad9dc4b69d..9e67ab1aa2 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -393,24 +393,48 @@ uint64_t qemu_plugin_insn_vaddr(const struct qemu_plugin_insn *insn); */ void *qemu_plugin_insn_haddr(const struct qemu_plugin_insn *insn); -/* - * Memory Instrumentation +/** + * typedef qemu_plugin_meminfo_t - opaque memory transaction handle * - * The anonymous qemu_plugin_meminfo_t and qemu_plugin_hwaddr types - * can be used in queries to QEMU to get more information about a - * given memory access. + * This can be further queried using the qemu_plugin_mem_* query + * functions. */ typedef uint32_t qemu_plugin_meminfo_t; +/** struct qemu_plugin_hwaddr - opaque hw address handle */ struct qemu_plugin_hwaddr; -/* meminfo queries */ +/** + * qemu_plugin_mem_size_shift() - get size of access + * @info: opaque memory transaction handle + * + * Returns: size of access in ^2 (0=byte, 1=16bit, 2=32bit etc...) + */ unsigned int qemu_plugin_mem_size_shift(qemu_plugin_meminfo_t info); +/** + * qemu_plugin_mem_is_sign_extended() - was the access sign extended + * @info: opaque memory transaction handle + * + * Returns: true if it was, otherwise false + */ bool qemu_plugin_mem_is_sign_extended(qemu_plugin_meminfo_t info); +/** + * qemu_plugin_mem_is_big_endian() - was the access big endian + * @info: opaque memory transaction handle + * + * Returns: true if it was, otherwise false + */ bool qemu_plugin_mem_is_big_endian(qemu_plugin_meminfo_t info); +/** + * qemu_plugin_mem_is_store() - was the access a store + * @info: opaque memory transaction handle + * + * Returns: true if it was, otherwise false + */ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info); /** * qemu_plugin_get_hwaddr() - return handle for memory operation + * @info: opaque memory info structure * @vaddr: the virtual address of the memory operation * * For system emulation returns a qemu_plugin_hwaddr handle to query From patchwork Wed Mar 17 07:22:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454521 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=pwaG5Vb0; 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 4F0hWN5fhgz9sWH for ; Wed, 17 Mar 2021 18:25:04 +1100 (AEDT) Received: from localhost ([::1]:33726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQYA-000754-Rw for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:25:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44342) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQVs-00040k-Oe for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:40 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:37085) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQVr-00080o-2W for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:22:40 -0400 Received: by mail-ej1-x635.google.com with SMTP id bm21so932253ejb.4 for ; Wed, 17 Mar 2021 00:22:38 -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=ni0Dyqm715Q2j3M0if5MLO5cU8ZgOph+rmN9Yhbc+iM=; b=pwaG5Vb09w3p/a7dC4xADrDJqsRiouLACkBVOKwLfGF3zyDxM7+EYEPWmxHQzhW30h Zjn44hKsRPgKsAabfyRpfdV1NODS9SFW8ittDCIwA4Id0vCSjGsiM955SNpGjqdP9aIG aMcgTzMToGkYICLuonPsx1hcHk9mo7K5P6it+rsND34HLC5hBoKJIa3j0jC6m7VaAYva rN3HnCx1OmxS3OP7b46sCNB4wIM/yh1lLzJW4ZCyrF38kJ0uUNxv4QF54Yxmmr40SbPx RLSmP4YqqpJgSYX+hHGVthFYfBYixvq08BhAspUmTpvaed1uBpK5KUAFj6FUpa3ND76D 43XQ== 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=ni0Dyqm715Q2j3M0if5MLO5cU8ZgOph+rmN9Yhbc+iM=; b=QLbH6s0oPvP9WHOizxY0LMtOTcBh9NXIlTxZBuXYC2R9+k4g2ycliQ20ySyTV28tb3 JfK2vtvq3ceEajAewJEQi424SInTy1R6CSaKBaXB1/5O4+K75MTZJ7OPN8pin6JWQtrc 2O4GTAlHFPepR8eWbtq/tiQ/3CtuVYNlmIhgfgUbxjh8C3GUfIBZ3pvJNyaSYOM8+W8a /zAn/QjXtSwuoh4csx1vXpv8PYgQgzUw41pCD1VbOpMolcZQtkvup6KkNfJFTcNGcUBB UoVn+ZQMrkcWozQmxkZI2DwtwCALcsG+7iP7oetJHUy1bhGldwf1OdHn2O4eUpQh2RIh 7afA== X-Gm-Message-State: AOAM531wDgI0chgZvMQqY8vxcDYeCpraaSR8AnBYCJgKCZOugNjJO5oP 2LvGdUbY1DdukrGDDIbcJdOoRQ== X-Google-Smtp-Source: ABdhPJw26j6TXQFkecawjYQWb89R8Mr7gp241uztJfYPPu9r2nPRyMwRWRP3gwIvTF379u3tBZ7AxA== X-Received: by 2002:a17:906:68c5:: with SMTP id y5mr34197545ejr.371.1615965757737; Wed, 17 Mar 2021 00:22:37 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id s20sm10826891ejj.38.2021.03.17.00.22.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:22:29 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id C9E511FF9C; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 13/15] plugins: getting qemu_plugin_get_hwaddr only expose one function prototype Date: Wed, 17 Mar 2021 07:22:14 +0000 Message-Id: <20210317072216.16316-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com 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, 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: Yonggang Luo , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo This is used for counting how much function are export to qemu plugin. Signed-off-by: Yonggang Luo Signed-off-by: Alex Bennée Reviewed-by: Alex Bennée Message-Id: <20201013002806.1447-2-luoyonggang@gmail.com> Message-Id: <20210312172821.31647-14-alex.bennee@linaro.org> diff --git a/plugins/api.c b/plugins/api.c index 3c7dc406e3..b22998cd7c 100644 --- a/plugins/api.c +++ b/plugins/api.c @@ -266,10 +266,12 @@ bool qemu_plugin_mem_is_store(qemu_plugin_meminfo_t info) #ifdef CONFIG_SOFTMMU static __thread struct qemu_plugin_hwaddr hwaddr_info; +#endif struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, uint64_t vaddr) { +#ifdef CONFIG_SOFTMMU CPUState *cpu = current_cpu; unsigned int mmu_idx = info >> TRACE_MEM_MMU_SHIFT; hwaddr_info.is_store = info & TRACE_MEM_ST; @@ -281,14 +283,10 @@ struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, } return &hwaddr_info; -} #else -struct qemu_plugin_hwaddr *qemu_plugin_get_hwaddr(qemu_plugin_meminfo_t info, - uint64_t vaddr) -{ return NULL; -} #endif +} bool qemu_plugin_hwaddr_is_io(const struct qemu_plugin_hwaddr *haddr) { From patchwork Wed Mar 17 07:22:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454529 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=tpMK56Em; 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 4F0hhP5m80z9sWH for ; Wed, 17 Mar 2021 18:32:53 +1100 (AEDT) Received: from localhost ([::1]:57038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQfj-0008DO-CV for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:32:51 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45866) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQbj-0004o9-KK for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:28:43 -0400 Received: from mail-ej1-x62b.google.com ([2a00:1450:4864:20::62b]:40219) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQbh-0003GC-VA for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:28:43 -0400 Received: by mail-ej1-x62b.google.com with SMTP id ci14so934548ejc.7 for ; Wed, 17 Mar 2021 00:28:41 -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=SLpgbU4y8oq4TnAY1QjnMUkHwHhGEj8HGSa5T/LlBKc=; b=tpMK56EmS7tdJij07sRlK+oMsf9/aKHxmItX7cZ5EL1D9pRGXhf+ex0dc47Od3vqvL FCKS3d0dDoOEoxbMS3Ozc/nxnKK4zcIKeIXtJprHqaFmMNvtwzS5gL2YEOimINvJ6ePW o0eLbslCvDT+BV0h6uSXKJ2nsldtF4ieRXYVAzlFMobB6u8fIjcshvJhhm8j2H6oyDGb L6LyGzz7oSVBjQB54romeXfJZimcsQUhVxCtB8SMkKEldG+31BadWSyBQ8/cGy576Osg A5EaH1F+WJkjvOoOT8Xgeabd8THuTfMhMh17qZIWfCXWmF51rkGJvU/5//vVgFskDGGP C+eA== 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=SLpgbU4y8oq4TnAY1QjnMUkHwHhGEj8HGSa5T/LlBKc=; b=lRnFKsdtwrvdm9lpm0idLgwerEuPkll8qF34q6bGXRPZeZxoF07L3UogV6vw4I77BM eJcaEfBzcI4+gE/XSW23DYdnVwYxGny8Nwb/HLY3TleJOb6UIUE6NGWl5g1HdKQgD/2R J4tv4WMPeigvZPAWMl430wws++cWY6sPUTp2l96ZvuVrmle2y+8k/yHNluhdP+6sy4xV gr2ccbimRTmIK5VBk9a72YYwLCz09UBA5rUTGDaOHcxqDAHRFs/p7wziFpZiw5EC117m Egfoq1n7Oz4mIZCf4emQOrQ9kixJn/WqsJw1sQY9o2P5KZZhQun6kgIOAfbDTBRDXaOi XOOw== X-Gm-Message-State: AOAM530g31me0/fRIgTJehETeDUow03if5ZRQF8IZnVDA8uVVY1kipUx WHMsduwehXfSyowBEiZ+HJM7ZQ== X-Google-Smtp-Source: ABdhPJxK9xCx5LZ9j6kqVmcdQFpFOEXWg3dh7xD7vlaTOs49rCzrMTPi+wjOrRMAnarb/PfXeMoSJA== X-Received: by 2002:a17:907:d15:: with SMTP id gn21mr32915875ejc.337.1615966120325; Wed, 17 Mar 2021 00:28:40 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id t17sm12001361edr.36.2021.03.17.00.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:28:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DDAB91FF9D; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 14/15] plugins: Fixes typo in qemu-plugin.h Date: Wed, 17 Mar 2021 07:22:15 +0000 Message-Id: <20210317072216.16316-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::62b; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x62b.google.com 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, 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: Yonggang Luo , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Yonggang Luo Getting the comment consistence with the function name Signed-off-by: Yonggang Luo Signed-off-by: Alex Bennée Message-Id: <20201013002806.1447-3-luoyonggang@gmail.com> Message-Id: <20210312172821.31647-15-alex.bennee@linaro.org> diff --git a/include/qemu/qemu-plugin.h b/include/qemu/qemu-plugin.h index 9e67ab1aa2..97cdfd7761 100644 --- a/include/qemu/qemu-plugin.h +++ b/include/qemu/qemu-plugin.h @@ -256,7 +256,7 @@ void qemu_plugin_register_vcpu_tb_trans_cb(qemu_plugin_id_t id, qemu_plugin_vcpu_tb_trans_cb_t cb); /** - * qemu_plugin_register_vcpu_tb_trans_exec_cb() - register execution callback + * qemu_plugin_register_vcpu_tb_exec_cb() - register execution callback * @tb: the opaque qemu_plugin_tb handle for the translation * @cb: callback function * @flags: does the plugin read or write the CPU's registers? @@ -282,7 +282,7 @@ enum qemu_plugin_op { }; /** - * qemu_plugin_register_vcpu_tb_trans_exec_inline() - execution inline op + * qemu_plugin_register_vcpu_tb_exec_inline() - execution inline op * @tb: the opaque qemu_plugin_tb handle for the translation * @op: the type of qemu_plugin_op (e.g. ADD_U64) * @ptr: the target memory location for the op From patchwork Wed Mar 17 07:22:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 1454530 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=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=WD/VWwUA; 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 4F0hkB6kKLz9sWH for ; Wed, 17 Mar 2021 18:34:26 +1100 (AEDT) Received: from localhost ([::1]:33078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQhF-0001Xc-0b for incoming@patchwork.ozlabs.org; Wed, 17 Mar 2021 03:34:25 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:45874) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lMQbk-0004oo-Il for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:28:45 -0400 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]:37163) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lMQbi-0003GM-JT for qemu-devel@nongnu.org; Wed, 17 Mar 2021 03:28:44 -0400 Received: by mail-ej1-x635.google.com with SMTP id bm21so953350ejb.4 for ; Wed, 17 Mar 2021 00:28:42 -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=i4qtpgFxjTfX/0jE0IFITa6xyZMd1ATFYN618t3ivG8=; b=WD/VWwUAmQX+hyoguUOcTMfyok9PoIqcfHzl0GnSOsDoc8ikFTm3vc+2mfN9ISXoYo v64TUeqcYzUU7FIiFNvjVyoDEQTSAgIXsHxBe+vlaPQmcYuMDCuD9OImz7puRRp4nJzw EFmxQnxUDOGbLvTHf/VibcF79bFrC0yddfZ213PQoB2vHc/bLYhNdJ0d2dPVMG7HxXex LfcwwRhrLsfomZeXOrQLMLCE7eKoxzynUaH2Zuqv6FaeL0c0dzzpmHCgQ8PI3DCJ9SYP wahNF2cViC9ycbgX4B/oBfca5CpAl7Fg6Lc6Yk2TpHubndsKSxMpARESbOshNUXAa0K4 yiwA== 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=i4qtpgFxjTfX/0jE0IFITa6xyZMd1ATFYN618t3ivG8=; b=soPDS291lkyoclCWaXCWR1risZtbuxvOHwUED8r6psEV4KyDNvj5pnsOeFMIADrtfk r5/F+QPVq3DbhjjNb+9FpB4XtATJEj7Na0JJyN2BNZrcUzsRyOjnF/FanIcPTecPumkf O7v271MmkhZWbf+NSujWSmbW8cCsthxcz/hdqpzvO49bWPNkhCf7Lj4U5lLhgnxgWb3a Z9d9cJ12EIMquhLq+bUK+bZ0JLHB1fNCNpGjZvBZzuHGKQ2IdJqbL3L15ob1uEYRsgV0 ZcW7IymBFccgr2OA5Yr2Bm6sGtY3gGCYFctUWFtzQoSnGJ1qXkp3U2kUt5tHjEJIo2EF gXXw== X-Gm-Message-State: AOAM530p7wgOrpocfPG3mzyON6QPbCjHjJQPXVEjO3ulJqkayFhT3iZz Z4vL8YDMNEtmM3+0m4CxJT4rKg== X-Google-Smtp-Source: ABdhPJxXG9vGmnR3yjWf/0O+1H7B3LVUax4PSplNZZWTXhhk5OOegZE3oLloyNg35tRgOAVG6VGAaA== X-Received: by 2002:a17:906:cf90:: with SMTP id um16mr34439128ejb.389.1615966121268; Wed, 17 Mar 2021 00:28:41 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id kj3sm10823584ejc.117.2021.03.17.00.28.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Mar 2021 00:28:39 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 000B31FF9E; Wed, 17 Mar 2021 07:22:17 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v2 15/15] hw/core: Only build guest-loader if libfdt is available Date: Wed, 17 Mar 2021 07:22:16 +0000 Message-Id: <20210317072216.16316-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210317072216.16316-1-alex.bennee@linaro.org> References: <20210317072216.16316-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::635; envelope-from=alex.bennee@linaro.org; helo=mail-ej1-x635.google.com 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, 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: =?utf-8?q?Alex_Benn=C3=A9e?= , Christian Borntraeger , Alistair Francis , =?utf-8?q?Philippe_Mathieu-Dau?= =?utf-8?q?d=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Philippe Mathieu-Daudé Add a Kconfig entry for guest-loader so we can optionally deselect it (default is built in), and add a Meson dependency on libfdt. This fixes when building with --disable-fdt: /usr/bin/ld: libcommon.fa.p/hw_core_guest-loader.c.o: in function `loader_insert_platform_data': hw/core/guest-loader.c:56: undefined reference to `qemu_fdt_add_subnode' /usr/bin/ld: hw/core/guest-loader.c:57: undefined reference to `qemu_fdt_setprop' /usr/bin/ld: hw/core/guest-loader.c:61: undefined reference to `qemu_fdt_setprop_string_array' /usr/bin/ld: hw/core/guest-loader.c:68: undefined reference to `qemu_fdt_setprop_string' /usr/bin/ld: hw/core/guest-loader.c:74: undefined reference to `qemu_fdt_setprop_string_array' collect2: error: ld returned 1 exit status Fixes: a33ff6d2c6b ("hw/core: implement a guest-loader to support static hypervisor guests") Reported-by: Christian Borntraeger Signed-off-by: Philippe Mathieu-Daudé Tested-by: Christian Borntraeger Reviewed-by: Alistair Francis Message-Id: <20210315170439.2868903-1-philmd@redhat.com> Signed-off-by: Alex Bennée Reviewed-by: Anthoine Bourgeois Tested-by: Anthoine Bourgeois diff --git a/hw/core/Kconfig b/hw/core/Kconfig index fdf03514d7..9397503656 100644 --- a/hw/core/Kconfig +++ b/hw/core/Kconfig @@ -11,6 +11,11 @@ config GENERIC_LOADER bool default y +config GUEST_LOADER + bool + default y + depends on TCG + config OR_IRQ bool diff --git a/hw/core/meson.build b/hw/core/meson.build index 9cd72edf51..59f1605bb0 100644 --- a/hw/core/meson.build +++ b/hw/core/meson.build @@ -16,6 +16,7 @@ hwcore_files = files( common_ss.add(files('cpu.c')) common_ss.add(when: 'CONFIG_FITLOADER', if_true: files('loader-fit.c')) common_ss.add(when: 'CONFIG_GENERIC_LOADER', if_true: files('generic-loader.c')) +common_ss.add(when: ['CONFIG_GUEST_LOADER', fdt], if_true: files('guest-loader.c')) common_ss.add(when: 'CONFIG_OR_IRQ', if_true: files('or-irq.c')) common_ss.add(when: 'CONFIG_PLATFORM_BUS', if_true: files('platform-bus.c')) common_ss.add(when: 'CONFIG_PTIMER', if_true: files('ptimer.c')) @@ -37,8 +38,6 @@ softmmu_ss.add(files( 'clock-vmstate.c', )) -softmmu_ss.add(when: 'CONFIG_TCG', if_true: files('guest-loader.c')) - specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: files( 'machine-qmp-cmds.c', 'numa.c',