Re: Simple patches for Linux as a guest OS in a plex86 VM (please consider)

From: Andrew Morton (akpm@digeo.com)
Date: Wed Jan 22 2003 - 14:56:41 EST


Kevin Lawton <kevinlawton2001@yahoo.com> wrote:
>
> Hello all,
>
> I'm working on running Linux as a guest OS inside a
> lightweight cut-down plex86 environment. My goal is to
> run a stock Linux kernel, which can be slimmed down to
> the essentials via kernel configuration, since a guest
> OS doesn't need to drive much hardware.
>
> For this, there's a few critical but simple diffs to
> macro'ize the use of the PUSHF and POPF instructions,
> due to broken semantics of running stuff using
> PVI (protected mode virtual interrupts). The rest of
> the stuff I believe can be monitored effectively by
> the VM monitor.
>
> Would you please consider integrating these diffs before 2.6?
> There's only one new header file, and macro substitution for
> a few cases where these instructions are used. For a normal
> compile, there are zero logic changes. Just 1:1 macros.

I'm wondering if this can this be done a lot more simply with assembler
macros.

The below example generates the right code. It's then just a matter of
getting the redefined pushfl and popfl macros into kernel-wide scope.
Possibly an explicit `-include' in the makefile system.

asm("
        .macro popfl
        testl $(1<<9), 0(%esp)
        jz 69003f
        .byte 0x9d # popfl
        sti
        jmp 69004f
69003:
        .byte 0x9d # popfl
        cli
69004:
        .endm
");

foo()
{
        asm("popfl\n");
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Jan 23 2003 - 22:00:30 EST