mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Jan Beulich <jbeulich@novell.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] i386 double fault enhancements
Date: Wed, 22 Feb 2006 14:32:12 -0800	[thread overview]
Message-ID: <20060222143212.0eea2ab0.akpm@osdl.org> (raw)
In-Reply-To: <200602221159.08969.jbeulich@novell.com>

Jan Beulich <jbeulich@novell.com> wrote:
>
> Make the double fault handler use CPU-specific stacks. Add some
> abstraction to simplify future change of other exception handlers to go
> through task gates. Change the pointer validity checks in the double
> fault handler to account for the fact that both GDT and TSS aren't in
> static kernel space anymore. Add a new notification of the event
> through the die notifier chain, also providing some environmental
> adjustments so that various infrastructural things work independent of
> the fact that the fault and the callbacks are running on other then the
> normal kernel stack.

Why?

> +# ifdef CONFIG_SMP

Please don't bother with the space after the #.  Yes, it's for nesting
level, but if someone later comes along and sticks more ifdefs around this
code, they won't go through and add the extra spaces anyway.

Such problems can be avoided by not adding the ifdefs at all..

> +#ifdef N_EXCEPTION_TSS

Can't we use CONFIG_DOUBLEFAULT throughout?  It's very much clearer.

> +struct tss_struct exception_tss[NR_CPUS][N_EXCEPTION_TSS] __cacheline_aligned = {
> +	[0 ... NR_CPUS-1] = {
> +		[0 ... N_EXCEPTION_TSS-1] = {
> +			.cs       = __KERNEL_CS,
> +			.ss       = __KERNEL_DS,
> +			.ss0      = __KERNEL_DS,
> +			.__cr3    = __pa(swapper_pg_dir),
> +			.io_bitmap_base = INVALID_IO_BITMAP_OFFSET,
> +			.ds       = __USER_DS,
> +			.es       = __USER_DS,
> +			.eflags	  = X86_EFLAGS_SF | 0x2, /* 0x2 bit is always set */
> +		},
> +		[DOUBLEFAULT_TSS].eip = (unsigned long)doublefault_fn
> +	}
> +};
> +#endif

How much more RAM does this patch consume?

> +#define EXCEPTION_STKSZ (PAGE_SIZE << EXCEPTION_STACK_ORDER)

"EXCEPTION_STACK_SIZE", please.


  reply	other threads:[~2006-02-22 22:30 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-22 10:59 Jan Beulich
2006-02-22 22:32 ` Andrew Morton [this message]
2006-02-23 10:34   ` Andi Kleen
2006-02-23 11:42   ` Jan Beulich
2006-02-24 18:49     ` Christoph Hellwig
2006-03-03  9:30   ` Jan Beulich

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=20060222143212.0eea2ab0.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=jbeulich@novell.com \
    --cc=linux-kernel@vger.kernel.org \
    /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®