public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: Jeff Dike <jdike@addtoit.com>
Cc: linux-kernel@vger.kernel.org,
	user-mode-linux-devel@lists.sourceforge.net
Subject: Re: [patch 1/3] uml: share page bits handling between 2 and 3 level pagetables
Date: Wed, 10 Aug 2005 21:37:28 +0200	[thread overview]
Message-ID: <200508102137.28414.blaisorblade@yahoo.it> (raw)
In-Reply-To: <20050730160218.GB4585@ccure.user-mode-linux.org>

[-- Attachment #1: Type: text/plain, Size: 1893 bytes --]

On Saturday 30 July 2005 18:02, Jeff Dike wrote:
> On Thu, Jul 28, 2005 at 08:56:53PM +0200, blaisorblade@yahoo.it wrote:
> > As obvious, a "core code nice cleanup" is not a "stability-friendly
> > patch" so usual care applies.
>
> These look reasonable, as they are what we discussed in Ottawa.
>
> I'll put them in my tree and see if I see any problems.  I would
> suggest sending these in early after 2.6.13 if they seem OK.
Just noticed: you can drop them (except the first, which is a nice cleanup).

set_pte handles that, and include/asm-generic/pgtable.h uses coherently 
set_pte_at. I've checked UML by examining "grep pte", and either mk_pte or 
set_pte are used.

Exceptions: fixaddr_user_init (but that should be ok as we shouldn't map it 
actually), pte_modify() (which handles that only for present pages).

But pte_modify is used with set_pte, so probably we could as well drop that 
handling.

Also look, on the "set_pte" theme, at the attached patch. I realized this when 
I needed those lines to work - I was getting a segfault loop.

After using set_pte(), things worked. I have now an almost perfectly working 
implementation of remap_file_pages with protection support.
There will probably be some other things to update, like swapping locations, 
but I can't get this kernel to fail (it's easier to find bugs in the 
test-program, it grew quite complex).

And, I'd like to note, original Ingo's version *DID NOT* work properly (it was 
not safe against swapout, it didn't allow write-protecting a page 
successfully).

I'm going to clean up the code and write changelogs, to send then the patches 
for -mm (hoping the page fault scalability patches don't get in the way).
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

[-- Attachment #2: uml-avoid-already-done-dirtying.patch --]
[-- Type: text/x-diff, Size: 1068 bytes --]


From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>

The PTE returned from handle_mm_fault is already marked as dirty and accessed
if needed.
Also, since this is not set with set_pte() (which sets NEWPAGE and NEWPROT as
needed), this wouldn't work anyway.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---

 linux-2.6.git-paolo/arch/um/kernel/trap_kern.c |    3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN arch/um/kernel/trap_kern.c~uml-avoid-already-done-dirtying arch/um/kernel/trap_kern.c
--- linux-2.6.git/arch/um/kernel/trap_kern.c~uml-avoid-already-done-dirtying	2005-08-10 19:21:13.000000000 +0200
+++ linux-2.6.git-paolo/arch/um/kernel/trap_kern.c	2005-08-10 19:21:13.000000000 +0200
@@ -83,8 +83,7 @@ survive:
 		pte = pte_offset_kernel(pmd, address);
 	} while(!pte_present(*pte));
 	err = 0;
-	*pte = pte_mkyoung(*pte);
-	if(pte_write(*pte)) *pte = pte_mkdirty(*pte);
+	WARN_ON(!pte_young(*pte) || pte_write(*pte) && !pte_dirty(*pte));
 	flush_tlb_page(vma, address);
 out:
 	up_read(&mm->mmap_sem);
_

  parent reply	other threads:[~2005-08-12 13:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28 18:56 [patch 1/3] uml: share page bits handling between 2 and 3 level pagetables blaisorblade
2005-07-30 16:02 ` Jeff Dike
2005-07-30 18:54   ` Blaisorblade
2005-08-10 19:37   ` Blaisorblade [this message]
2005-08-12 17:05     ` Jeff Dike
2005-09-02 20:17     ` Jeff Dike
2005-09-03  5:08       ` Hugh Dickins
2005-09-04 11:33       ` [uml-devel] " Blaisorblade
2005-08-12 18:37   ` Blaisorblade

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200508102137.28414.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=jdike@addtoit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox