[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v2 3/3] Add inject plugin and x86_64 target for the inject pl
From: |
Rowan Hart |
Subject: |
Re: [PATCH v2 3/3] Add inject plugin and x86_64 target for the inject plugin |
Date: |
Fri, 6 Dec 2024 17:02:11 -0800 |
User-agent: |
Mozilla Thunderbird |
>> +++ b/tests/tcg/plugins/inject.c
>
> Could we find a better name?
For sure, maybe "hypercalls.c" since that's really what it's mostly about.
>> @@ -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
-Rowan