Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Carsten Otte
New version below. Changes: - __pmdp_for_addr and ptep_for_addr now take a vma as argument - check if a vma exists has moved to gmap_fault and kvm_s390_keyop - kvm_s390_keyop verifies that a vma is writable so that it's safe to set the SWC bit Subject: [PATCH] kvm-s390: storage key interface

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Heiko Carstens
On Thu, Dec 15, 2011 at 11:28:03AM +0100, Carsten Otte wrote: New version below. Changes: - __pmdp_for_addr and ptep_for_addr now take a vma as argument - check if a vma exists has moved to gmap_fault and kvm_s390_keyop - kvm_s390_keyop verifies that a vma is writable so that it's safe to

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Christian Borntraeger
On 15/12/11 17:11, Heiko Carstens wrote: Why again is this needed? Or put in other words: what prevents a guest to change the storage key contents via sske of a page that is mapped read-only into the guest address space? As far as I can see: nothing. Interestingly I could -in theory- do some

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Martin Schwidefsky
On Thu, 15 Dec 2011 11:28:03 +0100 Carsten Otte co...@de.ibm.com wrote: + case KVM_S390_KEYOP_SSKE: + if (!(vma-vm_flags (VM_WRITE | VM_MAYWRITE))) { + r = -EACCES; + break; + } Unfortunately I just realized while

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-15 Thread Heiko Carstens
On Thu, Dec 15, 2011 at 05:49:19PM +0100, Christian Borntraeger wrote: On 15/12/11 17:11, Heiko Carstens wrote: Why again is this needed? Or put in other words: what prevents a guest to change the storage key contents via sske of a page that is mapped read-only into the guest address space?

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-14 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-12 Thread Martin Schwidefsky
On Sat, 10 Dec 2011 13:35:39 +0100 Carsten Otte co...@de.ibm.com wrote: --- a/arch/s390/mm/pgtable.c +++ b/arch/s390/mm/pgtable.c @@ -393,6 +393,33 @@ out_unmap: } EXPORT_SYMBOL_GPL(gmap_map_segment); +static pmd_t *__pmdp_for_addr(struct mm_struct *mm, unsigned long addr) +{ +

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-11 Thread Heiko Carstens
On Sat, Dec 10, 2011 at 01:35:39PM +0100, Carsten Otte wrote: This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-10 Thread Carsten Otte
On 09.12.2011 14:46, heica...@linux.vnet.ibm.com wrote: On Fri, Dec 09, 2011 at 01:49:35PM +0100, Carsten Otte wrote: This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-10 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-09 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-09 Thread Heiko Carstens
On Fri, Dec 09, 2011 at 12:23:36PM +0100, Carsten Otte wrote: This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-09 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-09 Thread Carsten Otte
On 09.12.2011 13:52, Joachim von Buttlar wrote: Shouldn't it be: page_set_storage_key(pte_val(*ptep), skey | _PAGE_CHANGED, 1); +/* avoid race clobbering changed bit */ +pte_val(*ptep)

Re: [patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-09 Thread Heiko Carstens
On Fri, Dec 09, 2011 at 01:49:35PM +0100, Carsten Otte wrote: This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-08 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.

[patch 10/12] [PATCH] kvm-s390: storage key interface

2011-12-01 Thread Carsten Otte
This patch introduces an interface to access the guest visible storage keys. It supports three operations that model the behavior that SSKE/ISKE/RRBE instructions would have if they were issued by the guest. These instructions are all documented in the z architecture principles of operation book.