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] Faulty protection key handling

To: "Dietmar Hahn" <dietmar.hahn@xxxxxxxxxxxxxxxxxxx>, <xen-ia64-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-ia64-devel] Faulty protection key handling
From: "Xu, Anthony" <anthony.xu@xxxxxxxxx>
Date: Thu, 26 Apr 2007 09:46:35 +0800
Delivery-date: Wed, 25 Apr 2007 18:45:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200704251536.20806.dietmar.hahn@xxxxxxxxxxxxxxxxxxx>
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>
Sender: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AceHPsfsm1uJBlcFRC2N3bDjVpsmpwAZA3xQ
Thread-topic: [Xen-ia64-devel] Faulty protection key handling
>By the way, are there any thoughts about adding emulation of protection keys
>to the hypervisor? I know, whether the hypervisor nor dom0-linux are using
>this but we need this stuff. I would try to write a proposal and add using
>protection keys in the minios for tests. What do you think?

Hi Dietmar,
Frankly, due to there are no OS using protection key, I didn't think about it.
While from architecture view, HVM should support protection key.

Can you provide more information about why you need to use protection key?

There are at least following things we need to do to emulate protection key IMO.
1. Support long format VHPT. 
        protection key is only used by long format VHPT, so we need to support 
long format VHPT, as I know we already have some logic handling long format 
VHPT, 
I think we did fully support long format VHPT now.

2. Emulate protection key.
        1. Emulate protection key read/write
        2. Emulate psr.pk for guest.
        3. Reserve some protection key register for hyperivsor.
        4. switch protection key when switch between guest and hypervisor.
        5. switch protection key when VCPU witch happens.



Anthony




>-----Original Message-----
>From: xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx
>[mailto:xen-ia64-devel-bounces@xxxxxxxxxxxxxxxxxxx] On Behalf Of Dietmar Hahn
>Sent: 2007年4月25日 21:36
>To: xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
>Subject: [Xen-ia64-devel] Faulty protection key handling
>
>Hi,
>
>I played around with the minios and protection key bit in the psr register and
>got 3 different behaviors.
>1.
>mov cr.ipsr = ...  (pk bit set)
>...
>rfi
>
>leads to a hard reboot of the hypervisor. I looked at the rfi emulation and
>found, that the pk bit remains untouched. So the protection key stuff is
>switched on and the hypervisor and dom0 get some problems.
>This seems to be a real critical case. You can test this simply with the
>minios by changing line 130 in minios/arch/ia64/ia64.S to
>movl   r16=STARTUP_PSR | IA64_PSR_PK.
>
>2.
>mov r2 = ...  (pk bit set)
>;;
>mov psr.l = r2
>
>Nothing happend. In the source the pk bit is ignored.
>
>3.
>ssm psr.pk
>
>leads to a crash of the domU with illegal op which seems to be the right
>thing.
>
>I think fixes are needed here for case 1 and 2. If the pk bit is set the
>domain should be paniced.
>
>By the way, are there any thoughts about adding emulation of protection keys
>to the hypervisor? I know, whether the hypervisor nor dom0-linux are using
>this but we need this stuff. I would try to write a proposal and add using
>protection keys in the minios for tests. What do you think?
>Thanks.
>
>Dietmar.
>
>_______________________________________________
>Xen-ia64-devel mailing list
>Xen-ia64-devel@xxxxxxxxxxxxxxxxxxx
>http://lists.xensource.com/xen-ia64-devel

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