From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [PATCH 1/2] qemu-kvm: extboot: Keep variables in RAM Date: Fri, 19 Feb 2010 08:50:17 -0800 Message-ID: <4B7EC149.5080603@linux.intel.com> References: <4B7D6725.1090202@siemens.com> <4B7DA2C4.9040207@codemonkey.ws> <4B7DC5A5.5020500@linux.intel.com> <4B7E628E.2050107@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Anthony Liguori , Avi Kivity , Marcelo Tosatti , kvm To: Jan Kiszka Return-path: Received: from mga10.intel.com ([192.55.52.92]:45156 "EHLO fmsmga102.fm.intel.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751592Ab0BSQuU (ORCPT ); Fri, 19 Feb 2010 11:50:20 -0500 In-Reply-To: <4B7E628E.2050107@siemens.com> Sender: kvm-owner@vger.kernel.org List-ID: Jan Kiszka wrote: > > Shall the protection start _before_ INT 19 or somewhere _while_ it is > processed? I'm asking as extboot redirect the handler and writes to some > variable in its own handler. If the protection is already active at this > point, we must move at least one of the variables out of the shadow ROM. > The protection kicks in as the PMM system is torn down, which is done immediately before INT 19h. So >> However, as I did point out in the original comment, there are some >> BIOSes in the field which uses vectors 0xc0-0xdf as a scratch memory >> pool -- usually to have somewhere to stash a small stack -- so if you >> absolutely have to go down this route that range those probably be the >> safest. An alternative would be to use memory in the BDA in the range >> 0x4ac-0x4ff (absolute), which appears to be available for BIOS-specific >> uses. > > No problem moving to 0xc0 vectors if we have to (though my PC interrupt > vector docs all state that already 0x80 is BIOS/BASIC domain). > >>>> NEITHER OF THESE OPTIONS ARE SAFE ON REAL HARDWARE << >> These are both BIOS-specific use areas. >> > > Extboot is not targeting real hardware. It is built for a paravirtual > interface to QEMU. > Actually, extboot, or at least one variant of it, is used on real hardware in the gPXE stack. Nothing that says it has to be identical code, of course. For the Qemu case it sounds like the easiest thing is to just reserve two dwords in the BIOS Data Area that your BIOS doesn't use. -hpa