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

Re: [PATCH v10 01/11] docs / include: introduce a new framework for 'domain context' records


  • To: Jan Beulich <jbeulich@xxxxxxxx>, Paul Durrant <paul@xxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Mon, 25 Jan 2021 18:25:50 +0000
  • 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=WnHdw0xNeGjThfKqWSSik4ffoouihnLdjf0gj76VPvU=; b=QNU+CNvgNkLymsAxzp/ZLHeDnozHIlm54RHIcaQxLD4YAyWIYhAR5q6wLUkxAgyMQ9VjJqCihi58XZ86WehBd/Pz4lV6eJT8qLFmEpsaJd7VJz8wausbkMwyuvrXl4HT4XXaoKYWDxfII5Pq5ncyE5yN6vLT5F949eruwuPU3AIU0d8FeTV/b0pBO3Mvt6WVOM3jqX5A4MnqTW4AA5jr+YNNyU75PfcFLjntJapMxyxv4XCIjkVo7tyhgDWDMUSInfGStwPdfqj8cO6fpI23G2xU/Tur/tRxLOy0xtilPuO6F7+PxrZPQ/D1gfvYC06ufAvxJgfvno4efkTIs5nhAw==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DoNNMF3Rq0NCUJDqTXihkYgpnjJKRo07yHte4ag/K5X1roL9l3oUS1gKLWjcn95DG4eS1Uko5Kf/4fDpj4UUPwRlGOQRSsCurNDRAvkPH4hMsnPznj7XvQMF7o/K7MKXR7MqKmaxmCjYHz7iDgpf9jNt/zyS1le4a0NbP6DOY+8RIa7OAg4dA0W7IEZXv5+Ir4jOHcG1d9OAYF6H2iEMG3qblisUH3I1a+E1HThO7JuHjfzJDi43rCo0sJKibMDbES3+TBMouuNVk42r84TEdhNRgPfPHAyYJLZwvSP+U7qT+c5AtAxUgn0IDhsnrYwilVB9nzfnrzdaNUQMIxDlCg==
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Paul Durrant <pdurrant@xxxxxxxxxx>, George Dunlap <george.dunlap@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Delivery-date: Mon, 25 Jan 2021 18:26:08 +0000
  • Ironport-sdr: R+0svzSbxlYlscoq9dgH6nvl9Tx0o5qEOxLz3Nn5GYlFVVP7WXWt4FKabw1zxAUSvOnH9Uuruk CLc5AxVGpj25xEiwl4EPo0KmnBg0zqgXs1pbjRDYiccA7pPCG6qzJ9E5hcUWTbwVv/Ws0P0OJh CTo24GoT+FfsjyWAReEGJ5yWgXEG93jJC4IxWQXFK6JlWPrvE468ET3wWzlxxpYBsQIYcIS8PN Fx5LKoOSAE0W0ADoT8awLcZDAM/ImtRR09IqmpBWOLhyQVdgN9H33r0ejWevIokXNnufivhAP4 nQg=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 19/10/2020 14:46, Jan Beulich wrote:
> On 08.10.2020 20:57, Paul Durrant wrote:
>> --- /dev/null
>> +++ b/xen/include/public/save.h
>> @@ -0,0 +1,66 @@
>> +/*
>> + * save.h
>> + *
>> + * Structure definitions for common PV/HVM domain state that is held by Xen.
>> + *
>> + * Copyright Amazon.com Inc. or its affiliates.
>> + *
>> + * Permission is hereby granted, free of charge, to any person obtaining a 
>> copy
>> + * of this software and associated documentation files (the "Software"), to
>> + * deal in the Software without restriction, including without limitation 
>> the
>> + * rights to use, copy, modify, merge, publish, distribute, sublicense, 
>> and/or
>> + * sell copies of the Software, and to permit persons to whom the Software 
>> is
>> + * furnished to do so, subject to the following conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be included 
>> in
>> + * all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 
>> OR
>> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
>> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
>> THE
>> + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
>> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
>> + * DEALINGS IN THE SOFTWARE.
>> + */
>> +
>> +#ifndef XEN_PUBLIC_SAVE_H
>> +#define XEN_PUBLIC_SAVE_H
>> +
>> +#if defined(__XEN__) || defined(__XEN_TOOLS__)
>> +
>> +#include "xen.h"
>> +
>> +/*
>> + * C structures for the Domain Context v1 format.
>> + * See docs/specs/domain-context.md
>> + */
>> +
>> +struct domain_context_record {
>> +    uint32_t type;
>> +    uint32_t instance;
>> +    uint64_t length;
> Should this be uint64_aligned_t, such that alignof() will
> produce consistent values regardless of bitness of the invoking
> domain?

Does it matter?  Its just a bitstream, and can appear in the migration
fd at any arbitrary alignment.

What matters is that the structure is aligned appropriately for the
bitness of code operating on these fields.

Even with the tools ABI fixed to allow a 32-on-64-on-64  toolstack to
function, I'm not sure that excess alignment would be appropriate.  Sure
- it would be more efficient for 32bit code to align to the 8 byte
boundary for the benefit of a 64bit Xen's copy_from_user(), but this
alignment happens anyway because of how hypercall buffers work.

~Andrew



 


Rackspace

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