Re: [PATCH v7 04/12] s390/mm: Add gmap pmd notification bit setting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>
>>> + * -EAGAIN if a fixup is needed
>>> + * -EINVAL if unsupported notifier bits have been specified
>>> + *
>>> + * Expected to be called with sg->mm->mmap_sem in read and
>>> + * guest_table_lock held.
>>> + */
>>> +static int gmap_protect_pmd(struct gmap *gmap, unsigned long gaddr,
>>> +			    pmd_t *pmdp, int prot, unsigned long
>>> bits) +{
>>> +	int pmd_i = pmd_val(*pmdp) & _SEGMENT_ENTRY_INVALID;
>>> +	int pmd_p = pmd_val(*pmdp) & _SEGMENT_ENTRY_PROTECT;
>>> +
>>> +	/* Fixup needed */
>>> +	if ((pmd_i && (prot != PROT_NONE)) || (pmd_p && (prot ==
>>> PROT_WRITE)))
>>> +		return -EAGAIN;  
>>
>> You should also return -EINVAL in case !PROT_WRITE is defined, as we
>> only support PROT_WRITE (we don't perform any protection!)
> 
> So, you want a temporary check that I have to remove two patches later?

Just stumbled over that myself in the other patch, no you can leave it
out, maybe add a comment to the patch description.


-- 

Thanks,

David / dhildenb



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux