[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] tools/libs/guest: fix save and restore of pv domains after 32-bit de-support


  • To: Juergen Gross <jgross@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 7 Jun 2021 14:59:14 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nA6whvAbHknALXPo49Zej0ng4Nmw1TYfNVp8NHz3Ibs=; b=QerGqXrOQwKsp+ir/Ma+vgXJ9Krv6Rwc7eCGj7PV1jl5WuDEFZbkwtpQ+JXdTuPuWTkVEke3DhVqOuq93CGDAvXglLJX7ZghL+jbPHzVG632Z4w8a3GQJ+jwPC5qGBRlbbBMH6yDPEpmtO00R08M+AsB9l3ZzD5LeGGeftWOjXQqxbAGFJNcm9WTn72J5OuyaPN5VRJpPQ/SlXxIJDlErDM6kTHGVnoaqoNYbnejEoaWzO7XBvm/JtPbJrVks5firRcgj/rdEWUdONSmrQPqWGlvq2o7NYYFcrjBGtYVYWTzAOKQh3D8OLbzPADfZTMNq8sdMUHS1SwBAH/x0cGPrQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EwTpZRYNNDuunSOcS+zMfdwHpud9TBwG333/RRHULCz9Q8p8++X7PDv5y2bxdCH7SRZmIoyaom/OtkRCqkzwQ1SEp67cnJLNdZm/oKu/Xi4yddeEzBx2gXmydcUaHGkUElzRpZEwL0azRs2p8jEFB0D2ICfLm7spCmKKQNH6+EnB1j5WY/UNP0kujGTGmhFNwiDnHpNtIw73EM3epKvavhhV+92b423l8kzGjO4R7OU/3mKwzXAM6TOPfDPGj2+6n8xdZWAqm+hIINJw+An5KvyLXNJvHm2k2Y0VFiudxQdNGGN7wa2ONgWK+m7QO9YRTWLKwirC1paZRPs0Cd5b5g==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Ian Jackson <iwj@xxxxxxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • Delivery-date: Mon, 07 Jun 2021 14:09:50 +0000
  • Ironport-hdrordr: A9a23:lrMzkKB7sL6YijvlHenP55DYdb4zR+YMi2TDtnoQdfUxSKelfq +V8cjzuSWftN9zYhAdcK67V5VoKEm0naKdirN8AV7NZmfbhFc=
  • Ironport-sdr: pUE7hOyVyVLIJHXPinwnv4Gzh78Lk6HMRf8Fb7HkAaOMjJx9urjXj0qYx5CGl/2X0QbNTBNhZR xgaaNbDUAXSLjJo3kPQnY5vzLU+3ma4sd6GHmEocgiMkAtr1jL3PZ6rsV47Yhwe3q4mXQ5eSGz 4zG8jHgVHDS++khg2uDxywZWq/6cAGQl8Fx9PVY+gkn09jg2RrMXRxBh+4LrinoLyk7VSVy0mi EBsKoktXAczTiNNXqPrJ5o4DKWNBhyfuQA/EEycStojM3igZ4/XV3gonFJgnhJ93oVmlCvhlOw dfU=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

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@xxxxxxxxxx>



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.