public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* cache_regs & decache_regs?
@ 2007-06-11  5:22 Jun Koi
       [not found] ` <fdaac4d50706102222i5d145682m795fdb8cc2ca9c4e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jun Koi @ 2007-06-11  5:22 UTC (permalink / raw)
  To: kvm-devel

Hi,

In kvm_setup_pio() we have code like this:

	kvm_arch_ops->cache_regs(vcpu);
	memcpy(vcpu->pio_data, &vcpu->regs[VCPU_REGS_RAX], 4);
	kvm_arch_ops->decache_regs(vcpu);

So what is the reason of saving RSP and RIP before the memcpy()
function, then recovering it right after that?

AFAICS, there nothing is change by the memcpy() function, so I cannot
figure it out why it is necessary to do that.

Many thanks,
Jun

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cache_regs & decache_regs?
       [not found] ` <fdaac4d50706102222i5d145682m795fdb8cc2ca9c4e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2007-06-12 23:18   ` Anthony Liguori
       [not found]     ` <466F29D4.6020903-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Anthony Liguori @ 2007-06-12 23:18 UTC (permalink / raw)
  To: Jun Koi; +Cc: kvm-devel

Jun Koi wrote:
> Hi,
>
> In kvm_setup_pio() we have code like this:
>
> 	kvm_arch_ops->cache_regs(vcpu);
> 	memcpy(vcpu->pio_data, &vcpu->regs[VCPU_REGS_RAX], 4);
> 	kvm_arch_ops->decache_regs(vcpu);
>
> So what is the reason of saving RSP and RIP before the memcpy()
> function, then recovering it right after that?
>
> AFAICS, there nothing is change by the memcpy() function, so I cannot
> figure it out why it is necessary to do that.
>   

In SVM, cache_regs() actually syncs RAX.

Regards,

Anthony Liguori

> Many thanks,
> Jun
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: cache_regs & decache_regs?
       [not found]     ` <466F29D4.6020903-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
@ 2007-06-13  3:12       ` Jun Koi
  0 siblings, 0 replies; 3+ messages in thread
From: Jun Koi @ 2007-06-13  3:12 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm-devel

On 6/13/07, Anthony Liguori <anthony-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org> wrote:
> Jun Koi wrote:
> > Hi,
> >
> > In kvm_setup_pio() we have code like this:
> >
> >       kvm_arch_ops->cache_regs(vcpu);
> >       memcpy(vcpu->pio_data, &vcpu->regs[VCPU_REGS_RAX], 4);
> >       kvm_arch_ops->decache_regs(vcpu);
> >
> > So what is the reason of saving RSP and RIP before the memcpy()
> > function, then recovering it right after that?
> >
> > AFAICS, there nothing is change by the memcpy() function, so I cannot
> > figure it out why it is necessary to do that.
> >
>
> In SVM, cache_regs() actually syncs RAX.
>

Anthony, I know that. But the main question is why decache_regs() is
called here.

And Avi told me that we can remove that unnecessary code.

Thanks,
Jun

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-06-13  3:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11  5:22 cache_regs & decache_regs? Jun Koi
     [not found] ` <fdaac4d50706102222i5d145682m795fdb8cc2ca9c4e-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2007-06-12 23:18   ` Anthony Liguori
     [not found]     ` <466F29D4.6020903-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-06-13  3:12       ` Jun Koi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox