diff mbox

public/elfnote: document non-alignment of relocated init-P2M

Message ID 5911ED1902000078001583C3@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich May 9, 2017, 2:23 p.m. UTC
Since PV kernels can't use large pages anywa, when the init-P2M support
was added it was decided to keep the implementation simple and not
align large pages in PFN space. Document this.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
public/elfnote: document non-alignment of relocated init-P2M

Since PV kernels can't use large pages anywa, when the init-P2M support
was added it was decided to keep the implementation simple and not
align large pages in PFN space. Document this.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -173,7 +173,9 @@
  * The (non-default) location the initial phys-to-machine map should be
  * placed at by the hypervisor (Dom0) or the tools (DomU).
  * The kernel must be prepared for this mapping to be established using
- * large pages, despite such otherwise not being available to guests.
+ * large pages, despite such otherwise not being available to guests. Note
+ * that these large pages may be misaligned in PFN space (they'll obviously
+ * be aligned in MFN and virtual address spaces).
  * The kernel must also be able to handle the page table pages used for
  * this mapping not being accessible through the initial mapping.
  * (Only x86-64 supports this at present.)

Comments

Jürgen Groß May 9, 2017, 2:36 p.m. UTC | #1
On 09/05/17 16:23, Jan Beulich wrote:
> Since PV kernels can't use large pages anywa, when the init-P2M support
> was added it was decided to keep the implementation simple and not
> align large pages in PFN space. Document this.
> 
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
> 
> --- a/xen/include/public/elfnote.h
> +++ b/xen/include/public/elfnote.h
> @@ -173,7 +173,9 @@
>   * The (non-default) location the initial phys-to-machine map should be
>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>   * The kernel must be prepared for this mapping to be established using
> - * large pages, despite such otherwise not being available to guests.
> + * large pages, despite such otherwise not being available to guests. Note

Shouldn't the large page usage be limited to dom0?


Juergen

> + * that these large pages may be misaligned in PFN space (they'll obviously
> + * be aligned in MFN and virtual address spaces).
>   * The kernel must also be able to handle the page table pages used for
>   * this mapping not being accessible through the initial mapping.
>   * (Only x86-64 supports this at present.)
> 
> 
> 
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> https://lists.xen.org/xen-devel
>
Jan Beulich May 9, 2017, 3:06 p.m. UTC | #2
>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
> On 09/05/17 16:23, Jan Beulich wrote:
>> Since PV kernels can't use large pages anywa, when the init-P2M support
>> was added it was decided to keep the implementation simple and not
>> align large pages in PFN space. Document this.
>> 
>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>> 
>> --- a/xen/include/public/elfnote.h
>> +++ b/xen/include/public/elfnote.h
>> @@ -173,7 +173,9 @@
>>   * The (non-default) location the initial phys-to-machine map should be
>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>   * The kernel must be prepared for this mapping to be established using
>> - * large pages, despite such otherwise not being available to guests.
>> + * large pages, despite such otherwise not being available to guests. Note
> 
> Shouldn't the large page usage be limited to dom0?

Why? Even if the tools right now don't use large pages here, why
should we preclude them wanting to at some point?

Jan
Andrew Cooper May 9, 2017, 3:10 p.m. UTC | #3
On 09/05/17 15:23, Jan Beulich wrote:
> Since PV kernels can't use large pages anywa, when the init-P2M support

anyway

~Andrew

> was added it was decided to keep the implementation simple and not
> align large pages in PFN space. Document this.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>
> --- a/xen/include/public/elfnote.h
> +++ b/xen/include/public/elfnote.h
> @@ -173,7 +173,9 @@
>   * The (non-default) location the initial phys-to-machine map should be
>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>   * The kernel must be prepared for this mapping to be established using
> - * large pages, despite such otherwise not being available to guests.
> + * large pages, despite such otherwise not being available to guests. Note
> + * that these large pages may be misaligned in PFN space (they'll obviously
> + * be aligned in MFN and virtual address spaces).
>   * The kernel must also be able to handle the page table pages used for
>   * this mapping not being accessible through the initial mapping.
>   * (Only x86-64 supports this at present.)
>
>
>
Jan Beulich May 9, 2017, 3:23 p.m. UTC | #4
>>> On 09.05.17 at 17:10, <andrew.cooper3@citrix.com> wrote:
> On 09/05/17 15:23, Jan Beulich wrote:
>> Since PV kernels can't use large pages anywa, when the init-P2M support
> 
> anyway

Already fixed after Alan pointed this out. Do I need to send v2
because of this typo?

