From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Jared Hulbert" Subject: Re: [patch 4/6] xip: support non-struct page backed memory Date: Mon, 3 Mar 2008 07:59:15 -0800 Message-ID: <6934efce0803030759q3c9c84c5mfb45267d182c3e90@mail.gmail.com> References: <20080118045649.334391000@suse.de> <20080118045755.735923000@suse.de> <6934efce0803010014p2cc9a5edu5fee2029c0104a07@mail.gmail.com> <20080303052959.GB32555@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Linus Torvalds" , "Andrew Morton" , "Carsten Otte" , "Martin Schwidefsky" , "Heiko Carstens" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org To: "Nick Piggin" Return-path: Received: from wa-out-1112.google.com ([209.85.146.177]:25198 "EHLO wa-out-1112.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754794AbYCCP7R (ORCPT ); Mon, 3 Mar 2008 10:59:17 -0500 Received: by wa-out-1112.google.com with SMTP id v27so99753wah.23 for ; Mon, 03 Mar 2008 07:59:15 -0800 (PST) In-Reply-To: <20080303052959.GB32555@wotan.suse.de> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: > OK right... one problem is that we need an address for the kernel to > manipulate the memory with, but we also need a pfn to insert into user > page tables. So I like your last suggestion, but I think we always > need both address and pfn. Right I forgot about the xip_file_read() path. I like to use UML kernels with the file-to-iomem interface for testing. I forget how UML kernels deal with physical address like this. I remember there are some caveats. I'll look into it. But I think I can do for UML: *kaddr = (void *)(start_virt_addr + offset); *pfn = virt_to_phys(*kaddr) >> PAGE_SHIFT; And the ARM + MTD I can do: *kaddr = (void *)(start_virt_addr + offset); *pfn = (start_phys_addr + offset) >> PAGE_SHIFT; > This should work for you too? I think so. But like Carsten I'd prefer a virtual only solution.