[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D3F0896.4050006@zytor.com>
Date: Tue, 25 Jan 2011 09:29:58 -0800
From: "H. Peter Anvin" <hpa@...or.com>
To: "Ahmed S. Darwish" <darwish.07@...il.com>
CC: Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, X86-ML <x86@...nel.org>,
Tony Luck <tony.luck@...el.com>, Dave Jones <davej@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Randy Dunlap <rdunlap@...otime.net>,
Willy Tarreau <wtarreau@...a.kernel.org>,
Willy Tarreau <w@....eu>, Dirk Hohndel <hohndel@...radead.org>,
Dirk.Hohndel@...el.com,
Simon Kagstrom <simon.kagstrom@...insight.net>,
IDE-ML <linux-ide@...r.kernel.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next 2/2][RFC] x86: Saveoops: Reserve low memory and
register code
On 01/25/2011 05:53 AM, Ahmed S. Darwish wrote:
> +
> +/*
> + * Extended BIOS services write to disk in units of 512-byte sectors.
> + * Thus, always align the ring buffer size on a 512-byte boundary.
> + */
Units of sectors, not always 512 bytes. This needs to be done
correctly, or you will destroy real data.
> +/*
> + * Page tables to identity map the first 2 Mbytes.
> + */
> +static __aligned(PAGE_SIZE) pud_t ident_level3[PTRS_PER_PUD];
> +static __aligned(PAGE_SIZE) pmd_t ident_level2[PTRS_PER_PMD];
> +
> +/*
> + * The lmode->rmode switching code needs to run from an identity page
> + * since it disables paging.
> + */
> +static void build_identity_mappings(void)
> +{
> + pgd_t *pgde;
> + pud_t *pude;
> + pmd_t *pmde;
> +
> + pmde = ident_level2;
> + set_pmd(pmde, __pmd(0 + __PAGE_KERNEL_IDENT_LARGE_EXEC));
> +
> + pude = ident_level3;
> + set_pud(pude, __pud(__pa(ident_level2) + _KERNPG_TABLE));
> +
> + pgde = init_level4_pgt;
> + set_pgd(pgde, __pgd(__pa(ident_level3) + _KERNPG_TABLE));
> +
> + __flush_tlb_all();
> +}
We now have a permanent identity map so there is no point in building a
new one.
However, I'm quite nervous about this -- this patch has *plenty* of real
possibility of wrecking data.
-hpa
--
H. Peter Anvin, Intel Open Source Technology Center
I work for Intel. I don't speak on their behalf.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists