ju...@oro.sh writes: > 31 July 2024 at 02:12, "Dr. David Alan Gilbert" <d...@treblig.org> wrote: > > Hello Dr. Gilbert, > >> >> * Josh Junon (ju...@oro.sh) wrote: >> >> Hi Josh, >> >> > >> > This commit adds a new QMP/HMP command `memtranslate`, >> > which translates a virtual address to a physical address >> > using the guest's MMU. >> > >> > This uses the same mechanism that `[p]memsave` does to >> > perform the translation. >> > >> > This commit also fixes a long standing issue of `[p]memsave` >> > not properly handling higher-half virtual addresses correctly, >> > namely when used over QMP/the monitor. The use and assumption of >> > signed integers caused issues when parsing otherwise valid >> > virtual addresses that instead caused signed integer overflow >> > or ERANGE errors. >> > >> > Signed-off-by: Josh Junon <ju...@oro.sh> >> >> There's a few different changes in this one patch; so the first >> thing is it needs splitting up; I suggest at least: >> >> a) Fixing the signedness problems >> >> b) The QMP implementation of the new command >> >> c) The HMP implementation of the new command >> >> That would make it a lot easier to review - also, it's good >> to get fixes in first! >> Now, going back a step; how does this compare to the existing >> 'gva2gpa' command which HMP has? >> > > Good catch, they're definitely the same. I didn't see that was there before, > perhaps because of the name. I've been looking for this exact command for a > while now, so it surprises me that I missed it! > > Since that's an HMP-only command, would it be okay if simply redirected its > definition to a new qmp_gva2gpa command so the implementation is all in one > spot?
If you have a use case for a QMP version, go right ahead. > If that's amenable, I can patch in the signedness fixes, then submit > qmp_gva2gpa, then changing hmp_gva2gpa to use the qmp_gva2gpa similar to how > other HMP commands with QMP analogs are implemented. Just let me know if that > works and I'll get on it. Sounds like a plan to me. > I appreciate the response! > > > Josh