From patchwork Thu Sep 9 19:00:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Baturo X-Patchwork-Id: 12483713 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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 ED5FAC433F5 for ; Thu, 9 Sep 2021 19:07:40 +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 B1CE961059 for ; Thu, 9 Sep 2021 19:07:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B1CE961059 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=nongnu.org Received: from localhost ([::1]:38666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mOPOd-0003cs-Ta for qemu-devel@archiver.kernel.org; Thu, 09 Sep 2021 15:07:39 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58710) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mOPID-0003da-4k; Thu, 09 Sep 2021 15:01:01 -0400 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]:43551) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mOPI8-0007Nk-1N; Thu, 09 Sep 2021 15:01:00 -0400 Received: by mail-ed1-x536.google.com with SMTP id n10so1495194eda.10; Thu, 09 Sep 2021 12:00:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CBaftD2HDN9Nf5cir5Muklttb7yddyUCtA5aZqQW4QQ=; b=OsuK2Jm3KDDfWQgzUIhXhyqMr+MfY2wEKucV8S7g9hz7Kq6f/ysGsV6fv7JiT1p1mZ 9hfbJW+Tlel+1Dov4YmnieEHNB7uVpzh70ZkMY5dkmm96FtxoZl1EVYnE8ntGQgWrKYW WIpxwD+mgNRBDycTpvGk+td5bnIAKhu4xora15tqFuqKaTBuaRrLIznKyijuG0EURITD dorw0nRliiQ92bQPr2PPJHccWAejbNvKq7zssZvQTiWnHQXNZAKug2V/w6zQg+rbo4/l mqmp4PLeplIKDRpkvuVl/yJdZJ3cF6+BGrgBJGtcBTNMf9v30rXTJHSvqAKJR/EUKluN yMHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CBaftD2HDN9Nf5cir5Muklttb7yddyUCtA5aZqQW4QQ=; b=VbkdJSu1E11ZDNhqGcjQj5cE48KMZxbrGWVy07JByGaVi1kLPE3Sgz68zu11aJNvus 3AXKgHsz0JH/phOveBSemmVmRKm3zHg78Y7+oGpyk+Zk8bjuPyymIbieEye0hX1+I6ML yE9xfKB7LES9q3s6hZjQ71C1xMk2H6cNEMhRNffp2qHMOWCFBr93hsKdoQKEn8f3aSt9 Dkk00kRa69BFz/Fu86qBDN8rYDz5A47/gzi3wAzZyLx3vepCdWKNnL5CtqWZeT03JuGO p5M4s7Sd7nrgXYHehayd/htn3ZqfeSmjVM7nnRwMxBJeQs+umKBBe/jyDSiN8937p3UB AldQ== X-Gm-Message-State: AOAM531f/AyElj92+y8mV8eZkvCflt/p6aXeW3CiysHJu/PWqmYld37u pJo68OGeMV/5l0lK9t6u9uaNcmSyv0Vb5UOGQvU= X-Google-Smtp-Source: ABdhPJxIB3JlHeW4UZ/D+zMUiTEAzEBLtIsDbz7JEL234pTKEayGPfSsxV8E1mwQRKJ5d6MP5rT0Bw== X-Received: by 2002:a05:6402:c90:: with SMTP id cm16mr4804474edb.170.1631214054058; Thu, 09 Sep 2021 12:00:54 -0700 (PDT) Received: from neptune.lab ([46.39.229.233]) by smtp.googlemail.com with ESMTPSA id c17sm1514588edu.11.2021.09.09.12.00.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Sep 2021 12:00:53 -0700 (PDT) From: Alexey Baturo X-Google-Original-From: Alexey Baturo To: Subject: [PATCH v11 4/7] [RISCV_PM] Print new PM CSRs in QEMU logs Date: Thu, 9 Sep 2021 22:00:30 +0300 Message-Id: <20210909190033.1339448-5-space.monkey.delivers@gmail.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210909190033.1339448-1-space.monkey.delivers@gmail.com> References: <20210909190033.1339448-1-space.monkey.delivers@gmail.com> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::536; envelope-from=baturo.alexey@gmail.com; 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, FREEMAIL_FROM=0.001, 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: baturo.alexey@gmail.com, qemu-riscv@nongnu.org, sagark@eecs.berkeley.edu, kbastian@mail.uni-paderborn.de, Bin Meng , richard.henderson@linaro.org, qemu-devel@nongnu.org, space.monkey.delivers@gmail.com, Alistair Francis , palmer@dabbelt.com Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alexey Baturo Reviewed-by: Richard Henderson Reviewed-by: Alistair Francis --- target/riscv/cpu.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c index 62870e8f36..f5fdc31fb9 100644 --- a/target/riscv/cpu.c +++ b/target/riscv/cpu.c @@ -300,6 +300,31 @@ static void riscv_cpu_dump_state(CPUState *cs, FILE *f, int flags) qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mscratch", env->mscratch); qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "sscratch", env->sscratch); qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "satp ", env->satp); + if (riscv_has_ext(env, RVJ)) { + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mmte ", env->mmte); + switch (env->priv) { + case PRV_U: + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "upmbase ", + env->upmbase); + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "upmmask ", + env->upmmask); + break; + case PRV_S: + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "spmbase ", + env->spmbase); + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "spmmask ", + env->spmmask); + break; + case PRV_M: + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mpmbase ", + env->mpmbase); + qemu_fprintf(f, " %s " TARGET_FMT_lx "\n", "mpmmask ", + env->mpmmask); + break; + default: + g_assert_not_reached(); + } + } #endif for (i = 0; i < 32; i++) {