public inbox for linux-pm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Linux PM <linux-pm@osdl.org>, Dave Jones <davej@redhat.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Nigel Cunningham <ncunningham@linuxmail.org>
Subject: Re: [RFC][PATCH -mm] Make swsusp work on i386 with PAE
Date: Mon, 23 Oct 2006 16:50:33 +0200	[thread overview]
Message-ID: <20061023145033.GB31273@elf.ucw.cz> (raw)
In-Reply-To: <200610221548.48204.rjw@sisk.pl>

Hi!

> The purpose of the appended patch is to make swsusp work on i386 with PAE,
> but it should also allow i386 systems without PSE to use swsusp.
> 
> The patch creates temporary page tables located in resume-safe page frames
> during the resume and uses them for restoring the suspend image (the same
> approach is used on x86-64).
> 
> It has been tested on an i386 system with PAE and survived several
> suspend-resume cycles in a row, but I have no systems without PSE, so that
> requires some testing.

Thanks, looks okay to me. I guess Andi Kleen would be right person to
review it in detail?

Lack of assembly modifications is good.

I guess this should be now removed? (include/asm-i386/suspend.h)

arch_prepare_suspend(void)
{
        /* If you want to make non-PSE machine work, turn off paging
           in swsusp_arch_suspend. swsusp_pg_dir should have identity mapping, so
           it could work...  */
        if (!cpu_has_pse) {
                printk(KERN_ERR "PSE is required for swsusp.\n");
                return -EPERM;
        }

> +/*
> + * Create a middle page table on a resume-safe page and put a pointer to it in
> + * the given global directory entry.  This only returns the gd entry
> + * in non-PAE compilation mode, since the middle layer is folded.
> + */
> +static pmd_t *resume_one_md_table_init(pgd_t *pgd)
> +{
> +	pud_t *pud;
> +	pmd_t *pmd_table;
> +
> +#ifdef CONFIG_X86_PAE
> +	pmd_table = (pmd_t *)get_safe_page(GFP_ATOMIC);
> +	if (!pmd_table)
> +		return pmd_table;

I'd do plain old return NULL; here.

> +			/* Map with big pages if possible, otherwise create
> +			 * normal page tables.
> +			 * NOTE: We can mark everything as executable here
> +			 */
> +			if (cpu_has_pse) {
> +				set_pmd(pmd, pfn_pmd(pfn, PAGE_KERNEL_LARGE_EXEC));
> +				pfn += PTRS_PER_PTE;

Perhaps disabling PSE here can help getting some testing?

Okay, I guess I should really test this one... Seems good enough for
-mm to me, but it should preferably stay there for a _long_ time.
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2006-10-23 14:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-22 13:48 [RFC][PATCH -mm] Make swsusp work on i386 with PAE Rafael J. Wysocki
2006-10-23 14:50 ` Pavel Machek [this message]
2006-10-23 15:29   ` Rafael J. Wysocki
2006-10-25  8:05   ` Dave Jones
2006-11-02 10:31 ` Pavel Machek

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=20061023145033.GB31273@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@osdl.org \
    --cc=ncunningham@linuxmail.org \
    --cc=rjw@sisk.pl \
    /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