|
From: | Pierrick Bouvier |
Subject: | Re: [PATCH v2 3/3] Add inject plugin and x86_64 target for the inject plugin |
Date: | Mon, 9 Dec 2024 10:38:26 -0800 |
User-agent: | Mozilla Thunderbird |
On 12/6/24 17:02, Rowan Hart wrote:
+++ b/tests/tcg/plugins/inject.cCould we find a better name?For sure, maybe "hypercalls.c" since that's really what it's mostly about.
Sounds good.
@@ -0,0 +1,206 @@ +/* + * Copyright (C) 2024, Rowan Hart <rowanbhart@gmail.com> + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */We can add a comment here about what the plugin is doing.Will do!One challenge with picking a random value, is how to ensure this pattern has no other meaning for all architectures? I'm not sure we can find a single pattern of bytes that works for all arch, even though that would be definitely stylish :). In more, it seems that we are reinventing the syscall interface, while we already have it. But as the current instrumentation only works for user-mode, having a specific hypercall interface might be worth it for plugins, so system mode could benefit from it too. The work done here could serve later to define a proper interface.I'll see what I can do about this. SIMICS supports many architectures and has a "magic instruction" interface[0] (basically hypercalls) and has these instructions defined per-architecture in a way that at minimum there are 12 values available which work on every architecture the simulator supports. QEMU supports more architectures than SIMICS but I think we could start there and follow a similar approach. [0]: https://intel.github.io/tsffs/simics/simics-user-guide/breakpoints.html#Magic-Breakpoints
Looks like a good model to reuse if we want to implement something similar.
-Rowan
[Prev in Thread] | Current Thread | [Next in Thread] |