Jan
Jürgen Groß May 9, 2017, 3:25 p.m. UTC | #5
On 09/05/17 17:06, Jan Beulich wrote:
>>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
>> On 09/05/17 16:23, Jan Beulich wrote:
>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>>> was added it was decided to keep the implementation simple and not
>>> align large pages in PFN space. Document this.
>>>
>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>
>>> --- a/xen/include/public/elfnote.h
>>> +++ b/xen/include/public/elfnote.h
>>> @@ -173,7 +173,9 @@
>>>   * The (non-default) location the initial phys-to-machine map should be
>>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>>   * The kernel must be prepared for this mapping to be established using
>>> - * large pages, despite such otherwise not being available to guests.
>>> + * large pages, despite such otherwise not being available to guests. Note
>>
>> Shouldn't the large page usage be limited to dom0?
> 
> Why? Even if the tools right now don't use large pages here, why
> should we preclude them wanting to at some point?

Those could be of temporary nature only in order not to break migration.
So the guest would be forced to split the big pages up anyway. Why
create them in the beginning then?


Juergen
Jan Beulich May 9, 2017, 3:32 p.m. UTC | #6
>>> On 09.05.17 at 17:25, <jgross@suse.com> wrote:
> On 09/05/17 17:06, Jan Beulich wrote:
>>>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
>>> On 09/05/17 16:23, Jan Beulich wrote:
>>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>>>> was added it was decided to keep the implementation simple and not
>>>> align large pages in PFN space. Document this.
>>>>
>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>
>>>> --- a/xen/include/public/elfnote.h
>>>> +++ b/xen/include/public/elfnote.h
>>>> @@ -173,7 +173,9 @@
>>>>   * The (non-default) location the initial phys-to-machine map should be
>>>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>>>   * The kernel must be prepared for this mapping to be established using
>>>> - * large pages, despite such otherwise not being available to guests.
>>>> + * large pages, despite such otherwise not being available to guests. Note
>>>
>>> Shouldn't the large page usage be limited to dom0?
>> 
>> Why? Even if the tools right now don't use large pages here, why
>> should we preclude them wanting to at some point?
> 
> Those could be of temporary nature only in order not to break migration.
> So the guest would be forced to split the big pages up anyway. Why
> create them in the beginning then?

As long as the migration stream doesn't represent them as 1Gb or
2Mb pages, I don't see how they would get in the way of migration.

Jan
Jürgen Groß May 9, 2017, 3:33 p.m. UTC | #7
On 09/05/17 17:32, Jan Beulich wrote:
>>>> On 09.05.17 at 17:25, <jgross@suse.com> wrote:
>> On 09/05/17 17:06, Jan Beulich wrote:
>>>>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
>>>> On 09/05/17 16:23, Jan Beulich wrote:
>>>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>>>>> was added it was decided to keep the implementation simple and not
>>>>> align large pages in PFN space. Document this.
>>>>>
>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>>
>>>>> --- a/xen/include/public/elfnote.h
>>>>> +++ b/xen/include/public/elfnote.h
>>>>> @@ -173,7 +173,9 @@
>>>>>   * The (non-default) location the initial phys-to-machine map should be
>>>>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>>>>   * The kernel must be prepared for this mapping to be established using
>>>>> - * large pages, despite such otherwise not being available to guests.
>>>>> + * large pages, despite such otherwise not being available to guests. Note
>>>>
>>>> Shouldn't the large page usage be limited to dom0?
>>>
>>> Why? Even if the tools right now don't use large pages here, why
>>> should we preclude them wanting to at some point?
>>
>> Those could be of temporary nature only in order not to break migration.
>> So the guest would be forced to split the big pages up anyway. Why
>> create them in the beginning then?
> 
> As long as the migration stream doesn't represent them as 1Gb or
> 2Mb pages, I don't see how they would get in the way of migration.

How would the receiving side allocate the additional page tables?


Juergen
Julien Grall May 9, 2017, 3:50 p.m. UTC | #8
Hi,

On 09/05/17 15:23, Jan Beulich wrote:
> Since PV kernels can't use large pages anywa, when the init-P2M support
> was added it was decided to keep the implementation simple and not
> align large pages in PFN space. Document this.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

This is documentation so:

Release-acked-by: Julien Grall <julien.grall@arm.com>

Cheers,

