Avi Kivity wrote on 2013-02-21:
> On Thu, Feb 21, 2013 at 10:58 AM, Zhang, Yang Z <[email protected]>
> wrote:
>> Thanks. Here is code after changing, please review it:
>>
>> asm(
>> "mov %0, %%" _ASM_DX " \n\t" #ifdef
>> CONFIG_X86_64 "mov %%" _ASM_SP ", %%" _ASM_BX "
>> \n\t" "and $0xfffffffffffffff0, %%" _ASM_SP "
>> \n\t" "mov %%ss, %%" _ASM_AX " \n\t" "push %%"
>> _ASM_AX " \n\t" "push %%" _ASM_BX " \n\t"
>> #endif "pushf \n\t" "orl $0x200, (%%" _ASM_SP
>> ") \n\t" __ASM_SIZE(push) " %c[cs] \n\t" "call
>> *%% " _ASM_DX " \n\t" : : "m"(entry),
>> [cs]"i"(__KERNEL_CS) : #ifdef CONFIG_X86_64
>> "rax", "rbx", "rdx" #else "edx" #endif );
>
> For cleanliness, you can provide more parameters via the constraints:
>
> "m"(entry) -> [entry]"r"(entry) (and then use "call *[entry]")
> use "push %c[ss]" for ss
> and [sp]"=&r"(tmp) instead of rdx/edx as the temporary for rsp
I didn't found the __KERNEL_SS definition. But I noticed that KVM use
__KERNEL_DS as HOST_SS_SELECTOR.
Please review the following changes.
asm volatile(
#ifdef CONFIG_X86_64
"mov %%" _ASM_SP ", %[sp] \n\t"
"and $0xfffffffffffffff0, %%" _ASM_SP " \n\t"
"push $%c[ss] \n\t"
"push %[sp] \n\t"
#endif
"pushf \n\t"
"orl $0x200, (%%" _ASM_SP ") \n\t"
__ASM_SIZE(push) " $%c[cs] \n\t"
"call *%[entry] \n\t"
:
#ifdef CONFIG_X86_64
[sp]"=&r"(tmp)
#endif
: [entry]"r"(entry),
[ss]"i"(__KERNEL_DS),
[cs]"i"(__KERNEL_CS)
);
Best regards,
Yang
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html