mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bill Hawes <whawes@star.net>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: ganesh.sittampalam@magd.ox.ac.uk,
	"Stephen C. Tweedie" <sct@redhat.com>,
	Virtual Memory problem report list
	<linux-kernel@vger.rutgers.edu>,
	mingo@valerie.inf.elte.hu, Alan Cox <number6@the-village.bc.nu>,
	"David S. Miller" <davem@dm.cobaltmicro.com>
Subject: Re: Progress! was: Re: Yet more VM writable swap-cached pages
Date: Thu, 09 Jul 1998 22:18:27 -0400	[thread overview]
Message-ID: <35A579F3.68F549AF@star.net> (raw)
In-Reply-To: <Pine.LNX.3.96.980709182436.431F-100000@penguin.transmeta.com>

Linus Torvalds wrote:

> -extern inline pte_t pte_wrprotect(pte_t pte)   { pte_val(pte) &= ~_PAGE_RW; return pte; }
>  extern inline pte_t pte_rdprotect(pte_t pte)   { pte_val(pte) &= ~_PAGE_USER; return pte; }
>  extern inline pte_t pte_exprotect(pte_t pte)   { pte_val(pte) &= ~_PAGE_USER; return pte; }
>  extern inline pte_t pte_mkclean(pte_t pte)     { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
>  extern inline pte_t pte_mkold(pte_t pte)       { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
> -extern inline pte_t pte_mkwrite(pte_t pte)     { pte_val(pte) |= _PAGE_RW; return pte; }
>  extern inline pte_t pte_mkread(pte_t pte)      { pte_val(pte) |= _PAGE_USER; return pte; }
>  extern inline pte_t pte_mkexec(pte_t pte)      { pte_val(pte) |= _PAGE_USER; return pte; }
>  extern inline pte_t pte_mkdirty(pte_t pte)     { pte_val(pte) |= _PAGE_DIRTY; return pte; }
>  extern inline pte_t pte_mkyoung(pte_t pte)     { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
> +
> +/*
> + * These are harder, as writability is two bits, not one..
> + */
> +extern inline int pte_write(pte_t pte)         { return (pte_val(pte) & _PAGE_WRITABLE) == _PAGE_WRITABLE; }
> +extern inline pte_t pte_wrprotect(pte_t pte)   { pte_val(pte) &= ~((pte_val(pte) & _PAGE_PRESENT) << 1); return pte; }
> +extern inline pte_t pte_mkwrite(pte_t pte)     { pte_val(pte) |= _PAGE_RW; return pte; }
                                                                    ^^^^^^^^
Did you mean to put in _PAGE_WRITABLE here, or can the pte_mkwrite macro always assume the
PRESENT bit is already set?

Regards,
Bill

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu

  reply	other threads:[~1998-07-10  1:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.3.95.980710021356.10100A-100000@fishy>
1998-07-10  1:26 ` Linus Torvalds
1998-07-10  2:18   ` Bill Hawes [this message]
1998-07-10  2:18     ` Linus Torvalds
     [not found] <Pine.LNX.3.95.980709184611.6873C-100000@fishy>
1998-07-10  0:42 ` Stephen C. Tweedie
1998-07-10  0:54   ` Linus Torvalds
1998-07-20 11:16     ` Richard Henderson
1998-07-20 17:01       ` Linus Torvalds
     [not found]   ` <35A57732.A7B5DFF@star.net>
1998-07-10 13:34     ` Stephen C. Tweedie

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=35A579F3.68F549AF@star.net \
    --to=whawes@star.net \
    --cc=davem@dm.cobaltmicro.com \
    --cc=ganesh.sittampalam@magd.ox.ac.uk \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=mingo@valerie.inf.elte.hu \
    --cc=number6@the-village.bc.nu \
    --cc=sct@redhat.com \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®