WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ia64-devel

Re: [Xen-ia64-devel] Protection key support for PV domains

To: Isaku Yamahata <yamahata@xxxxxxxxxxxxx>
Subject: Re: [Xen-ia64-devel] Protection key support for PV domains
From: Dietmar Hahn <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Jul 2007 10:03:30 +0200
Cc: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 13 Jul 2007 01:01:11 -0700
Domainkey-signature: s=s768; d=fujitsu-siemens.com; c=nofws; q=dns; b=FlYW6rbYegKwseAdJfp4mVKzsyh2UOwkJVquzU9oNLEMs2A5nGW2SZkrys/t6Gj6TmRM4mJsoQwvj13DcpZbP8q281NaiUEfJtWpSKUtRq0p+JPotzFvJvPp5YoVIx2t;
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <20070713041107.GD2129%yamahata@xxxxxxxxxxxxx>
List-help: <mailto:xen-ia64-devel-request@lists.xensource.com?subject=help>
List-id: Discussion of the ia64 port of Xen <xen-ia64-devel.lists.xensource.com>
List-post: <mailto:xen-ia64-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ia64-devel>, <mailto:xen-ia64-devel-request@lists.xensource.com?subject=unsubscribe>
References: <200707111552.15844.dietmar.hahn@xxxxxxxxxxxxxxxxxxx> <20070713041107.GD2129%yamahata@xxxxxxxxxxxxx>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: KMail/1.9.6
Hi Isaku,

many thanks for your comments, see below ...

Am Freitag, 13. Juli 2007 schrieb Isaku Yamahata:
> On Wed, Jul 11, 2007 at 03:52:15PM +0200, Dietmar Hahn wrote:
> > diff -r 87b0b6a08dbd -r 44ccb8aa58cc xen/include/public/arch-ia64.h
> > --- a/xen/include/public/arch-ia64.h        Mon Jul  9 09:22:58 2007 -0600
> > +++ b/xen/include/public/arch-ia64.h        Wed Jul 11 15:37:09 2007 +0200
> > @@ -236,7 +236,9 @@ struct mapped_regs {
> >              int banknum; // 0 or 1, which virtual register bank is
> > active unsigned long rrs[8]; // region registers
> >              unsigned long krs[8]; // kernel registers
> > +#if !defined(CONFIG_XEN_IA64_USE_PKR)
> >              unsigned long pkrs[8]; // protection key registers
> > +#endif
> >              unsigned long tmp[8]; // temp registers (e.g. for
> > hyperprivops) };
> >      };
>
> struct mapped_regs is a part of ABI beween hypervisor and guest os
> so that the layout shouldn't be changed depending on configuration.

I had to remove this '#if !defined ...' I did this only for me to avoid 
confusion (and maybe wrong usage) because of the same name in mapped_regs and 
arch_vcpu.

> Since there is no user of pkrs currently, eliminating pkrs[8]; or
> replacing pkrs[8];tmp[8]; with tmp[16]; or somethine like that
> would be fine.

>
> > A later step would be:
> > 8. extend the hyperprivops with setting protection key registers.
>
> I'm not sure how you want to update pkrs and its performance
> impact, though.
> If you want to paravirtualize pkrs related operation, would it be
> convinient to place pkrs[] in struct mapped_regs?
> Then guest OS can read/write the value without vmm intervention.
> Off course after updating those values it is necessary to call
> VMM to commit it.

Maybe this would be a better solution.
But before doing this we should discuss the following problem.
If the domU writes 2 or more pkr's and than calls the hypervisor to update the 
cpu-pkrs we have the problem, how do we handle the order of setting the 
cpu-pkr's (the setting of a pkr invalidates the other pkr's with the same key 
but maybe other access rights).
This problem is still unsolved with my current patch.
Should the domU knows what it is doing or should we implement the correct 
mechanism in the hypervisor?
Thanks.

Dietmar.

_______________________________________________
Xen-ia64-devel mailing list
Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ia64-devel