lkml.org 
[lkml]   [2007]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 22/25 -v2] turn priviled operation into a macro
    Date
    under paravirt, read cr2 cannot be issued directly anymore.
    So wrap it in a macro, defined to the operation itself in case
    paravirt is off, but to something else if we have paravirt
    in the game

    Signed-off-by: Glauber de Oliveira Costa <gcosta@redhat.com>
    Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
    ---
    arch/x86_64/kernel/head.S | 10 +++++++++-
    1 files changed, 9 insertions(+), 1 deletions(-)

    diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S
    index e89abcd..1bb6c55 100644
    --- a/arch/x86_64/kernel/head.S
    +++ b/arch/x86_64/kernel/head.S
    @@ -18,6 +18,12 @@
    #include <asm/page.h>
    #include <asm/msr.h>
    #include <asm/cache.h>
    +#ifdef CONFIG_PARAVIRT
    +#include <asm/asm-offsets.h>
    +#include <asm/paravirt.h>
    +#else
    +#define GET_CR2_INTO_RCX mov %cr2, %rcx
    +#endif

    /* we are not able to switch in one step to the final KERNEL ADRESS SPACE
    * because we need identity-mapped pages.
    @@ -267,7 +273,9 @@ ENTRY(early_idt_handler)
    xorl %eax,%eax
    movq 8(%rsp),%rsi # get rip
    movq (%rsp),%rdx
    - movq %cr2,%rcx
    + /* When PARAVIRT is on, this operation may clobber rax. It is
    + something safe to do, because we've just zeroed rax. */
    + GET_CR2_INTO_RCX
    leaq early_idt_msg(%rip),%rdi
    call early_printk
    cmpl $2,early_recursion_flag(%rip)
    --
    1.4.4.2
    -
    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/

    \
     
     \ /
      Last update: 2007-08-11 00:13    [W:0.102 / U:0.048 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site