From patchwork Mon Jul 12 12:26:48 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: 473105 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp2907165jao; Mon, 12 Jul 2021 05:48:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyfnFHuUg3SMazlGhanMVYAvNQ+Kbf+Q79PuLxOy510jLpCRY1mEXcrYDUhlKZ4Loz++0Qf X-Received: by 2002:a17:907:3f9c:: with SMTP id hr28mr38973156ejc.436.1626094084263; Mon, 12 Jul 2021 05:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626094084; cv=none; d=google.com; s=arc-20160816; b=S40se26jz4OvQNfYDMsd5oH0jj3tIRODzWCGCgmJ0pnV0vZVP/huioT6Mfc5jBAq1p OIOqiKj5eumsxlRN0FYtWiiyI7/nw8Sn1CzCdaTDSDuzhMYBZJwx/8PVxvmWffcui+gl 7lfVUBp4gXQZtNhnHyh2oazkDMkHoWRivBGo4toVg2XNmd0q9JAj44Zvn4Z6odNUdZ4b qXKakgq9cU1rr2fD8L0NN/YWOwZPK0UGSsB8T+NCJldnWTTVt+skAYKlPfCnL8O5gZQp S4InZBblLxZ3eLH665sig8D61wKn6Z2ivg/VpO/396lJ+yVUQGf3eljEti1QZGQRvzoV qUbA== 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=m+wx049KJ28JpFC9cH0HgqwfF96vUTHrRWKaIFgqKEY=; b=wQHFgtkhTSiKu40Hbj/U9bDWFLjQPr8pQHMzAQuJfcnGYQ7JMq59y2hiJHfqcTIgfn ALfrgzta72BRH+SWcGu94lGbW8O3j+jjFeICrUpuZgP7J1Kp/hSy2B8wEzgp8WNNpVqL xrY4FwziDbYlItUYuZP0zn1c5V6OzL9ch7wgB90kwk1Q1YKp3Pzoa6nhRGC9abgdB+zj 9yDH0TmWGfWx8JaiO3OuygseAPkw4paBfNOMvlrKjNfintCcAJcNYAhKXHs9Lq/oI0Bj CJACtI95Y/nIdcaIXK66Y8v3woLVjWEnw/x1ekqfKar6oZROPS9UpFzvcOK4hDIMIxSU eyKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=VmnFS1ZC; 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 ji4si15160916ejc.469.2021.07.12.05.48.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Jul 2021 05:48:04 -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=VmnFS1ZC; 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]:44128 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m2vLv-0006tM-96 for patch@linaro.org; Mon, 12 Jul 2021 08:48:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:40012) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m2v23-0004VJ-Jt for qemu-devel@nongnu.org; Mon, 12 Jul 2021 08:27:31 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:37523) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m2v1z-00004v-0k for qemu-devel@nongnu.org; Mon, 12 Jul 2021 08:27:28 -0400 Received: by mail-wm1-x335.google.com with SMTP id y21-20020a7bc1950000b02902161fccabf1so11117349wmi.2 for ; Mon, 12 Jul 2021 05:27:26 -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=m+wx049KJ28JpFC9cH0HgqwfF96vUTHrRWKaIFgqKEY=; b=VmnFS1ZC/+VboiYWrk1c9gULOLJyoXr6mcIcFOeUUwJW/07Rqs/SJjnNTvt7d8Gp01 s26+lw0CYKvVnN4o809oglxvVOcTm03p1vBr8kbRGaB7Q7sV91N1thnE4U0JhdMIKVcL Zn19ncq9azK3zDnnLlbFGGyylUmmDfUGxX/FlFsLpvGePX/8MBcJ0Ub8RGozCUWJJZV+ 94TjH8NrmMco78lPDwSncPo+7VJXKHjUBO3lrKch0akhYK/D+X974bt1quVC03UICUTe 10CC4yKTo8NgW3eH1pUS5z/JndvyuyPo5LvT11pTMNP+sNMURuVxNpzwn1D0Sam8vw7J VQYQ== 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=m+wx049KJ28JpFC9cH0HgqwfF96vUTHrRWKaIFgqKEY=; b=t6LKEHcGa3MheLqTOuOrBBBi03LEjcfNcsvtojF1Bf4VWeCgJB+vuOz8skWb50PN1U 8rWJhYBDXZASJyFdX9o3itkXuMeqhxstRhSPOegOoSsG8QRuFl4DuGtgaSoiX+9Fsuub Q8zT5oWSVL3OnmhU+9cEV8oZW+5m4D/jvPNSKcZr1AwPL1IzZSE8hCOU9j9/Lr5i85ko CueqwMm3E2mmn2pkOpctXVXscQmocVcNTXJvwhNPB3vxkKFZEQbGS6Jmv5riK6o+QpH6 JCeEkDjuQmXRLf0bQ02gq847wJvWqNjNbftArT0aDE5inHdwMozka4J6yeJyVjx/BoRo mnYw== X-Gm-Message-State: AOAM530PrphFisigPOz4S8D+iuZ4j98gJtVAQllIO1lIxoHQFvCatxe9 xLAY1aXvJuGlYqw/dSL8uk7mSA== X-Received: by 2002:a1c:9d16:: with SMTP id g22mr31475840wme.152.1626092845196; Mon, 12 Jul 2021 05:27:25 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id f7sm7393877wru.11.2021.07.12.05.27.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Jul 2021 05:27:12 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 817331FFBD; Mon, 12 Jul 2021 13:26:57 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL 35/40] docs/devel: tcg-plugins: add execlog plugin description Date: Mon, 12 Jul 2021 13:26:48 +0100 Message-Id: <20210712122653.11354-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210712122653.11354-1-alex.bennee@linaro.org> References: <20210712122653.11354-1-alex.bennee@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::335; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x335.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: Alexandre Iooss , Mahmoud Mandour , =?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: Alexandre Iooss This adds description of the execlog TCG plugin with an example. Signed-off-by: Alexandre Iooss Signed-off-by: Alex Bennée Message-Id: <20210702081307.1653644-3-erdnaxe@crans.org> Message-Id: <20210709143005.1554-36-alex.bennee@linaro.org> -- 2.20.1 diff --git a/docs/devel/tcg-plugins.rst b/docs/devel/tcg-plugins.rst index 0cd77c77d2..179867e9c1 100644 --- a/docs/devel/tcg-plugins.rst +++ b/docs/devel/tcg-plugins.rst @@ -320,3 +320,27 @@ the user to see what hardware is accessed how often. It has a number of options: off:0000001c, 1, 2 off:00000020, 1, 2 ... + +- contrib/plugins/execlog.c + +The execlog tool traces executed instructions with memory access. It can be used +for debugging and security analysis purposes. +Please be aware that this will generate a lot of output. + +The plugin takes no argument:: + + qemu-system-arm $(QEMU_ARGS) \ + -plugin ./contrib/plugins/libexeclog.so -d plugin + +which will output an execution trace following this structure:: + + # vCPU, vAddr, opcode, disassembly[, load/store, memory addr, device]... + 0, 0xa12, 0xf8012400, "movs r4, #0" + 0, 0xa14, 0xf87f42b4, "cmp r4, r6" + 0, 0xa16, 0xd206, "bhs #0xa26" + 0, 0xa18, 0xfff94803, "ldr r0, [pc, #0xc]", load, 0x00010a28, RAM + 0, 0xa1a, 0xf989f000, "bl #0xd30" + 0, 0xd30, 0xfff9b510, "push {r4, lr}", store, 0x20003ee0, RAM, store, 0x20003ee4, RAM + 0, 0xd32, 0xf9893014, "adds r0, #0x14" + 0, 0xd34, 0xf9c8f000, "bl #0x10c8" + 0, 0x10c8, 0xfff96c43, "ldr r3, [r0, #0x44]", load, 0x200000e4, RAM