Re: [Xen-devel] Page Table Entry Modifications

2015-09-28 Thread Gohar Irfan
A clarification:
I also want to COPY the contents of the frames, so there will be no memory
corruption. In essence, only the frame numbers will be changed.

My other question, which is sort of a follow up to this, may be relevant:

"Given two GMFN in shadow paging (HVM) is there a way to swap their
contents? Let's say I have GMFN x and GMFN y, I want to put the contents of
x in y and the contents of y in x. "

Thanks a lot!

On Sun, Sep 27, 2015 at 9:04 PM Gohar Irfan  wrote:

> This might not seem useful or anything, but this is a part of an
> experiment so I will describe what I'm trying to do:
>
> Divide the memory into two equal halves and call them A and B.
> Let's say region A has 10 pages, from page numbers 1 to 10. Region B has
> 10 pages from page numbers 11 to 20 (hypothetical, of course.)
> When a page from region B (page number 11 to 20) is being accessed, say
> page 15, then swap the contents of page 15 with the contents of one of the
> pages from region A, say page 5.
> To achieve this, I need some help. In the default scenario, page 15 points
> to frame X and page 5 points to frame Y. I want to make page 15 point to
> frame Y and page 5 to frame X of the memory.
>
> I want to run this experiment and find the degradation in performance for
> a project.
> If some portion of this seems vague, I can explain. But I urgently need
> help on how to achieve this.
>
> My understanding is that it can be done in the page fault handler of
> shadow page tables. I have mentioned the relevant file and function earlier
> in this thread.
>
> Thanks a lot!
>
> On Sun, Sep 27, 2015 at 7:57 PM Meng Xu  wrote:
>
>> 2015-09-23 4:42 GMT-04:00 Gohar Irfan :
>> >
>> > It is for a project, I'm trying to experiment with a couple of things.
>>
>> Well, this is too general... Everything can be a project. People tries
>> to know what exact things you want to achieve so that they can figure
>> out if you are heading the correct direction.
>>
>> Meng
>>
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Page Table Entry Modifications

2015-09-27 Thread Gohar Irfan
This might not seem useful or anything, but this is a part of an experiment
so I will describe what I'm trying to do:

Divide the memory into two equal halves and call them A and B.
Let's say region A has 10 pages, from page numbers 1 to 10. Region B has 10
pages from page numbers 11 to 20 (hypothetical, of course.)
When a page from region B (page number 11 to 20) is being accessed, say
page 15, then swap the contents of page 15 with the contents of one of the
pages from region A, say page 5.
To achieve this, I need some help. In the default scenario, page 15 points
to frame X and page 5 points to frame Y. I want to make page 15 point to
frame Y and page 5 to frame X of the memory.

I want to run this experiment and find the degradation in performance for a
project.
If some portion of this seems vague, I can explain. But I urgently need
help on how to achieve this.

My understanding is that it can be done in the page fault handler of shadow
page tables. I have mentioned the relevant file and function earlier in
this thread.

Thanks a lot!

On Sun, Sep 27, 2015 at 7:57 PM Meng Xu  wrote:

> 2015-09-23 4:42 GMT-04:00 Gohar Irfan :
> >
> > It is for a project, I'm trying to experiment with a couple of things.
>
> Well, this is too general... Everything can be a project. People tries
> to know what exact things you want to achieve so that they can figure
> out if you are heading the correct direction.
>
> Meng
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Page Table Entry Modifications

2015-09-27 Thread Meng Xu
2015-09-23 4:42 GMT-04:00 Gohar Irfan :
>
> It is for a project, I'm trying to experiment with a couple of things.

Well, this is too general... Everything can be a project. People tries
to know what exact things you want to achieve so that they can figure
out if you are heading the correct direction.

Meng

___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Page Table Entry Modifications

2015-09-27 Thread Gohar Irfan
Could someone please help me with this? It's really important and urgent.

Thanks a lot!

On Wed, Sep 23, 2015 at 1:42 PM Gohar Irfan  wrote:

> It is for a project, I'm trying to experiment with a couple of things.
>
> Could you please guide me how this could be achieved? Some relevant chunks
> of code, perhaps?
>
> Thanks!
>
> On Wed, Sep 23, 2015 at 1:35 PM Andrew Cooper 
> wrote:
>
>> On 22/09/15 20:35, Gohar Irfan wrote:
>>
>> Hi All,
>>
>> I want to know if, in the case of HVM (shadow page tables), we can change
>> the machine frame number pointed to by a page table entry?
>>
>>
>> Yes - Xen is able to change the mfn in a pte.
>>
>>
>> An overly simplified example would be: let's say I have page number 10
>> that is pointing to machine frame number 10, but I would like it to point
>> to machine frame number 1?
>>
>>
>> Yes - that is in theory possible.
>>
>>
>> Can this be achieved inside the "sh_page_fault" function inside
>> "xen/arch/x86/mm/shadow/multi.c" as this seems like a relevant place for
>> this modification to me.
>>
>>
>> What are you trying to achieve?  Modifications such as what you request
>> are possible, but you are exceedingly likely to end up with memory
>> corruption as a result.
>>
>>
>> ~Andrew
>>
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Page Table Entry Modifications

2015-09-23 Thread Gohar Irfan
It is for a project, I'm trying to experiment with a couple of things.

Could you please guide me how this could be achieved? Some relevant chunks
of code, perhaps?

Thanks!

On Wed, Sep 23, 2015 at 1:35 PM Andrew Cooper 
wrote:

> On 22/09/15 20:35, Gohar Irfan wrote:
>
> Hi All,
>
> I want to know if, in the case of HVM (shadow page tables), we can change
> the machine frame number pointed to by a page table entry?
>
>
> Yes - Xen is able to change the mfn in a pte.
>
>
> An overly simplified example would be: let's say I have page number 10
> that is pointing to machine frame number 10, but I would like it to point
> to machine frame number 1?
>
>
> Yes - that is in theory possible.
>
>
> Can this be achieved inside the "sh_page_fault" function inside
> "xen/arch/x86/mm/shadow/multi.c" as this seems like a relevant place for
> this modification to me.
>
>
> What are you trying to achieve?  Modifications such as what you request
> are possible, but you are exceedingly likely to end up with memory
> corruption as a result.
>
>
> ~Andrew
>
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel


Re: [Xen-devel] Page Table Entry Modifications

2015-09-23 Thread Andrew Cooper

On 22/09/15 20:35, Gohar Irfan wrote:

Hi All,

I want to know if, in the case of HVM (shadow page tables), we can 
change the machine frame number pointed to by a page table entry?


Yes - Xen is able to change the mfn in a pte.

An overly simplified example would be: let's say I have page number 10 
that is pointing to machine frame number 10, but I would like it to 
point to machine frame number 1?


Yes - that is in theory possible.

Can this be achieved inside the "sh_page_fault" function inside 
"xen/arch/x86/mm/shadow/multi.c" as this seems like a relevant place 
for this modification to me.


What are you trying to achieve?  Modifications such as what you request 
are possible, but you are exceedingly likely to end up with memory 
corruption as a result.


~Andrew
___
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel