* __vmap multiple times same mfn
@ 2017-02-28 19:50 Oleksandr Andrushchenko
2017-02-28 20:51 ` Andrew Cooper
0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Andrushchenko @ 2017-02-28 19:50 UTC (permalink / raw)
To: Xen-devel
Hi, all!
I have a use-case when I may need to call __vmap for kernel provided
IPAs (read MFNs)
which may not be PAGE_SIZE aligned etc.
The question is if it is safe to call __vmap multiple times for
different IPAs
sharing the same page (mfn), e.g. map something like 6ca00 0080 and
6ca00 00a0?
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __vmap multiple times same mfn
2017-02-28 19:50 __vmap multiple times same mfn Oleksandr Andrushchenko
@ 2017-02-28 20:51 ` Andrew Cooper
2017-03-01 5:39 ` Oleksandr Andrushchenko
0 siblings, 1 reply; 5+ messages in thread
From: Andrew Cooper @ 2017-02-28 20:51 UTC (permalink / raw)
To: Oleksandr Andrushchenko, Xen-devel
On 28/02/17 19:50, Oleksandr Andrushchenko wrote:
> Hi, all!
>
> I have a use-case when I may need to call __vmap for kernel provided
> IPAs (read MFNs)
>
> which may not be PAGE_SIZE aligned etc.
>
> The question is if it is safe to call __vmap multiple times for
> different IPAs
>
> sharing the same page (mfn), e.g. map something like 6ca00 0080 and
> 6ca00 00a0?
What are you trying to do?
You specifically can use vmap to make non-contiguous MFNs end up
contiguous in virtual address space.
The mappings themselves are of course on page boundaries, so you can't
make a non-page-aligned thing appear aligned.
~Andrew
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __vmap multiple times same mfn
2017-02-28 20:51 ` Andrew Cooper
@ 2017-03-01 5:39 ` Oleksandr Andrushchenko
2017-03-01 8:22 ` Jan Beulich
0 siblings, 1 reply; 5+ messages in thread
From: Oleksandr Andrushchenko @ 2017-03-01 5:39 UTC (permalink / raw)
To: Andrew Cooper, Xen-devel
On 02/28/2017 10:51 PM, Andrew Cooper wrote:
> On 28/02/17 19:50, Oleksandr Andrushchenko wrote:
>> Hi, all!
>>
>> I have a use-case when I may need to call __vmap for kernel provided
>> IPAs (read MFNs)
>>
>> which may not be PAGE_SIZE aligned etc.
>>
>> The question is if it is safe to call __vmap multiple times for
>> different IPAs
>>
>> sharing the same page (mfn), e.g. map something like 6ca00 0080 and
>> 6ca00 00a0?
> What are you trying to do?
Well, the use-case is as follows: say, there are 2 structures I want to
access
(S1 and S2), S1 occupying pages A'-B-C' and S2 in pages C'-D'
(I mark with apostrophe here partially occupied pages, e.g. page A is
partially occupied and B is fully used by S1)
No guarantee how pages A:D are located in memory
So, for that reason I want to __vmap A-B-C to access S1 and C-D to access S2
> You specifically can use vmap to make non-contiguous MFNs end up
> contiguous in virtual address space.
this is what I want - see above
> The mappings themselves are of course on page boundaries,
Of course I have no intention to *map* on non page boundary,
but I want to *access* non page aligned data
> so you can't
> make a non-page-aligned thing appear aligned.
I am not trying to align, I use void* from __vmap
and add offset to S1/S2 start in the example above, e.g.
S1 = __vmap(A,B,C) + offset_in_page(S1)
> ~Andrew
So, the question remains: if I can __vmap page C for S1 and also
__vmap it for S2
Thank you,
Oleksandr
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __vmap multiple times same mfn
2017-03-01 5:39 ` Oleksandr Andrushchenko
@ 2017-03-01 8:22 ` Jan Beulich
2017-03-01 8:25 ` Oleksandr Andrushchenko
0 siblings, 1 reply; 5+ messages in thread
From: Jan Beulich @ 2017-03-01 8:22 UTC (permalink / raw)
To: Oleksandr Andrushchenko; +Cc: Andrew Cooper, Xen-devel
>>> On 01.03.17 at 06:39, <andr2000@gmail.com> wrote:
> On 02/28/2017 10:51 PM, Andrew Cooper wrote:
>> On 28/02/17 19:50, Oleksandr Andrushchenko wrote:
>>> I have a use-case when I may need to call __vmap for kernel provided
>>> IPAs (read MFNs)
>>>
>>> which may not be PAGE_SIZE aligned etc.
>>>
>>> The question is if it is safe to call __vmap multiple times for
>>> different IPAs
>>>
>>> sharing the same page (mfn), e.g. map something like 6ca00 0080 and
>>> 6ca00 00a0?
>> What are you trying to do?
> Well, the use-case is as follows: say, there are 2 structures I want to
> access
> (S1 and S2), S1 occupying pages A'-B-C' and S2 in pages C'-D'
> (I mark with apostrophe here partially occupied pages, e.g. page A is
> partially occupied and B is fully used by S1)
> No guarantee how pages A:D are located in memory
> So, for that reason I want to __vmap A-B-C to access S1 and C-D to access S2
I see no reason why two respective vmap() calls would collide
(provided the cacheability attributes of both mappings don't
conflict). Is there any particular reason why you suspect there
to be a restriction?
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: __vmap multiple times same mfn
2017-03-01 8:22 ` Jan Beulich
@ 2017-03-01 8:25 ` Oleksandr Andrushchenko
0 siblings, 0 replies; 5+ messages in thread
From: Oleksandr Andrushchenko @ 2017-03-01 8:25 UTC (permalink / raw)
To: Jan Beulich; +Cc: Andrew Cooper, Xen-devel
On 03/01/2017 10:22 AM, Jan Beulich wrote:
>>>> On 01.03.17 at 06:39, <andr2000@gmail.com> wrote:
>> On 02/28/2017 10:51 PM, Andrew Cooper wrote:
>>> On 28/02/17 19:50, Oleksandr Andrushchenko wrote:
>>>> I have a use-case when I may need to call __vmap for kernel provided
>>>> IPAs (read MFNs)
>>>>
>>>> which may not be PAGE_SIZE aligned etc.
>>>>
>>>> The question is if it is safe to call __vmap multiple times for
>>>> different IPAs
>>>>
>>>> sharing the same page (mfn), e.g. map something like 6ca00 0080 and
>>>> 6ca00 00a0?
>>> What are you trying to do?
>> Well, the use-case is as follows: say, there are 2 structures I want to
>> access
>> (S1 and S2), S1 occupying pages A'-B-C' and S2 in pages C'-D'
>> (I mark with apostrophe here partially occupied pages, e.g. page A is
>> partially occupied and B is fully used by S1)
>> No guarantee how pages A:D are located in memory
>> So, for that reason I want to __vmap A-B-C to access S1 and C-D to access S2
> I see no reason why two respective vmap() calls would collide
> (provided the cacheability attributes of both mappings don't
> conflict).
For all the mappings I use "PAGE_HYPERVISOR_NOCACHE, VMAP_DEFAULT",
so no problem here
> Is there any particular reason why you suspect there
> to be a restriction?
No, I have it working on ARM64, just want to be sure it is also
applicable for ARM32/x86
> Jan
>
Thank you
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-03-01 8:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-28 19:50 __vmap multiple times same mfn Oleksandr Andrushchenko
2017-02-28 20:51 ` Andrew Cooper
2017-03-01 5:39 ` Oleksandr Andrushchenko
2017-03-01 8:22 ` Jan Beulich
2017-03-01 8:25 ` Oleksandr Andrushchenko
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).