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: 403029 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp229749jai; Wed, 17 Mar 2021 00:23:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzUUyDNkpaUCEsnWL1elQyPSfTwFx80Cu/3SLTg6Ui7j8bK1R0Vn52kkOKfw4z17q34vSnT X-Received: by 2002:a25:f81d:: with SMTP id u29mr2783099ybd.335.1615965780349; Wed, 17 Mar 2021 00:23:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965780; cv=none; d=google.com; s=arc-20160816; b=lVj/xpQZsZn/1vr7Hz3Nz6MWsu3LniBKYrU9Ln+pxkMe9nRPRnkhc/EQUaPN0fPiVB k4dLIPYNVpe2T0AKUZjG4rmYAFsBlR8JIOvp0FurtshpfgTUFTljlK+4rRM7A1Y7XV+y aOLAYv+dy3rpwPNGQMnXZ4gF1S/SOH6rmbJzzKUnGm4nCM8DyAx07nbsNFNFX+HUUaXc 7QeVouvxDBMguEu5E1CKAOKTGJN5tX0pbA1CcqjObSNQOxHvG8eCyLFMiI3xFHXaENkn XLrGWe4VPjTNP6RZtEiJwmDkPR+5eEtko2DpWTvTnNiPr06OhuXXJ+apbMRhMELeH6Z3 tg6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=+prPljAtmIqrEMFGTEBz16szSwQnlu6kpSMTs/hIZA0=; b=IepSMllJpyDj+nbPlhBFFA2o4n5ZR58IXIhmUTeZzs4elfXbHUtZzmJS+2ihOvupA5 ABbnmeDDSuWtGamazMp8KeLEUmxPbSkcNiw27oW/BIIlsk5iY67FDiWcGCkDxi0063w2 WfobDWNZqOpMMCkfZkgwzSVxSVTLPgdEvNlhQlLsvuwDxg1MENekHyhglfaFYk65JYws 7BXaFVYtR/gyGGiV3pUOLMxdr7lZpkiEqcSUNpMNOsed2k8ahAtB2d+fYRLI54faaYpC LNfAPjkovh7f665egWPIVy9hoeFzpUUGxEt4NZGhmHwlvKBdNjxhobq5ZfxcaKWopWxx nHzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UORXKIcU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i3si20667368ybp.89.2021.03.17.00.23.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:23:00 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=UORXKIcU; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQWB-0003Tg-NI for patch@linaro.org; Wed, 17 Mar 2021 03:22:59 -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-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+patch=linaro.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> -- 2.20.1 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: 403030 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp229795jai; Wed, 17 Mar 2021 00:23:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyvmuG5L5UHaN94k4XFSo4kp6k4sVnslIePvx/LraD2cfV29omf3bjUNWdj8V5vhb2GKjkY X-Received: by 2002:a25:cfc5:: with SMTP id f188mr2794027ybg.485.1615965785705; Wed, 17 Mar 2021 00:23:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965785; cv=none; d=google.com; s=arc-20160816; b=xukClWFwxbMTWYuITTwK0i7iAqQicWK3aP2UPafqqhVRF1v/V1VP6DWozptRritlx3 kNzZvJxKusxYFGvrCAiMeBkyDDtGp5TT30hNhfmKYAqojG9x2uETeiuzQnEZkNTBYf88 QqS2WjvBDZUnvOOKhe2dr5AwgBAmKKYV/i7V3fNnVI2Txj3cJhcYfBYWZYNJn76UtxGO RvA2fdi/Du7IxU+alSNJY5o2t0qIJlrgrvegDPrgfa36QZN/lDebSuXJNBxyACE2DyU9 QW7V1GlJFYZe2MldGwTQXjWTIByv3YcG9fH8gcMYY20FxDfV+ICHQArzWtWj7aowiqcN C6ZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=/MsPYBm57DQLiBlktTb2qPsZxAfsZ5w/VN9k4u6Nxq8=; b=hshLyoEYp/vDzkr8n2e5OOg9/0W0/Jp9MKTIp5QKi5u38VVSvtI66vCaNALTLbhs5L tdwPDN/8UYQh+B5O7uYP7jJ2JYIyuNktQdd3Ni/gh2dQ5FUcR+O6B/P31ecpvtB/1huH 7i52w4OQqZ4zka8eaXT8bpDim8CeLOYRodEimOm0aNpBmvnlEEOMbRtL2tuCY3V8AiPp zaVS9nTC7aYwcHm/9Mt21emozNAsAWBH8I5ea7h6V/+JUZ671xi++dsZzjqFNJpao79A 1LHqOZmRS0hXxVuPElhOD1mYwNM+3ykMPrgmZfnC4kY6ERg97Pvdfqqb8lwWkNI0mDs9 +DVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zEIvbP6Y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id n193si21447359yba.369.2021.03.17.00.23.05 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:23:05 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=zEIvbP6Y; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQWH-0003Xo-45 for patch@linaro.org; Wed, 17 Mar 2021 03:23:05 -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-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?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.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> -- 2.20.1 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: 403035 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp231816jai; Wed, 17 Mar 2021 00:27:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxnaPXGNwgSzYuzCd/LrQrwkApwFhwqd1LAcIVdqhCJuCSToiTPaW+2PSUeJeOc2XwkNgJt X-Received: by 2002:a25:d911:: with SMTP id q17mr2872118ybg.468.1615966028384; Wed, 17 Mar 2021 00:27:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966028; cv=none; d=google.com; s=arc-20160816; b=bCWxaNwarATkbzUEWrTJmChhhJ/AbaxU6fbYG9C9b9FDRowUfLQdXLQ53yHIWKolDh m+9joZulk/w6VuMB8tHZMVCXC5sTBms8wt1NozvUST90TLjb4LyvJBvcxmys3/Rm/lCG 0O40VoQ9RwSQ1MWsKYnvM8N2qNd9ECgfIPc+Ct2UNxcDePy/X8ZXliq1j542vZu3jyl1 B4xHRTXUg5lI/TlS+Siq+KIUanhbuwc2OpsmQ+Te6EOAyuFiVKkOWr/5tsNXoKhzPtMA Etc+4z1fq/LghHrm+IPtHdaXBMHffsGvLv3tKtUxCMnmCZKHcyHBbIGoorNhyVqvuoeo I1Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=frvWeWkE0HLi8OnAGFQ6yFN2uwXNepdq5oonZmdE2hY=; b=w447V0w3RQnmlf3zxkMNra7aqI9gft7WqlYel8f/fY45no66Qy7Ile0htmxB2fxpIW Z1xAyCfBpvENeajfGkeHp4Qw2fF57Phs+W578hi3XbJY6fKfE/PO8vOeDeKmfEFWgvgo i0zQSajCl/IHOs9tNG20/G/mIiFc4wRkD3c99kQqe66AviIdY5WH1ghtpNLb4a10+nwz mvRP3y8CH3tKsjcaYyVnURo/zfu91J9HDh6esRQf8ucA2Efb8ZzHu6XGTUT5WHNgQWxq P6Jjq6oe3or5LFDG79YBfnZoFr0fNAJcScRWw6e9pYIJpF0E2SsgcEuzwv9I+i5F+aZa T39w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="T/VeUJEt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i83si21038853ybb.244.2021.03.17.00.27.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:27:08 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="T/VeUJEt"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:41438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQaB-0001p5-Q1 for patch@linaro.org; Wed, 17 Mar 2021 03:27:07 -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-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?= =?utf-8?b?w6ll?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.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> -- 2.20.1 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: 403027 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp229566jai; Wed, 17 Mar 2021 00:22:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyVe7rj6hGZxM5kbHufxF71kd5UTXjrnLfbdZKuGNk69/XQbQFZEKJhIuLzUHkpLeE219DE X-Received: by 2002:a05:6902:4b2:: with SMTP id r18mr2935586ybs.226.1615965762170; Wed, 17 Mar 2021 00:22:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965762; cv=none; d=google.com; s=arc-20160816; b=smm4M5YgaK9If1/QMKTDuQuXKIxpa2NjU1ba8cUSRsVdnM6NUhptxQfQ2FmCTvFSIf Rafj1FPT2sjcAy+MRhph1phH8EMdPH5v1fHjUwZK25JsK0CckZkvpnh0+SsB+ZeaMY5U vUktcF0YJLrkVADalxBSog3XZ+hWmIG973lTuCY2d37427PjQbKgKgSrtz2MTqWo5Kvy KuoHDtG3U7LPNWIsyreYbsI3W9teXFgp+XbWeAXFaLe3G7J0uLexd2QaWh3wVOb6isvq SLeheCc3mlDuD7YFpvVvV/u/bPtoPouj6wqvx9jtzcHr0gI8UbJM9uCV+gwxUggf8hpT 2b7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=Z/GsiICGeaT2/Why33IGYP3Vu7Bpn+W4JV5DMBIlNpM=; b=vguUSKAwcXkbVO/hA6RuIAa3ED5ZNxj0Y7ZF5vI/dJE+itmkv8Q8ICR6HspmXes4WF mDKKE2T5ssk3SGCKv/cTeVUZ0b1ekuf4CvB8aUbr4AC6QPdxKrUOI2pu6RS36HXwHFZ3 K1Ct7cLV9yKEMJQ5N8tPmvYbIIiiUhZXQQ5EcCONHm0ADq5CvtavHXQt8dL3iWCLv8Bx r2lI2XCNMg7UP6htCAywYf5Ab1K4jyvK5rTJzKFNz8iXwa/3SlYOU+QKR7thHnxFDI8U tPTXUxHnOZ6XAnahv6WZaNzQOwKi1kDkIP7AI5jfWp7CuUqG4ah6g+oSC9JTgM2THhQe ny6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A4CeZuku; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v17si17356ybp.113.2021.03.17.00.22.42 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:22:42 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=A4CeZuku; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53216 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQVt-0003Yt-KP for patch@linaro.org; Wed, 17 Mar 2021 03:22:41 -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-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+patch=linaro.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> -- 2.20.1 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: 403028 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp229592jai; Wed, 17 Mar 2021 00:22:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzOi3hEJRSGN56f/uIpYbLZYVQbGQm9qfBlKsti41CowtlhlDkv7NRL6nHLx8FEV9cqssBb X-Received: by 2002:a25:9108:: with SMTP id v8mr3005775ybl.321.1615965764971; Wed, 17 Mar 2021 00:22:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965764; cv=none; d=google.com; s=arc-20160816; b=zS/1Znc8l4BajsY3NquwvKB2IlFKegjzsHiwKJqa5ki5Ua1yzkSVlg2F70YKKRteti 8OyiZmLdeiJwj+v3SUV/Ya2YqJx4cx0RS6BL8XXt+LPI18YrtxH3tT/pIRYs+95asc5D X+uGy1pS+spB7Nyte2+ylGMDh4SD+FJLP9ElfJdLVid68+XuBIsN37AvaKcultH/NN34 924F+SrjxFPms5rqB8FWNtmp9PH0ZpC7jv2+IPEqcdfUpnGYFzFhOvYX524Wa2eKi9Fq TJrjWHrv4J5Xs65YCq47n75m5FUOlbQPoBeBLe2CZu2atHN5JR2iuyukidusbW7907XN L7zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rOvOpng9pl80hnu05BmVHMESelx8rLsVtqsYPb3j22s=; b=YbDHG3VOaefZInPi5dsC6dnQwM9TvNg3MH2UupU80UeRhSVQX8KmIngJzWyUqOyZ5w 1AhQqzCO5D9NlqOuspfpFnwCmApi4tQ9g9qH2ovsQOGSyj6m7mpHP2CjPbswqEsrK1fT tkKCEP3pP3XJr3F5b8eFsCaXN4TvbXBHswjZ//Gf0WInrrbzW+xjkh13oo8HmyjozJor K3GhBM5Pvk/lyqjH9m0fAMBIVL9R8h9WjDspz55+ZDkdVvwud/k66hDUXsh2sOov2PvX eQAOZ6le29Ysk6M8GWIs9ChO0Yne7Gj0BKp7l67RajQNNJErPJsVY0zPqMpe1BAodXvC kOEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FQqUNzxO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id o10si20624161ybj.1.2021.03.17.00.22.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:22:44 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=FQqUNzxO; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:53422 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQVw-0003e8-D1 for patch@linaro.org; Wed, 17 Mar 2021 03:22:44 -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-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+patch=linaro.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> -- 2.20.1 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: 403039 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp233463jai; Wed, 17 Mar 2021 00:30:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzFkKuaaUpDReJ/hrug9gU1jLRjQUFetnsudecneA2NGXYTOdZYq5vRCy10bFVKHq9J5hGc X-Received: by 2002:a25:8401:: with SMTP id u1mr2426629ybk.479.1615966219944; Wed, 17 Mar 2021 00:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966219; cv=none; d=google.com; s=arc-20160816; b=dSmC72JCto/CO32my+gYSpbEb3St+Iquf0cdistea+/CYQjvxj8PKOjoWN7dKpKIXP cpd1FMYQMgJBE/o5xFupRhmV0DawqO5JOPvD+3Lj7/fn6SiV6vML98q/H8X7jepjnaCY uR9unAF8TWpd86YVgazHdOLU3ZT+sSQGgPd6G89KEnGk7+AEY6wqxZOf3KKf1eS98sgH KUZ5+iDV6smQ8G1Oco9ffQuBtuxOP6A0a0AhC+KvdVA6eCZR60atKXK4jkh3KPfGCBKZ 1b/xd6E3ByLkgaOQlkotBw7RQM9oB4A07Q6HkO1xz9o0iemJ/N46SCvDObyyX9AXAJ7h gf3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=8reQeX3pGa2B4FJO8BMXlygofe+ASszosdyj7RtuxBU=; b=N6DJERrU0mZU2l0l9clBpAUY7LeF1NIt0j9oMZ7ydGP/v81lTNFDZk9DrvyQWYp5ul D0HNCxi3s19g+jwlrBJGG6yVDgRBV48grlNe+uzZoiArVtr1Zls3B2xQBtceI5RHydOa +TZeVHX1Iq0KYd04RCI1eoN5EulK2cscunhV/wm8a+KlxnKfZq092zrqrEPKJFswk+sF gyoJhZVV8qUl7Kn3opLaz6wuXxrDwd2KWzO089W/JADQr+fZ8B/bTMiMpbAUz8MRnq82 1t+sVGDrueTXfTPgtLobyIRlckXKi+NEtB3MgrLXk9tYg/7TTJS+WXI65Z2CjmuMU4dR cbtQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lu7JtU8b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r9si22807480ybc.324.2021.03.17.00.30.19 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:30:19 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lu7JtU8b; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51352 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQdH-0005o3-Dz for patch@linaro.org; Wed, 17 Mar 2021 03:30:19 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-7-alex.bennee@linaro.org> -- 2.20.1 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: 403032 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp230906jai; Wed, 17 Mar 2021 00:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYQ0fWOXD3VUm/yoHgnLifOKRNJZYcgTsWXHywIcQK4aYXA6vWMKMkXevPCBbDOcUz5An7 X-Received: by 2002:a25:a561:: with SMTP id h88mr2881006ybi.235.1615965917278; Wed, 17 Mar 2021 00:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965917; cv=none; d=google.com; s=arc-20160816; b=G31GyMkNUOWo5mfarnk5vW3QGro6Oddt0pkyvNdIsQXcXv2jDR+jNZQTqZ7PboJtVG KJqydp0YOf9cJtYqLVCS+YfC1BsiPgNJ83OlG+mdJ7UsTLCwStAnllQLiqgVFJ3cfHOY aHZFq9wsiT3NzMf+fTtAhAq8F1g46nw0QxppmatJ4RvflJI1PJN47YVnnFeVWTKLn7tu Z0BSwaTgrimEv+qUFcrfTeSya8t2/NshZMMAmIce0nk8HI3J12y1aXHMQgP3gfF/iJHm uP8nj12DVJXWzTWbxAAc+W+BdGEEYW669sAvu7eaPYy/U4aerghETfmFrhdeOvDm6Hb5 MfRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=WwdIc1nYUBWZsiYa6eZD17PeQKNBn/C2DU9VKz8Ljaw=; b=Bc2kTGdXplv4acMb6+RTmcwoInKjVsiBxyRmMOOZjvF90tW+Lu1bmZ1o6zuHd5j/qr xkm2IL9CdgsAFaZcqWwZ3BXM/jh5GqujCDJwCNSmY0Q6g5SBxyXZuUy8Y69Y/n/20SrP /xjbMgCDkmHCz7o1rGy7B8xB4+TsqTsXBnqexpf1FpCriMvxW8r5S1fFoQ1VLkiAef1e ZwncHCazDNdyhWz9m0SR4qTXUVjg24oBtauW1DsNGnGeSXwYObaNGmK8if5riIADQGtH dl3xV+21GWlifpLkILpYuguliKIFHcGFmR58G2gfHWA3Qut5noawwl21Ont2pwWL/yvE k1ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N18RdG97; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id v199si22505274ybe.259.2021.03.17.00.25.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=N18RdG97; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33434 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQYO-0006y3-NO for patch@linaro.org; Wed, 17 Mar 2021 03:25:16 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-8-alex.bennee@linaro.org> -- 2.20.1 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: 403037 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp232562jai; Wed, 17 Mar 2021 00:28:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyq7o37l3rCL3EnhyPODuQp5OX1BTFTviGnX6x4qjE15hPt1FraLwGE2JDv+DUkOqnKsZIJ X-Received: by 2002:a05:6902:701:: with SMTP id k1mr2916671ybt.342.1615966106919; Wed, 17 Mar 2021 00:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966106; cv=none; d=google.com; s=arc-20160816; b=p2tP3nxQh1+ec1g5X1ybbCFB1S7HSHWORqR+pKOwG509lFqv6OljXfWwlVNN8kRx+o Tj1U9cOYTfJa26YOWBI1EiUUOtqiHIa8ze9/jj8oG0v3vDk342cP1aKb9Fbx5OOi03nX t1gpFN1UCzRLNTN27RI5hni2V12/buecQxzmRjiU2Vj3cLrLcZgdqQFhZg59gPBVK5Op NAMCA6s6uu+K95YCW4dpewQBst4u0INtVTAV2JSKbojrbPdZLN+a4Zp+umz61Dj6yR02 fn8guwdhwgXNwkGGeqGe7ch6BkYRF+ZjY2liC0XL8tBqIgo3xoaCgcP2cCORpXtTHoSh +TCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=RWi98yBYxFr5e8I4Wn7WdxDUPeaj7H5bHss1HaZsEQE=; b=Jz9awUmjtAFomuUcVvHtaynYypa1qK3n087qfJn8BKh2+u7YZfHpkmWsaTtA1SsVVS oGTmHYIwunSbFOxi+dix+x54lsk0sQ93tlfANgtsuH2trVLB1xXwu6DrZ6KZenEI7kmF LrFroIbMhrGS4T9PQ58JKB13+baPiznPQ8HTOSPk8a8U5sWAqJ/XBitSNkzEljgpHRZx w4Nwikn+Kw2l2LjA+2n+KC4QNDghpQ4RXG6zP/4iGN1H82nLLbGWX6hvUDwMoTE+xuoj kuJX9oMHfl5eBI2wnWm36XMLMTwezjWcM26kjUnWLu/ndsykqmBjPe92aHRjozvVdGBC JAfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OnzRCfFh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id a10si1375423ybc.248.2021.03.17.00.28.26 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=OnzRCfFh; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46338 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQbS-0003lG-Ao for patch@linaro.org; Wed, 17 Mar 2021 03:28:26 -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-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+patch=linaro.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> -- 2.20.1 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: 403033 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp230912jai; Wed, 17 Mar 2021 00:25:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzv7h9t9JpjHg7vB3DNF8B7wkPXa4CyVLv33Ubgikn+OXqLoaJceN5YSEpUo18IDyVwkKYi X-Received: by 2002:a5b:4c1:: with SMTP id u1mr2814619ybp.486.1615965917667; Wed, 17 Mar 2021 00:25:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965917; cv=none; d=google.com; s=arc-20160816; b=tTgZn9R42i85ujxvh8AOX8O38cSZk+ZRAxgEvK9RdgO1j8ycZ1cSIqTLK7vgktStit 2icChnh97cyX3hZ8RSaOTaJT55B5hBH7CUgbmou293JJSb2X4osNG7yf36ZUHCXP1wIF OqIAkR0Jv6X//ahzekXAhe0e+cy/s1RidN2eRV+/B9taI6o0K0wb+BJ8jAsuIZw5uono jtlJ7bDkDa5a5o9t/DU2eYq/Tgl+g+73ZpYzF5B1tBJTj6csmTtu/qG6fGzA1uVSJxYL Z7o3rieuPLNzuHCnD4IwccX8URI2gFeu21rYwepAZ4AHq2WJR03G3Uvp0lW5FEHZK7c+ fEJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=oZoHAKKtaXp3YWXMdf36XUZYzFbYS4h/e3YtWNeuchc=; b=alegVD1AmNnrFM94ZbCBXk82xkgcT4BZeTFzEr+C2SZSRE+6W35754O/qLgR/zLssj RA6XR3LU3vg0Q058LZpuesaJdGeNDUCytJgB7MXYg3xXucCi6gvvpHLPGtllMvoc2cGI B1xoXUoI3m5eCRE6cd9FD9x4PSuVVsR09t+91I6LRjBbH4aNw46qiSVSVKtmNaU9Vogu 1bopOM45IkVrFIzo6UXuAzzaqgu7hnB20oV17nrJhgUlb1KF6iaCdbqwGyjWuYJNS8nW 4h02RH4RTLWA0kf8XcyqpLuxDCXrQIRmHbMsmUOBrI2f4aq2etnGwqUG5MHuXKAxvaSG XCvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gy62vv54; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f11si20242331ybp.38.2021.03.17.00.25.17 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:25:17 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gy62vv54; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33494 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQYP-0006zU-2D for patch@linaro.org; Wed, 17 Mar 2021 03:25:17 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-10-alex.bennee@linaro.org> -- 2.20.1 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: 403038 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp232606jai; Wed, 17 Mar 2021 00:28:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhuqjstWR6fT4howEZ2L4dTXBa1373qjPrR7HH2hRzBR+f8TyLUiKBsLUwIa+zsX8ECwog X-Received: by 2002:a25:e810:: with SMTP id k16mr2648074ybd.126.1615966111301; Wed, 17 Mar 2021 00:28:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966111; cv=none; d=google.com; s=arc-20160816; b=p+SzTx41x9punIJ0duUV/mZnue7KVXjOrk9UT9nSkOzmCP4b+iuq1oMpxfM9RhhM4u p5iW5NQ+I4TM2p/IOQpdAntwvHt8EO9DRb0wMOQrRE6zvnUPmNBgiQlvTrrIAPTPPZd4 jil0HvjGYLbvV1PwBOgzosaJ5Iw2kaTsXHVq+pT2mAlfQ5rT+has1uEy/dye76xMwGnE vVhjLAcYyJ76GlM2fk50Noknt80MVXT63zoeKBnF6Y97+FBCiBnhyddqBms+QUYTnmpf yBajLQ3fPuJIlVmGs4rwXzuxdW0t/FkkR1Brd3U1oioVjTYbhLiki/4h/keZl+82Lk6N AIAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=rQc1qB+dj1Aep27H7tyCH6v/LAf+f1B6hR9k7rulrqQ=; b=ahWF93QBgIqrex6W9KZ4JioN4cc+FnomYoJQ8JKrR07PUvS0GC+pnrWMiouc7LA1y3 BiMZZrpj1gj+i2FCFYAbFrFAmaZeDYc9s6r91cPaHDgqQLh2KgRPzCEJ0O24Ci1+ySrD LEGRJ95hbf4S5vgWeQmFyl8z2+NdUIse7UMY6UG8+czpZHc1yZnSuALeqN91Uly5vlJ3 VKj/hwPe8r73G1o6fAQl9mlGI/FwSW4MT8GnQqsKRFADr13gruqP2Kmc9mhLMgqOkpz4 froRabHw/t4v17KADV0uRPpUC+45jAiMHeYjRAl2lId8q/T/kt55hAmICUCqq+yUGvpv kMBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B8zu3exm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id j4si18131981ybc.203.2021.03.17.00.28.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:28:31 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=B8zu3exm; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:46626 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQbW-0003s7-Oz for patch@linaro.org; Wed, 17 Mar 2021 03:28:30 -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-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+patch=linaro.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> -- 2.20.1 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: 403040 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp233931jai; Wed, 17 Mar 2021 00:31:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzdc4YBokT+Vsxwdd3LyCG0NB1HvSXyNyEpcOmOVFEfBz1vTQLbf84geo7ILZNVWfHjJNyQ X-Received: by 2002:a25:a286:: with SMTP id c6mr2901922ybi.146.1615966270104; Wed, 17 Mar 2021 00:31:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966270; cv=none; d=google.com; s=arc-20160816; b=SNFCrwOq/x0jG0IuazoGxoOMtwlwfhFRdLPSiq+gZXicWft1Lbv3qcQ1srFe8nQ5c+ nWW5FMT2aWj5Jvoftewb+BNJq2xi/MAGYKKbWcPesohIZk1qtkxKaq596Hi/gzxFoEwx 8aPjpG1ZiwXCU73v7hTZagJ2HcpPkN/fTZ+9YzOWMLoJONcNXPghsC5Iuf5bnP7IFcYF I9t2v/kKs4Br9lV1868qbXlQjLiJ9boeTDFonhZeESoWP+J3pIZGVxGQCZMfly7buz5D sODby1MqL/mvkmqoPPe9m1kvd5go6HBB3u0d8iTFKxHqUZa8lzZGR+pIBpXtrXl5wge8 yxmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=V1k83nSOBQHKX3KyY5kO2YVliDyi+4QoKl7OCC4rWPk=; b=OO30MmipFOKMBIrfUqNSPw/rfeNUirFC5ZA022G85khSnD/p2aQ8g2yppCTaLRyqdC Bc3n0vdAoXvH83xGpQGZm3Hjaq//Nsh4eBSCb73mJMzGonTGOfrLTQ6lNqhydOsVsTGj mOm1EzoLvSyR1fRJdcUPuCZ0fCLsTX0we6KG9djsAFBmHA8PiybCHpwo01tNAHXwnYWz fAQwuxvGloZ05ubyxxH929w3AI3OQC7lxKTrG78p22mHpPwGMr4MWYobcKfX7rDDUXPe fSMv05hZTzI5NUGpmpEUVvqOgSfBAlGngir6lRyBRfj0NGSX/fNIqa6dHTL0lN+esJb5 gp/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YIg0u2dF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id s12si19336434ybg.149.2021.03.17.00.31.10 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:31:10 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=YIg0u2dF; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:51706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQe5-0005wQ-IK for patch@linaro.org; Wed, 17 Mar 2021 03:31:09 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-12-alex.bennee@linaro.org> -- 2.20.1 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: 403036 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp231856jai; Wed, 17 Mar 2021 00:27:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzzmXo2AhlompjcNVCh3uD1wDixCktG1Py4WQTMNVaDbmx6KST7NOKxmo/osvPl5KeVh7Ni X-Received: by 2002:a25:68ca:: with SMTP id d193mr2799544ybc.187.1615966032731; Wed, 17 Mar 2021 00:27:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966032; cv=none; d=google.com; s=arc-20160816; b=GQEWFuO0F8H7x9lQxTvLTzQhlFjI78Id7iC7lJ+za2hIS7xQP1FDYyrz3QWgnPf/Fo YvArCCpiGWblcKDvtgBc9iOLBjP14+0NOeMcf34WtsfmgG43dEObm2bNFvR56WC/xLTS PpaDEpnP/OdNgsUxES6RqfX9+4JicSvVwoAmudTTE4YBSzX2vz/y7kZABcmHGdEPC5yr U23ryJMCKiXAA9eMzWqtd3fbvWJa1nNg4Pq7VQGcbTPqZT4aku1M0jkeMSaVCV44cJa8 D8LaG528YWDFIHHA9UiUpvEjrCFqOLGYgJxy9uk+YK76jEDC9ES3UIf3jht4kzJ+1C4a Wb0w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=R7lizkJGrEEFe1N4Cl40O7ejnX+xPKrdbbOuYdIm6D8=; b=mg/AzbVG0tP13Zr8Ev49Gh7yV6ng5WJ6Y7GRavvtrdmpGZQ/iXcwmj1/dIvx3MCSei w4+Nu52ZZXqkQJJ1eov9nEpclTSlENaM7pof2IIotMK4EgOKVlGTN8yF6ZW55pFmjpiq VEoswq8o/Souzy/P9DyTpsCW7AXnLE2eGEybD4dm0saXM1c+nnHnCqpMQbqnTUftGiTJ o0uoKWKj5s9rZdkMqZxEzJEsMwkfQrX1U0dIeUTpWcDQyojqcj3kzPOUNFGtiDR1amX7 DByL6KDn2wEItGbdpXvFaz2tEYBWjHWYqr0lOBWQA54/k/ph18vCY9apvrd0PcTh7Vl1 O60A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lDnaYUdH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id q5si1671129ybo.482.2021.03.17.00.27.12 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:27:12 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=lDnaYUdH; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:42032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQaG-00023H-5K for patch@linaro.org; Wed, 17 Mar 2021 03:27:12 -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-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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Message-Id: <20210312172821.31647-13-alex.bennee@linaro.org> -- 2.20.1 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: 403034 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp230917jai; Wed, 17 Mar 2021 00:25:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwUqUBBlyWEhu3cchflgTwCqm3SVhXmxg1y81L+ANQQATe8TOcCqlGoIrFrKCppI5hRHcX4 X-Received: by 2002:a25:da54:: with SMTP id n81mr3127713ybf.381.1615965918214; Wed, 17 Mar 2021 00:25:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615965918; cv=none; d=google.com; s=arc-20160816; b=XqKjDofLH2wFYb9Hg6VNiKyhTJ4HkGx+4cBhI0Vt2rikcEP0Wai9IDaihz5V1XljdI 8BViW0RFXHbw1SPU9N/XWsvwIjXKeAsbrH/CvT6IkK/6p2tPucEiNMcciuw4LFUKWlgX Zck/pisW1iVjQrPH8fM6mESDpDzrOEfpNExvUcgjh7RPgU32AeCU6m4AdBq9CNaNAIbF ul0l0RegqrAWfW6zIo7kTG+YkUzZjNofI6YOApsChExr/v3swOamnBi70G04kgoBPZDL hBq3ahMfRLCHzEe5dKS+6zRZTlBiVsDU++W+RMONQO2/vhs33HAPMXpNq03u298daEZW bzEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=ni0Dyqm715Q2j3M0if5MLO5cU8ZgOph+rmN9Yhbc+iM=; b=cHDPn0i+v1BE4xrY13ECSNBt2rUW2mHr8sbxanc4SmbMBzb+PCpID2301JsJeFt2gj Xu+orXoNaHF95wAM9Y27dwyWogD0KoXX8hOa4eVXZihvKAi24NfNsxPyVpXAunsvbaP+ dgNT0LQzy+snGF5zenNiJDmCB9WxSuIL1d/fSnY8UYunhHEoOnWy0rVIgQFuke4JL2JG SBRq+xPmcsSxVr6MQ1A2uBc2Qyf6WvUugz7ZRFjmiJrdYiSsHEH35tDOcFNb8GFbA0Id Clt22EubehGrV79VAiiwOVOiDC7Z6lLXwet+ygHZKKaUHLGN69dnXY0LJjxUng5TjZET aJdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pwaG5Vb0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id k142si19399022ybf.236.2021.03.17.00.25.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=pwaG5Vb0; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33726 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQYP-000754-Lw for patch@linaro.org; Wed, 17 Mar 2021 03:25:17 -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-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+patch=linaro.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> -- 2.20.1 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: 403041 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp234831jai; Wed, 17 Mar 2021 00:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyemiN+y3bjo+bO4ZhH3OIkxbXWa3EN7rWfhVaIabykI0is02k/OIESpAg8aScfT7RqWO4p X-Received: by 2002:a25:557:: with SMTP id 84mr2886768ybf.291.1615966360833; Wed, 17 Mar 2021 00:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966360; cv=none; d=google.com; s=arc-20160816; b=KpZYdSjlY6ymlm8YEGI8cPwAIXVxfY6We51XkrCa8/Lr8UX41ep1DiK5sfKSgCW266 Jb+pMNV97d1Ygchzrvb1MYwJFGESzuw60QRUPGPr6ntHxkidIxrLZ3xfWBlwYICY+YMe rN+5yh1fMlQ6sX2QhmWlV7HAOIRKwfYQ4m7+jdU1hz/a2Y/YOtr3cq4JzLDUbB3/iJKl bfYJsTAv7tE6Ns+DwMzwAlu86MwKeEuXgh5+bRr4PBCS9oKY32hbyL4rmm0gkPwvRzID mW65+tkbGuXjALridYHo0gSSYBcOTf9Qjm/llfwSXbqvPYB10dvcyfnREtpgeAKZm/qH m0aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=SLpgbU4y8oq4TnAY1QjnMUkHwHhGEj8HGSa5T/LlBKc=; b=FvLJXEAfTTFPp1STd5h9NAdLMhaMk9RgaicUXA3u48tiYthANECctf9v2cbeaD+Odh UOzdKlQuJqcqcGlIazLA61UbdiZ/Wpp7CNJLCp1TEjoagm0qtiqNwHB7dfXoO4z2RPZz uCD7QMGBbJY0ijOUaiw2yL0pBcBxYlgKRYQ2c0poDyJys7vc6vwv5XavQrwMPKJuqSq2 M4m2VbKy8J5DG3hbKqgvE+R/UQzMyOyYy29KP0s7dI87JhD5TeoPCHWFACOyXjKc9tX8 kSnTcS+t0ozPyw10ya2ayrBuFfN7N7kJcZ7ilLjd2EsvebCXaSC/Ej4NuF6ghOJZmKle z+uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tpMK56Em; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id i81si20300752ybg.83.2021.03.17.00.32.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:32:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=tpMK56Em; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57038 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQfY-0008DO-Ar for patch@linaro.org; Wed, 17 Mar 2021 03:32:40 -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-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+patch=linaro.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> -- 2.20.1 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: 403042 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp235971jai; Wed, 17 Mar 2021 00:34:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJykHviVMpXrDfzXebo1wt+SNaqG+lJOfJA9epdtFZW/IGmSYkSUDE2+ljjjRXd7UrglofL6 X-Received: by 2002:a25:660a:: with SMTP id a10mr2171876ybc.102.1615966472936; Wed, 17 Mar 2021 00:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615966472; cv=none; d=google.com; s=arc-20160816; b=zzGNMe8pFQZ9KJMEFHwvrN6qRN0UhHU2LqJho+2NlacK0/iZVbOUbPOGCrJdPEs/dI w/AlpDwsLIQcw0f3XJ9cjk1E/vvU4QPsk8sVHf8mdhR0p8IUDKaaxPIxZEwzSMpAgPv4 N8J2G34OsPvwY3mACLWG5TdJl2GGIZ7LwoiDtxdkhG0+kIcsbmb/nr8wZF6vJr2XHGVu 37IXifj67zKx5+4i3j+i4LmsoNSTkk6i/Q6FN2Hzz0eJbvgEJoaP5RySZV8ULtdLnmPP Nj1ziV7Luh8Awbj8CCpsn/lxuwKanaUYoH0SyKZjuJ1YUBAwJiB0M89tSj7K6C85EGJ+ 5aMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=i4qtpgFxjTfX/0jE0IFITa6xyZMd1ATFYN618t3ivG8=; b=fcmu/HNHahcYDK8Rpz8qxKpfUU8psuh7GfUs+Z1EuAWvFzeFbMnvTk2JcQEovrtlwe wRJCuzNolcZ5xjoKYNJyv11wQh7HUyccuQv0UYNLbwjl9cCMEoJGYA3c7Q+j3e4QaQ47 ildi2vNsdc3H5JzgMxdPOnEqBl5hRtFM5/DquLBj+Rn+SUc1rUoZdhlcyZK56+idpCfF tp24zEAz5hCpMQPCqWg6JJBNjQIKzjWAXPHcE1vnKr2grfJ6OEG3CSFvP226BvZUxchy Y6+dI7QYsNnGmhtAFY60UnBiSElQRLeClDIQoQZYRv96DaDKuNWz8sxcXMgSFjyHKN7L grDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WD/VWwUA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id p129si19356520ybg.371.2021.03.17.00.34.32 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Mar 2021 00:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="WD/VWwUA"; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:33078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lMQhM-0001Xc-Cs for patch@linaro.org; Wed, 17 Mar 2021 03:34:32 -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-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-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.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 -- 2.20.1 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',