From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0715AC433EF for ; Sun, 19 Sep 2021 18:08:46 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 99F13603E5 for ; Sun, 19 Sep 2021 18:08:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 99F13603E5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:50666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mS1F6-0005aL-Ln for qemu-devel@archiver.kernel.org; Sun, 19 Sep 2021 14:08:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:55136) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mS1Dv-0003l7-5W for qemu-devel@nongnu.org; Sun, 19 Sep 2021 14:07:31 -0400 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]:36749) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mS1Dt-0001tX-D3 for qemu-devel@nongnu.org; Sun, 19 Sep 2021 14:07:30 -0400 Received: by mail-wr1-x42f.google.com with SMTP id g16so24556909wrb.3 for ; Sun, 19 Sep 2021 11:07:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h8D8QzGCTREb784btrp5vSTKwgEPs6TMhqRs4dldHdE=; b=BFkKvs6NxYT/fIhhryoVsA3KZKkZdZxTuOHxVUxS14lzn3bpVgO2zXYB1f2Z9490jh o4x1b7RERCiuRVesW1Pbbfryo3qhot0hIxt90Fo2dX4proAEYLxBkajlqAY5KOKf5TlT 6Wozh8BN785xZN9oADkba8ttt1zKre37YS1Kx3BL2xTSKQrdMAyq8vjDPwkmUMnQzVlK a3GEu1ENgcErCg4TCoHPwOa4gGMYqNuTyH97tokrwD+BP4EoAcJ+usSV4zoGNYcdU29h Ler8LDqnimazC6SuGK8xmuuqRQxwdlh+sIRXQvVgPowUv7pQotZzz2mXK0hChw1Em9Bf UWBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h8D8QzGCTREb784btrp5vSTKwgEPs6TMhqRs4dldHdE=; b=N+U+K4hyxRdohynfvPVZZJk/z9Y3Wg8b3XUS5jlyJy//OWfV6gelA7dYU2OcPpS6AM ZUA+WKtIJHa2wtqw/NXKxcWTfgWEAtjmpmcjqCL76zXAk0zmwGeNqo9o7/rResJ51UzY cA+cTqMDa19/HYfU49HXcq8DOXtB21UMQDdyaTtuIDMI2ThcJ5mK+LC3f/1LMCFODrSr tFOZEXyySIS/jp5R43waUlHAhjd1rrv6MYsIrJnXKz3QxyJRDy6e4sXn7UWyjYjXwbYD xu+TZm4Q00fbio+6EZNk+mGvnmuMXku2jHDgVNTwNDb6vexSwAyZOmq+Uf0yJJmDEHr5 iJQA== X-Gm-Message-State: AOAM5317Fg8Rexs0fFm1JU6TPOloq+XxZn6pCgJSFzKFY6OZCR/7dT5j dqSf8kBBY6h4jc1S1DI92kIp2zZibhzd9cqWBg+mUA== X-Google-Smtp-Source: ABdhPJz9mKUP6d+VddiJ4DT/ThykpY7Xyjev7njbtmghBduuKR6Mfrf2ZQhRQXuz8c3DfiedOHUbLuml8xS8SdB5qtU= X-Received: by 2002:adf:fd12:: with SMTP id e18mr24272230wrr.275.1632074847486; Sun, 19 Sep 2021 11:07:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Maydell Date: Sun, 19 Sep 2021 19:06:35 +0100 Message-ID: Subject: Re: high cpu usage in idle state To: Ali Vatankhah Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::42f; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42f.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: qemu-discuss , qemu-ppc , =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= , qemu-devel Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Sat, 18 Sept 2021 at 09:12, Ali Vatankhah wrote: > then to check what instructions are executing I run this command: > > qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage -singlestep -d in_asm -D target_asm.log > > Obviously this results in a Kernel panic, but the point is that after panic there is no guest > instruction running as there is no more log in the file but still CPU usage is 100. The lack of further in_asm logging does not mean that guest instructions are not running. in_asm logging happens at *translate* time, which is to say the first time QEMU encounters any particular instruction. After translation, QEMU can re-execute the translated code for that instruction many times, and it will not show up in in_asm logs again. In particular, if the guest CPU is doing either of: * a tight loop * an infinite loop of taking exceptions it will just be re-running code that has been seen before. Probably the code the kernel runs after it panic()s is just a loop. If you want to log execution, you need to add 'exec' and/or 'cpu' to your -d logging. (Warning: this can generate a lot of logging output and massively slow down execution as a result.) > also run this command to check generated host assembly code: > > qemu-system-ppc64 -nographic -M ppce500 -cpu e5500 -kernel uImage -singlestep -d out_asm -D host_asm.log out_asm also is logged only at translate time, not at execution time. -- PMM