From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Juergen Gross <jgross@suse.com>
Cc: Ian Jackson <iwj@xenproject.org>, Wei Liu <wl@xen.org>,
<xen-devel@lists.xenproject.org>, Jan Beulich <jbeulich@suse.com>
Subject: Re: [PATCH v2] tools/libs/guest: fix save and restore of pv domains after 32-bit de-support
Date: Mon, 7 Jun 2021 14:59:14 +0100 [thread overview]
Message-ID: <d9251ebe-67e0-2b9e-3031-202f5f27d3c7@citrix.com> (raw)
In-Reply-To: <07fad6f2-3ace-044e-72af-a470f6864c00@suse.com>
On 07/06/2021 14:04, Jan Beulich wrote:
> On 07.06.2021 15:00, Juergen Gross wrote:
>> --- a/tools/libs/guest/xg_sr_common_x86_pv.c
>> +++ b/tools/libs/guest/xg_sr_common_x86_pv.c
>> @@ -149,27 +149,32 @@ int x86_pv_map_m2p(struct xc_sr_context *ctx)
>>
>> ctx->x86.pv.nr_m2p_frames = (M2P_CHUNK_SIZE >> PAGE_SHIFT) * m2p_chunks;
>>
>> + if ( ctx->x86.pv.levels == 3 )
>> + {
> With this opening brace you no longer need ...
>
>> #ifdef __i386__
>> - /* 32 bit toolstacks automatically get the compat m2p */
>> - ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
>> + /* 32 bit toolstacks automatically get the compat m2p */
>> + ctx->x86.pv.compat_m2p_mfn0 = entries[0].mfn;
>> #else
>> - /* 64 bit toolstacks need to ask Xen specially for it */
>> - {
> ... this one, and hence you could avoid re-indenting ...
>
>> - struct xen_machphys_mfn_list xmml = {
>> - .max_extents = 1,
>> - .extent_start = { &ctx->x86.pv.compat_m2p_mfn0 },
>> - };
>> -
>> - rc = do_memory_op(xch, XENMEM_machphys_compat_mfn_list,
>> - &xmml, sizeof(xmml));
>> - if ( rc || xmml.nr_extents != 1 )
>> + /* 64 bit toolstacks need to ask Xen specially for it */
>> {
>> - PERROR("Failed to get compat mfn list from Xen");
>> - rc = -1;
>> - goto err;
>> + struct xen_machphys_mfn_list xmml = {
>> + .max_extents = 1,
>> + .extent_start = { &ctx->x86.pv.compat_m2p_mfn0 },
>> + };
>> +
>> + rc = do_memory_op(xch, XENMEM_machphys_compat_mfn_list,
>> + &xmml, sizeof(xmml));
>> + if ( rc || xmml.nr_extents != 1 )
>> + {
>> + PERROR("Failed to get compat mfn list from Xen");
>> + rc = -1;
>> + goto err;
>> + }
> ... all of this. Preferably with such reduced code churn,
> still/again:
I agree. I can fix on commit, if you're happy with that.
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
next prev parent reply other threads:[~2021-06-07 14:10 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-07 13:00 [PATCH v2] tools/libs/guest: fix save and restore of pv domains after 32-bit de-support Juergen Gross
2021-06-07 13:04 ` Jan Beulich
2021-06-07 13:59 ` Andrew Cooper [this message]
2021-06-07 14:25 ` Juergen Gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d9251ebe-67e0-2b9e-3031-202f5f27d3c7@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=iwj@xenproject.org \
--cc=jbeulich@suse.com \
--cc=jgross@suse.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).