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=-5.1 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3DBCBC433F5 for ; Sun, 19 Sep 2021 18:49:13 +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 BE2A8611F0 for ; Sun, 19 Sep 2021 18:49:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org BE2A8611F0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=amsat.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:34500 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mS1sF-0001tm-L1 for qemu-devel@archiver.kernel.org; Sun, 19 Sep 2021 14:49:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60502) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mS1pY-000086-MH; Sun, 19 Sep 2021 14:46:27 -0400 Received: from mail-wm1-x333.google.com ([2a00:1450:4864:20::333]:53153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mS1pX-00030m-9Z; Sun, 19 Sep 2021 14:46:24 -0400 Received: by mail-wm1-x333.google.com with SMTP id e26so11390274wmk.2; Sun, 19 Sep 2021 11:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Rs3p8nPSZzE5voTGBUsiwJybz2sepkGEn+18uz25k74=; b=FieyksIqP8c96U3BbdVVPYjwMHhZ6LcRVeU7WdX93GqRfEs5un1kpEL1Ed7Cjdt4Xw 61u47n4FvRxGIBmJy2a9tPL/17mGejsiXb/t2ay1cDki7uqOFSNuMppbJdx3Rs+GWztp MMLcWKqkFegDNgfc81meys+18mse2dSPmXOD5580IQZJkhhodqZg8IiAAg2cTi07qcIV S6PHo/N76wn44OyMarV2vE8SAHxm0aXc9Thggx23Op7/cvAcadEZgrlctKNqaoBDcEME CAUry6Tx6QS1ShHUjyRLLEotSulXHxa+TeZjHEy/alc48p0aN9YBvCyeO3Zj5oRej3Q1 0GMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :subject:content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Rs3p8nPSZzE5voTGBUsiwJybz2sepkGEn+18uz25k74=; b=J9S02nAE5f4c+b4ESyKMPUmXIEePlEO72Mmg/Q1zT316SfydGS9PCYJDW4EHDH0JEP Qm7FyC10w63PRqP/1Zb0k3VQhbzBS6ttOSOabSb1ANZHRfQVqEaKfKTL35JR9BIdvRnD UE1d6BFFjCnSgJF0irair6ioXns3wdWXnZtu0pUFq4OCoZ6plfAUDWReSme3gO1nfT9b qE4QdU8nrzODF6I8Y75AXLvUomV9kVyl7mU/1f38aL7MSQJ6NRAmV0tdgScW8C7aseDE KkOpI8jl0Ut4YwtyMzdA6ABnOLt0NflsELm+MnoaY/trT1rgP0hKrP4vnaqwXY+hO1/C RThA== X-Gm-Message-State: AOAM530PI/WOMxBkR/j40bzkC/prRF17vHMdb+myD0VWw47xqjgQ/32Y 2Hvs4UCxaTDtW6oygiOd7+4= X-Google-Smtp-Source: ABdhPJwnEUWb4kzwO1Ok3v/1Qvwo4yJp26U58+iK3TVdJxhSatXSveXa1tJQufK8MFQv69m1MzKQfA== X-Received: by 2002:a1c:ed0a:: with SMTP id l10mr21509860wmh.140.1632077180442; Sun, 19 Sep 2021 11:46:20 -0700 (PDT) Received: from [192.168.1.36] (14.red-83-35-25.dynamicip.rima-tde.net. [83.35.25.14]) by smtp.gmail.com with ESMTPSA id v20sm13573379wra.73.2021.09.19.11.46.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Sep 2021 11:46:19 -0700 (PDT) Message-ID: <384c4dd7-312b-9c52-ada5-138840c0217a@amsat.org> Date: Sun, 19 Sep 2021 20:46:18 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: high cpu usage in idle state Content-Language: en-US To: Peter Maydell , Ali Vatankhah References: From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=philippe.mathieu.daude@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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-ppc , qemu-devel , qemu-discuss Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 9/19/21 20:06, Peter Maydell wrote: > 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.) In the "infinite loop exception" case, '-d int' might be sufficient, before using 'exec/cpu', since you'll see the exception raise over and over. >> 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 >