>
> --- a/xen/include/public/elfnote.h
> +++ b/xen/include/public/elfnote.h
> @@ -173,7 +173,9 @@
>   * The (non-default) location the initial phys-to-machine map should be
>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>   * The kernel must be prepared for this mapping to be established using
> - * large pages, despite such otherwise not being available to guests.
> + * large pages, despite such otherwise not being available to guests. Note
> + * that these large pages may be misaligned in PFN space (they'll obviously
> + * be aligned in MFN and virtual address spaces).
>   * The kernel must also be able to handle the page table pages used for
>   * this mapping not being accessible through the initial mapping.
>   * (Only x86-64 supports this at present.)
>
>
>
Jan Beulich May 9, 2017, 4:02 p.m. UTC | #9
>>> On 09.05.17 at 17:33, <jgross@suse.com> wrote:
> On 09/05/17 17:32, Jan Beulich wrote:
>>>>> On 09.05.17 at 17:25, <jgross@suse.com> wrote:
>>> On 09/05/17 17:06, Jan Beulich wrote:
>>>>>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
>>>>> On 09/05/17 16:23, Jan Beulich wrote:
>>>>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>>>>>> was added it was decided to keep the implementation simple and not
>>>>>> align large pages in PFN space. Document this.
>>>>>>
>>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>>>
>>>>>> --- a/xen/include/public/elfnote.h
>>>>>> +++ b/xen/include/public/elfnote.h
>>>>>> @@ -173,7 +173,9 @@
>>>>>>   * The (non-default) location the initial phys-to-machine map should be
>>>>>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>>>>>   * The kernel must be prepared for this mapping to be established using
>>>>>> - * large pages, despite such otherwise not being available to guests.
>>>>>> + * large pages, despite such otherwise not being available to guests. Note
>>>>>
>>>>> Shouldn't the large page usage be limited to dom0?
>>>>
>>>> Why? Even if the tools right now don't use large pages here, why
>>>> should we preclude them wanting to at some point?
>>>
>>> Those could be of temporary nature only in order not to break migration.
>>> So the guest would be forced to split the big pages up anyway. Why
>>> create them in the beginning then?
>> 
>> As long as the migration stream doesn't represent them as 1Gb or
>> 2Mb pages, I don't see how they would get in the way of migration.
> 
> How would the receiving side allocate the additional page tables?

Oh, indeed. Yet still, guests not intended to be migrated could be
built that way. I don't think we should allow kernel side relaxation
here.

Jan
Andrew Cooper May 11, 2017, 1:06 p.m. UTC | #10
On 09/05/17 17:02, Jan Beulich wrote:
>>>> On 09.05.17 at 17:33, <jgross@suse.com> wrote:
>> On 09/05/17 17:32, Jan Beulich wrote:
>>>>>> On 09.05.17 at 17:25, <jgross@suse.com> wrote:
>>>> On 09/05/17 17:06, Jan Beulich wrote:
>>>>>>>> On 09.05.17 at 16:36, <jgross@suse.com> wrote:
>>>>>> On 09/05/17 16:23, Jan Beulich wrote:
>>>>>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>>>>>>> was added it was decided to keep the implementation simple and not
>>>>>>> align large pages in PFN space. Document this.
>>>>>>>
>>>>>>> Signed-off-by: Jan Beulich <jbeulich@suse.com>
>>>>>>>
>>>>>>> --- a/xen/include/public/elfnote.h
>>>>>>> +++ b/xen/include/public/elfnote.h
>>>>>>> @@ -173,7 +173,9 @@
>>>>>>>   * The (non-default) location the initial phys-to-machine map should be
>>>>>>>   * placed at by the hypervisor (Dom0) or the tools (DomU).
>>>>>>>   * The kernel must be prepared for this mapping to be established using
>>>>>>> - * large pages, despite such otherwise not being available to guests.
>>>>>>> + * large pages, despite such otherwise not being available to guests. Note
>>>>>> Shouldn't the large page usage be limited to dom0?
>>>>> Why? Even if the tools right now don't use large pages here, why
>>>>> should we preclude them wanting to at some point?
>>>> Those could be of temporary nature only in order not to break migration.
>>>> So the guest would be forced to split the big pages up anyway. Why
>>>> create them in the beginning then?
>>> As long as the migration stream doesn't represent them as 1Gb or
>>> 2Mb pages, I don't see how they would get in the way of migration.
>> How would the receiving side allocate the additional page tables?
> Oh, indeed. Yet still, guests not intended to be migrated could be
> built that way. I don't think we should allow kernel side relaxation
> here.

The save side of PV migrate will cleanly abort if it finds any
superpages, precisely because we have no idea whether the destination
can allocate the frames.

~Andrew
Andrew Cooper May 11, 2017, 1:06 p.m. UTC | #11
On 09/05/17 16:23, Jan Beulich wrote:
>>>> On 09.05.17 at 17:10, <andrew.cooper3@citrix.com> wrote:
>> On 09/05/17 15:23, Jan Beulich wrote:
>>> Since PV kernels can't use large pages anywa, when the init-P2M support
>> anyway
> Already fixed after Alan pointed this out. Do I need to send v2
> because of this typo?

No.  Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>
diff mbox

Patch

--- a/xen/include/public/elfnote.h
+++ b/xen/include/public/elfnote.h
@@ -173,7 +173,9 @@ 
  * The (non-default) location the initial phys-to-machine map should be
  * placed at by the hypervisor (Dom0) or the tools (DomU).
  * The kernel must be prepared for this mapping to be established using
- * large pages, despite such otherwise not being available to guests.
+ * large pages, despite such otherwise not being available to guests. Note
+ * that these large pages may be misaligned in PFN space (they'll obviously
+ * be aligned in MFN and virtual address spaces).
  * The kernel must also be able to handle the page table pages used for
  * this mapping not being accessible through the initial mapping.
  * (Only x86-64 supports this at present.)