[loongarch oddities] Re: [RFC][PATCHSET] VM_FAULT_RETRY fixes

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

 



	Speaking of really weird stuff, on loongarch we have
this:
        /*
         * We fault-in kernel-space virtual memory on-demand. The  
         * 'reference' page table is init_mm.pgd.
         *
         * NOTE! We MUST NOT take any locks for this case. We may
         * be in an interrupt or a critical region, and should
         * only copy the information from the master page table,
         * nothing more.
         */
        if (address & __UA_LIMIT) {
                if (!user_mode(regs))
                        no_context(regs, address);
                else   
                        do_sigsegv(regs, write, address, si_code);
                return;
        }

That looks as if it had started off as usual vmalloc page tables
propagation in #PF, but... it obviously does nothing of that sort.
What's going on there and why do we even bother?  After all,
we'd better have no vma above that address, so the normal logics
would seem to be fine with that case...

Another really weird part there is
        /*
         * If we're in an interrupt or have no user
         * context, we must not take the fault..
         */
        if (faulthandler_disabled() || !mm) {
                do_sigsegv(regs, write, address, si_code);
                return;
        }
There should be no way to have this condition for userland
page fault and do_sigsegv() is starting with
        /* Kernel mode? Handle exceptions or die */
        if (!user_mode(regs)) {
                no_context(regs, address);  
                return;
        }
	<force SIGSEGV>
What's wrong with just
        if (faulthandler_disabled() || !mm) {
		no_context(regs, address);
		return;
	}
Am I missing something subtle here?



[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux