>> >>> + * -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