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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 38B5EC001E0 for ; Mon, 14 Aug 2023 15:36:12 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qVZat-0004E0-6N; Mon, 14 Aug 2023 11:34:59 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qVZam-0004Cl-OA for qemu-devel@nongnu.org; Mon, 14 Aug 2023 11:34:56 -0400 Received: from mail-wm1-x32b.google.com ([2a00:1450:4864:20::32b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qVZaj-0004K1-Tp for qemu-devel@nongnu.org; Mon, 14 Aug 2023 11:34:52 -0400 Received: by mail-wm1-x32b.google.com with SMTP id 5b1f17b1804b1-3fe45481edfso45341065e9.1 for ; Mon, 14 Aug 2023 08:34:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1692027288; x=1692632088; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:from:to:cc:subject:date :message-id:reply-to; bh=f4wrOsVR1IYr28e2rGLXssLRPSZYCC8zvYvmEmn+J2M=; b=J1rMyRCCbo1b+x9BG7rlcDjxtlK/iRM8IdMSHVeyNgzGBNMpojQGU996AVxn2gu2j1 xKtz6PpfP/TBDomo7tSivaX/ouwCvrCKHdYszoA7ZcXf0h/HgpN7Ys7vSy3oqfZBpSaK txdeg/hDvSjxY0oJGptdAFwjwP4p5c+Z/xL3Hu2rUvobTDgG7llqfPbymxrxPhrwLA3v BgXCQ+0n/+dn3rlD5odhYrNWaoQZxK6WuVhm2Nx+2uhMX7UHxoWDufqEHpuBDotuNRPB IJfCsBQEXdcoVmK39PBJ6ZHy72deCu67IDCpum8oWOUDsW0F3c0YNhchp/GjqaWQwNUg 3P/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692027288; x=1692632088; h=content-transfer-encoding:mime-version:message-id:in-reply-to:date :subject:cc:to:from:user-agent:references:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=f4wrOsVR1IYr28e2rGLXssLRPSZYCC8zvYvmEmn+J2M=; b=DVhJ+umV9Paz81lhQO7KFqAiOHQC/FUAx8h2SttZ9tAfT7lNPcDNmFy/w909GsHLDE dTmQkTfxYCll5OlCUYS9zVH7nE+fVElE08eIFErQUPhOAlCQIFrFDq8QmQPgwYTdk1mz BR7Yo/oz05m9k4LHNOh1DqlbUwaiPpw5jEhaZ7NsRZNNWtfwBD5YFkZIxKtZpHE4fdbu xPTfbBx2Z2SYgTMKNwZ184lNa4CcC00tmNZ9GS7vndJcSJ22mRqmaE3HK3yEoUzzxVPQ YsdWVA6LfMgWeRh1af816NxLr21RCl8Wu00L64OaD/LSL6ZMFz4Pv6bI/88dfdNvTVq3 zwPw== X-Gm-Message-State: AOJu0YylfZEQD+pqsuXmyh2gfEd0yL7gs8uZ0nMa3B3vNIQBfSiugJGi IoVQFGOyCAc4g+zCa9TMGq2YVg== X-Google-Smtp-Source: AGHT+IH0kTI13oPE4lub7MbgHrieqPfFd8Ev/4y/qzoT6sHfrOZCGD+Yz1M21biYe5PzGfUKwci/VQ== X-Received: by 2002:a7b:c449:0:b0:3f8:fc96:6bfd with SMTP id l9-20020a7bc449000000b003f8fc966bfdmr8217988wmi.17.1692027288076; Mon, 14 Aug 2023 08:34:48 -0700 (PDT) Received: from zen.linaroharston ([85.9.250.243]) by smtp.gmail.com with ESMTPSA id h18-20020a1ccc12000000b003fbd9e390e1sm17767620wmb.47.2023.08.14.08.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Aug 2023 08:34:47 -0700 (PDT) Received: from zen (localhost [127.0.0.1]) by zen.linaroharston (Postfix) with ESMTP id 19B5F1FFBB; Mon, 14 Aug 2023 16:34:47 +0100 (BST) References: <20230731084354.115015-1-akihiko.odaki@daynix.com> User-agent: mu4e 1.11.14; emacs 29.1.50 From: Alex =?utf-8?Q?Benn=C3=A9e?= To: Akihiko Odaki Cc: Paolo Bonzini , Thomas Huth , Alexandre Iooss , Mahmoud Mandour , Eduardo Habkost , Marcel Apfelbaum , Philippe =?utf-8?Q?Mathieu-Daud?= =?utf-8?Q?=C3=A9?= , Yanan Wang , Richard Henderson , =?utf-8?Q?Marc-Andr=C3=A9?= Lureau , =?utf-8?Q?Daniel_P=2E_Berrang=C3=A9?= , John Snow , Cleber Rosa , Peter Maydell , Michael Rolnik , "Edgar E. Iglesias" , Brian Cain , Song Gao , Xiaojuan Yang , Laurent Vivier , Aurelien Jarno , Jiaxun Yang , Aleksandar Rikalo , Chris Wulff , Marek Vasut , Stafford Horne , Daniel Henrique Barboza , =?utf-8?Q?C=C3=A9dric?= Le Goater , David Gibson , Greg Kurz , Nicholas Piggin , Palmer Dabbelt , Alistair Francis , Bin Meng , Weiwei Li , Liu Zhiwei , Yoshinori Sato , David Hildenbrand , Ilya Leoshkevich , Mark Cave-Ayland , Artyom Tarasenko , Bastian Koppelmann , Max Filippov , qemu-devel@nongnu.org, qemu-arm@nongnu.org, qemu-ppc@nongnu.org, qemu-riscv@nongnu.org, qemu-s390x@nongnu.org Subject: Re: [RFC PATCH 00/24] plugins: Allow to read registers Date: Mon, 14 Aug 2023 16:27:46 +0100 In-reply-to: <20230731084354.115015-1-akihiko.odaki@daynix.com> Message-ID: <87leedprhl.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::32b; envelope-from=alex.bennee@linaro.org; helo=mail-wm1-x32b.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=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Akihiko Odaki writes: > I and other people in the University of Tokyo, where I research processor > design, found TCG plugins are very useful for processor design > exploration. Thanks for the submission - I've finished my initial review pass. I think introducing register introspection into the plugins subsystem is a very worthwhile addition. I'm also happy (for now) to use the underlying gdb support for it in lieu of a greater refactoring of QEMU's multiple register introspection features. > The feature we find missing is the capability to read registers from > plugins. In this series, I propose to add such a capability by reusing > gdbstub code. > > The reuse of gdbstub code ensures the long-term stability of the TCG plug= in > interface for register access without incurring a burden to maintain yet > another interface for register access. However I don't want to expose the gdb detail to plugins to leave us a free hand in further internal clean-ups later on. > This process to add TCG plugin involves four major changes. The first one > is to add GDBFeature structure that represents a GDB feature, which usual= ly > includes registers. GDBFeature can be generated from static XML files or > dynamically generated by architecture-specific code. In fact, this is a > refactoring independent of the feature this series adds, and potentially > it's benefitial even without the plugin feature. The plugin feature will > utilize this new structure to describe registers exposed to plugins. I think we can get cleanups to this handling in ahead of the wider plugin feature. Ideally it would be nice to push the XML generation into gdbstub itself but that might be more of a refactor than you are willing to pursue for the time being. > The second one is to make gdb_read_register/gdb_write_register usable > outside of gdbstub context. > > The third one is to actually make registers readable for plugins. Modulo isolating the plugin API from gdb specifics I'm happy with this approach. > The last one is to allow to implement a QEMU plugin in C++. A plugin that > I'll describe later is written in C++. I would want a more compelling reason that a hello world plugin for this. Only because QEMU has removed a bunch of C++ dependency over the last few years so I don't think we are in a rush to re-introduce it.=20 Are you OK to do a re-spin addressing the comments so far? --=20 Alex Benn=C3=A9e Virtualisation Tech Lead @ Linaro