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

Re: [PATCH] stubdom: foreignmemory: Fix build after 0dbb4be739c5

  • To: Costin Lupu <costin.lupu@xxxxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Julien Grall <julien@xxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Tue, 27 Jul 2021 14:36:10 +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=wFD60ybjZ/68Z7KQ3tdxlzFgC9WkJZstH9j8ETv7pJM=; b=VAGoBhchjQq2wHK5/izHuQNtdK79lFMhmvyQNtANSuKcwuXKwPOh43K5z1DjN4TYZA07hb219zjxkoaeeAshK2YJKkWvcV8vxeubj2k6B9UcHaqkY2rQ+ZQ2rHjZaZNi++7D08K5/XtC+dWX5TLqb5qCsINqR/hyMfxlIGxdbmHn8m7u+hNPdrxIvbDtP3kQdix/QxepslXx5iEHtEKit+F7VQRZyDAEXqLxVpawW7gu82t995Lf9Z3cBgnRbj5eXPC6rnk70ryIZy9f3MWOUjpU/Z32/iJzRF44u8TVT1MTqa6LpBzkr7cJvwL0n+XYhUdZRt5cLg0h/8iJdt+9CQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lzCRlgF7oxs6Ot4q/u82ZhQ6QcdwmLa9dN7zSaVClgb69w7VnhHH3lZ0sflfpy/Z5Mb74kCwJuM79knA8+Nxw9u1GvIYNTR0pyEyJIGT4Ow+Rcl4MwOmfDDmbkD5IQQPw9KPFoWRXBVXohaZPzosupPOzm7tUgjkw0mN4x2+80p1fr51CUWmFqII7QowpTVU0XO7OrOz0NIKuKQVq783lmQU4qS3me9gAlHWrnLogbH0xSxf8j7ENupDDEh8My+mqZ80i/o9GpZ2uNVepgGD6EqLxiLZIjcGhUmrTjWc7BPtCW6OGE/7wC8p3LipjlFWtWpukyHOrXb8VaBrSLn8kg==
  • Authentication-results: esa4.hc3370-68.iphmx.com; dkim=pass (signature verified) header.i=@citrix.onmicrosoft.com
  • Cc: Julien Grall <jgrall@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>, "Wei Liu" <wl@xxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Tue, 27 Jul 2021 13:36:37 +0000
  • Ironport-hdrordr: A9a23:sqqCOamRxZ5dB1wSFz1KOkqw20jpDfOlimdD5ihNYBxZY6Wkfp +V8sjzhCWatN9OYh0dcLC7WJVpQRvnhPpICPoqTMmftW7dyRSVxeBZnPffKljbehEWmdQtrp uIH5IObuEYSGIK8PoSgzPIYOrIouP3iJxA7N22pxwGIHAIGsMQmjuRSDzrdXGeLDM2dabRf6 Dsn/avyQDQHEj/Iv7LfEXsCIP41qz2fd/dEFE7Li9izDPLoSKj6bb8HRTd9hACUwlXybNn1W TeiQT26oiqrvn+k3bnpi7uxqUTvOGk5spIBcSKhMRQAjLwijywbIAkf7GZpjg6rMym9V5vut jRpBULOdh19hrqDy+IiCqo/zOl/Ccl6nfkx1PdqXz/ofbhTDZ/MMZFjZIxSGqS12MQ+PVHlI 5b1WOQsJRaSTnamj7m2tTOXxZ20mKpvHsLi4co/j5ieLpbTIUUgZ0U/UtTHptFNjn98pobHO 5nC9yZzOpKcGmdc2vSsgBUsZ+Rt0wIb1O7q3U5y4uoO2A8pgE+86JY/r1eop44zuN5d3EejN 60a5iB/dp1P70rhaEUPpZLfSL4MB2Uffv2ChPkHb3QLtBOB5v8ke+C3FwL3pDdRHUp9up+pH 2TaiIViYYNE3ieQPFmmqc7qSzwfA==
  • Ironport-sdr: ZV/SeQbrKxbNeYzaQpmwHX8LvoDfiLBf7erIXnC2xJcS7lVR1TgcnkOqG0Gnz3w3hc5F+/m5e1 2JQ5cEFaHdj6Xnnywo3vfnL5RGEjynqXko09J9iKVdJGSfXhYNvEiHQI4yDBsXHAzR4KaW1HmN kfuOrQ+YyL2w/CpsTCZ2LFXe/1XP+UswabSAn7xBnTwEecrjq/+ADRvGpQxH5PUmMjn0hLhIMn +S/WQW5gKCvCDaGWAqwK8doLpBjk80WQTigZhWPQFHT0Cud8D4nwPA/oyALXA/aS/np4MEemkM i7hR90/OH5AfQOGP71/RV5yJ
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 16/07/2021 19:28, Costin Lupu wrote:
> On 7/13/21 6:20 PM, Juergen Gross wrote:
>> On 13.07.21 17:15, Julien Grall wrote:
>>> Hi Juergen,
>>> On 13/07/2021 16:09, Juergen Gross wrote:
>>>> On 13.07.21 16:38, Julien Grall wrote:
>>>>> Hi Juergen,
>>>>> On 13/07/2021 15:23, Juergen Gross wrote:
>>>>>> On 13.07.21 16:19, Julien Grall wrote:
>>>>>>> Hi Jan,
>>>>>>> On 13/07/2021 15:14, Jan Beulich wrote:
>>>>>>>>> And I don't think it should be named XC_PAGE_*, but rather
>>>>>>>>> XEN_PAGE_*.
>>>>>>>> Even that doesn't seem right to me, at least in principle. There
>>>>>>>> shouldn't
>>>>>>>> be a build time setting when it may vary at runtime. IOW on Arm I
>>>>>>>> think a
>>>>>>>> runtime query to the hypervisor would be needed instead.
>>>>>>> Yes, we want to be able to use the same userspace/OS without
>>>>>>> rebuilding to a specific hypervisor page size.
>>>>>> This define is used for accessing data of other domains. See the
>>>>>> define
>>>>>> for XEN_PAGE_SIZE in xen/include/public/io/ring.h
>>>>>> So it should be a constant (minimal) page size for all hypervisors and
>>>>>> guests of an architecture.
>>>>> Do you mean the maximum rather than minimal? If you use the minimal
>>>>> (4KB), then you would not be able to map the page in the stage-2 if
>>>>> the hypervisor is using 64KB.
>>>> But this would mean that the current solution to use XC_PAGE_SIZE is
>>>> wrong, as this is 4k.
>>> The existing ABI is implicitely based on using the hypervisor page
>>> granularity (currently 4KB).
>>> There is really no way we can support existing guest on 64KB
>>> hypervisor. But if we were going to break them, then we should
>>> consider to do one of the following option:
>>>     1) use 64KB page granularity for ABI
>>>     2) query the hypervisor page granularity at runtime
>>> The ideal is 2) because it is more scalable for the future. We also
>>> need to consider to extend the PV protocol so the backend and frontend
>>> can agree on the page size.
>> I absolutely agree, but my suggestion was to help finding a proper way
>> to cleanup the current interface mess. And this should be done the way
>> I suggested IMO.
>> A later interface extension for future guests can still be done on top
>> of that.
> Alright, let's have a little recap to see if I got it right and to agree
> on the next steps. There are 2 proposed solutions, let's say a static
> one and a dynamic one.
> 1) Static solution (proposed by Juergen)
> - We define XEN_PAGE_* values in a xen/include/public/arch-*/*.h header.
> - Q: Should we define a new header for that? page.h or page_size.h are
> ok as new filenames?
> Pros:
> - We fix the interfaces mess and we can get rid of xenctrl lib
> dependency for some of the libs that need only the XEN_PAGE_* definitions.
> - It's faster to implement, with fewer changes.
> Cons:
> - Well, it's static, it doesn't allow the hypervisor to provide
> different values for different guests.
> 2) Dynamic solution (proposed by Jan and Julien)
> We get the value(s) by calling a hypcall, probably as a query related to
> some guest domain.
> Pros:
> - It's dynamic and scalable. We would support different values for
> different guests.
> Cons:
> - More difficult to implement. It changes the paradigm in the toolstack
> libs, every occurrence of XC_PAGE_* would have to be amended. Moreover,
> we might want to make the hypcall once and save the value for later
> (probably several toolstack structures should be extended for that)
> I searched for the occurrences of XC_PAGE_* in the toolstack libs and
> it's a *lot* of them. IMHO I think we should pick the static solution
> for now, considering that it would be faster to implement. Please let me
> know if this is OK or not. Any comments are appreciated.

The immediate problem needing fixing is the stable libraries inclusion
of unstable headers - specifically, the inclusion of <xenctrl.h>.

Juergen's proposal moves the existing constant to a more appropriate
location, and specifically, a location where its value is stable.

It does not change the ABI.  It merely demonstrates that the existing
ABI is broken, and thus is absolutely a step in the right direction.

This is the approach you should take in the short term, and needs
sorting before 4.16 ships.

The dynamic solution, while preferable in the longterm, is far more
complicated than even described thus far, and is not as simple as just
having a hypercall and using that value.

Among other things, it requires coordination with the dom0 kernel as to
its pagetable setup, and with Xen's choice of pagetable size for dom0,
which may not be the same as domU's.  It is a large quantity of work,
very invasive to the existing APIs/ABIs, and stands no chance at all of
being ready for 4.16.




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