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

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 wrote: > + case KVM_S390_KEYOP_SSKE: > + if (!(vma->vm_flags & (VM_WRITE | VM_MAYWRITE))) { > + r = -EACCES; > + break; > + } Unfortunately I just realized while discussing with He

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 som

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 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 Fro

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 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) > +{ > + struct vm_

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 ar

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 t

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 ar

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 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 ar