[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 10/11] target/i386/monitor: Move SEV specific commands to sev
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH 10/11] target/i386/monitor: Move SEV specific commands to sev.c |
Date: |
Wed, 16 Jun 2021 22:42:48 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 |
On 6/10/21 5:19 PM, Connor Kuehl wrote:
> On 6/10/21 1:45 AM, Philippe Mathieu-Daudé wrote:
>> Having the HMP/QMP commands defined in monitor.c makes the stubs
>> rather complicated when SEV is not built in. To simplify, move the
>> SEV functions to sev.c, and remove a layer of stubs.
>>
>> Also make it clearer when SEV is not built in, so developers don't
>> try to enable it when it is not enablable:
>>
>> - before:
>>
>> (qemu) info sev
>> SEV is not enabled
>>
>> - after:
>>
>> (qemu) info sev
>> SEV is not available in this QEMU
>>
>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>> ---
>> target/i386/monitor.c | 96 ----------------------------------
>> target/i386/sev-sysemu-stub.c | 29 +++++++----
>> target/i386/sev.c | 97 +++++++++++++++++++++++++++++++++++
>
> Hi Philippe,
>
> I agree that the split from monitor.c makes it easier to follow. Instead
> of putting the QMP entry points in sev-sysemu-stub. and sev.c, what do
> you think of placing them in sev-qmp-stub.c and sev-qmp.c, respectively?
>
> I find that appealing from a code organization/module boundary
> perspective.
I tried but this makes the code more complex since sev-qmp.c calls
functions defined in sev.c, we have to keep them declared in a local
header (sev_i386.h). So for v2 I choose to keep the same organization
but exploded the patch for easier review.
- Re: [PATCH 05/11] target/i386/sev_i386.h: Remove unused headers, (continued)
- [PATCH 06/11] target/i386/sev: Remove sev_get_me_mask(), Philippe Mathieu-Daudé, 2021/06/10
- [PATCH 07/11] target/i386/sev: Mark unreachable code with g_assert_not_reached(), Philippe Mathieu-Daudé, 2021/06/10
- [PATCH 08/11] target/i386/sev: sev_get_attestation_report use g_autofree, Philippe Mathieu-Daudé, 2021/06/10
- [PATCH 09/11] target/i386/sev: Restrict SEV to system emulation, Philippe Mathieu-Daudé, 2021/06/10
- [PATCH 10/11] target/i386/monitor: Move SEV specific commands to sev.c, Philippe Mathieu-Daudé, 2021/06/10
- [PATCH 11/11] monitor: Restrict 'info sev' to x86 targets, Philippe Mathieu-Daudé, 2021/06/10