From patchwork Wed Jul 14 15:00:31 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: 476775 Delivered-To: patch@linaro.org Received: by 2002:a02:c94a:0:0:0:0:0 with SMTP id u10csp662083jao; Wed, 14 Jul 2021 08:14:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8mfsdXCu+fAwzp7kNCX5KnpQ9Xl2VwZbiaHyncQ/ioqh/h3Hkgw8Y2VMbfArYRFFiTnmU X-Received: by 2002:adf:a41e:: with SMTP id d30mr13722076wra.10.1626275641398; Wed, 14 Jul 2021 08:14:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626275641; cv=none; d=google.com; s=arc-20160816; b=QSNDJvak+CO3Zf4Y4sAYhMBJvum++mIw/u0MA8vgP6RL6N+mRPgyDlrYSwfct/DnHu /uecS7F17pq6yU4WA0QQQladz2eFAR5oUJOHehjrEEE4r8mBfUGZActY9z8JnQNsL3+j AEp4MZoByk6L7rBPZXBi845raEMMZ2CISe+x9dOgFwgnWO8VXPkBs0izLiMcv3ot/TXf lOh1p92kL/nbS+bWmWdx/aZA75C+UyyBL4uiGe4zJPDA6L1StLv++k0+YFyCnIOuG62V phMblkHgvxt5qf2uSK8kvdRyMZff4p8H3K/FZoOcMWmhkZrEv0rHdzb+yU/T61IYxhBU 8ekg== 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=i5HnSE+P/5s50b3ycFZMLuncHoPnDDRR80OM7072KpRaOX6MSctJ8Mw/DWi4cjrA1Y nFN/pYCm0ZMLEb0IMkECQu6sTCtkpCj7cHr1YMGmTifoLNn0ENte6UWnuY5L2U/fi0ev l6gbdsCfTRSEtzD2BFpqurY4qe0420TIXpfhGBLw4w5umTfHA8mZEB4/Ff0ha5nhfR2Z PcOzyzKSLhaVoIb1YPcP0djUfIoFNp4/S/EVRTz/EdF81ppWpsls0JL1REcXLbaw2vSA DtwcNpNnz3mQDQAnUmGWehMryWAvzaV0uPEwea6WuqSh7Q2xgaaHzsBK2ouC1YfgbkNR o84g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=BLCRDvz9; 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 f2si3719190wrp.532.2021.07.14.08.14.01 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Jul 2021 08:14:01 -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=BLCRDvz9; 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]:34824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m3gaG-0004Sq-Eh for patch@linaro.org; Wed, 14 Jul 2021 11:14:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49540) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m3gNl-0007Qq-SK for qemu-devel@nongnu.org; Wed, 14 Jul 2021 11:01:05 -0400 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]:33611) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m3gNk-0007eI-4E for qemu-devel@nongnu.org; Wed, 14 Jul 2021 11:01:05 -0400 Received: by mail-wm1-x335.google.com with SMTP id g8-20020a1c9d080000b02901f13dd1672aso3614973wme.0 for ; Wed, 14 Jul 2021 08:01:03 -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=BLCRDvz9BtOLCneYOZwJQYaJEjSNVqRYJMZ+GWgLnorRcMyXne/8u65qg24ZXQMJp5 c3IiWpuogXwgJUH79S7MhsmoDlDo4JDSKSFP57LW5TKzM0GYHb1A0PADKAl94fgc6URF UvHOPacG+ni84YF9ZeTMpS9bWiYdpfvKGvtFeeYirshaFxws04nn5RJNthDjjrB2LqCH OsabpTOFNwKzoy9X5nJ1zDM2fLGgxGpjtdc6ZjYS68mSbdupLckvX5TQS39Gb+ifR388 JcbmXCdrORU4nsbpVRp8BthhXipIWIxM21v7ZMWZwbZcSkrBnckBlCCvWP3eRqQZQQiF kXtQ== 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=q3s+at3Q/CvS1k2vnqXEsrIoOz9AsVkCQgRQuLLGYJOkWg1AYLyGV2YCvFMgxcdb3S sRrZQ2Fnau2IQfmLsmfhYJgSU88egbZ87Yr48Q8aw36PdRikgH8xF4aTd8Rkn+6v8Sfi r77fgGcF1Yfd359S3htD2UKcgX/CeDW4ai5c0679R8unQwbq3sSeAKjDn1YWw27pOVOZ KzZcKvYuylq04mLVW6xea0ThB9pcdCnOUGQQjJi+HeBh4FANuu1qeiJ2riN46t/9+D2z 9I92HxBto+3zH8+AxpDaneceIUf3ER5ErBhjdvC9pEAZf/yqLZc7nFkZlwdGDdPEd7kd fmvA== X-Gm-Message-State: AOAM531SVMNiERh4kWFbRYpSJYX6TyK6Z9XE+NsU2bXBnXE0qSroEbBU og+h/A74I7roO6nEaaS5RYQ04Q== X-Received: by 2002:a1c:62c4:: with SMTP id w187mr11710029wmb.27.1626274862691; Wed, 14 Jul 2021 08:01:02 -0700 (PDT) Received: from zen.linaroharston ([51.148.130.216]) by smtp.gmail.com with ESMTPSA id o29sm2238160wms.13.2021.07.14.08.00.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jul 2021 08:00:58 -0700 (PDT) Received: from zen.lan (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id DA3721FFC0; Wed, 14 Jul 2021 16:00:40 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Subject: [PULL v5 39/44] docs/devel: tcg-plugins: add execlog plugin description Date: Wed, 14 Jul 2021 16:00:31 +0100 Message-Id: <20210714150036.21060-40-alex.bennee@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210714150036.21060-1-alex.bennee@linaro.org> References: <20210714150036.21060-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