Re: [patch] do_no_pfn handler

From: Linus Torvalds
Date: Tue Apr 11 2006 - 11:11:06 EST




On Tue, 11 Apr 2006, Jes Sorensen wrote:
>
> You mentioned earlier that you preferred an alternative approach, do
> you still feel that given the additional interest from other Bjorn and
> Carsten? If this is still the case, I'd love to get some guidance as
> to what that should be.

I'm still pretty unhappy with this. It's pretty much designed to screw up
the system by letting the driver do random things that make little or no
sense from a VM standpoint.

The

BUG_ON(!(vma->vm_flags & VM_PFNMAP));

certainly helps, but it still leaves the window open for other problems.

At the very least, it would also need a

BUG_ON(is_cow_mapping(vma->vm_flags));

(or at least make it return VM_FAULT_SIGBUS). Because a COW mapping _will_
confuse the VM and cause it to do random bad things in vm_normal_page().

It also assumes that a negative pfn is ok as an error return, but maybe
that's fine. I can't think of any architecture that uses all bits of the
PFN (x86 with PAE can have a full 32-bit PFN, but I don't think any actual
CPU supports 48 bits of physical addressing?). Something to think about.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/