public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@qumranet.com>
To: "Yang, Sheng" <sheng.yang@intel.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	Sebastian Herbszt <herbszt@gmx.de>,
	kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: bios: end AP boot code execution in rombios
Date: Mon, 18 Aug 2008 13:21:20 +0300	[thread overview]
Message-ID: <48A94D20.2080406@qumranet.com> (raw)
In-Reply-To: <200808181045.30451.sheng.yang@intel.com>

Yang, Sheng wrote:
> On Monday 18 August 2008 10:33:11 Anthony Liguori wrote:
>   
>> Sebastian Herbszt wrote:
>>     
>>> Jump to rombios before executing the halt loop.
>>>       
>> Why?  More importantly, why is this specific to KVM?
>>     
>
> The bios copy AP boot up code to 0x10000 now in KVM, so it can be 
> overwrite by userspace program like grub. I found it caused 
> stop/cont/info cpus in grub corrupt AP. Please refer to "
> KVM: Fix exiting from HLT emulation with MP_STATE_HALTED"
> (well, I found the patch duplicated with Marcelo's patch later, then 
> drop it...)
>
> Yeah, I am agree this should not be a specific issue to KVM.
>   

It is actually kvm specific.  The SIPI code runs with interrupts 
disabled, so the 'hlt' instruction cannot be resumed due to an interrupt 
(and as the apic hasn't been configured yet, no nmis either).  But due 
to a bug in kvm, an exit to userspace (like the one caused by 'info 
cpus' or stop+cont) can cause kvm to resume executing after the hlt 
instruction, which is now arbitrary application code.

Marcelo has a patch that addresses this, unfortunately with a 
regression, so hopefully the kvm bug will be closed soon.  That's not to 
say running out of ROM space is a bad idea, so I'll apply this.

(would be even better not to copy the code at all)

-- 
error compiling committee.c: too many arguments to function


  reply	other threads:[~2008-08-18 10:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-31  2:43 [PATCH] kvm: bios: Put AP boot up code to 0x1000 Yang, Sheng
2008-07-31  6:00 ` Yang, Sheng
2008-07-31  6:41   ` Avi Kivity
2008-07-31  9:09     ` Yang, Sheng
2008-07-31  9:46       ` Avi Kivity
2008-08-01 15:49         ` H. Peter Anvin
2008-07-31 21:15 ` Sebastian Herbszt
2008-08-01  1:19   ` Yang, Sheng
2008-08-02 19:30     ` Sebastian Herbszt
2008-08-05  8:14       ` Yang, Sheng
2008-08-06 21:56         ` Sebastian Herbszt
2008-08-10  7:50           ` Avi Kivity
2008-08-13 23:00             ` Sebastian Herbszt
2008-08-14  6:08               ` Avi Kivity
2008-08-17 22:35             ` [PATCH] kvm: bios: end AP boot code execution in rombios Sebastian Herbszt
2008-08-18  2:33               ` Anthony Liguori
2008-08-18  2:45                 ` Yang, Sheng
2008-08-18 10:21                   ` Avi Kivity [this message]
2008-08-18 10:22               ` Avi Kivity
2008-08-19 23:06                 ` Sebastian Herbszt

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=48A94D20.2080406@qumranet.com \
    --to=avi@qumranet.com \
    --cc=anthony@codemonkey.ws \
    --cc=herbszt@gmx.de \
    --cc=kvm@vger.kernel.org \
    --cc=sheng.yang@intel.com \
    /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