public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Zachary Amsden <zach@vmware.com>
To: Pavel Machek <pavel@suse.cz>
Cc: linux-kernel@vger.kernel.org, pratap@vmware.com
Subject: Re: [PATCH 1/1] i386 Encapsulate copying of pgd entries
Date: Sun, 07 Aug 2005 12:20:00 -0700	[thread overview]
Message-ID: <42F65EE0.4070205@vmware.com> (raw)
In-Reply-To: <20050807190017.GE1024@openzaurus.ucw.cz>

Pavel Machek wrote:

>Hi!
>
>  
>
>>This helps complete the encapsulation of updates to page tables (or pages
>>about to become page tables) into accessor functions rather than using
>>memcpy() to duplicate them.  This is both generally good for consistency
>>and also necessary for running in a hypervisor which requires explicit
>>updates to page table entries.
>>    
>>
>
>Hmm, I'm not sure if this kind of hypervisor can reasonably work with swsusp;
>swsusp is just copying memory, it does not know which part of memory are page tables.
>				Pavel
>  
>

There are good and bad things about this.  Everything with swap suspend 
should be fine for the suspend portion of things; it is when resuming 
back up that one must take care to call the hypervisor functions for 
reloading control registers and updating page tables.

I'm not sure that Xen can cope with that scenario - it would have to go 
into shadowed mode first, then after resume, go back from shadow mode 
into direct page table mode.  Otherwise, as you say, making swap suspend 
aware of what pages are page tables would be quite difficult and 
needlessly complicate the code.

Since most hypervisors will likely provide a suspend/resume mechanism 
that is external to the guest, most of this is a moot point anyways.  
But I wondered if you thought the pgd_clone() accessor would make this 
cleaner or if it is just most confusing:

#ifdef CONFIG_SOFTWARE_SUSPEND
/*
 * Swap suspend & friends need this for resume because things like the 
intel-agp
 * driver might have split up a kernel 4MB mapping.
 */
char __nosavedata swsusp_pg_dir[PAGE_SIZE]
        __attribute__ ((aligned (PAGE_SIZE)));

static inline void save_pg_dir(void)
{
        memcpy(swsusp_pg_dir, swapper_pg_dir, PAGE_SIZE);  <--- could be 
clone_pgd_range()
}

Zach

  reply	other threads:[~2005-08-07 19:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-06  0:26 [PATCH 1/1] i386 Encapsulate copying of pgd entries zach
2005-08-06  1:13 ` Chris Wright
2005-08-06  1:52   ` Zachary Amsden
2005-08-06  6:00     ` Zachary Amsden
2005-08-06  8:05   ` Zachary Amsden
2005-08-07 19:00 ` Pavel Machek
2005-08-07 19:20   ` Zachary Amsden [this message]
2005-08-07 19:37     ` 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=42F65EE0.4070205@vmware.com \
    --to=zach@vmware.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pavel@suse.cz \
    --cc=pratap@vmware.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