qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility
@ 2013-07-15 13:21 Oleksii Shevchuk
  2013-07-18 12:05 ` Hannes Reinecke
  0 siblings, 1 reply; 4+ messages in thread
From: Oleksii Shevchuk @ 2013-07-15 13:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: edk2-devel


I tried do run QEMU with OVMF UEFI bios (QEMU and EDK2 trunk). It hangs
while booting:

qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon file:/tmp/debug
 -global isa-debugcon.iobase=0x402 -global PIIX4_PM.disable_s3=0 -global
 PIIX4_PM.disable_s4=0

SecCoreStartupWithStack(0xFFFE6000, 0x80000)
File->Type: 0xB
Section->Type: 0x2
Section->Type: 0x19
Section->Type (0x19) != SectionType (0x17)
Section->Type: 0x17
File->Type: 0x2
File->Type (0x2) != FileType (0x4)
File->Type: 0xF0
File->Type (0xF0) != FileType (0x4)
File->Type: 0x4
Section->Type: 0x19
Section->Type (0x19) != SectionType (0x10)
Section->Type: 0x10
Register PPI Notify: DCD0BE23-9586-40F4-B643-06522CED4EDE
Install PPI: 8C8CE578-8A3D-4F1C-9935-896185C32DD3
Install PPI: 5473C07A-3DCB-4DCA-BD6F-1E9689E7349A
The 0th FV start address is 0x00000800000, size is 0x00800000, handle is 0x800000
Register PPI Notify: 49EDB1C1-BF21-4761-BB12-EB0031AABB39
Install PPI: B9E0ABFE-5979-4914-977F-6DEE78C278A6
Install PPI: DBE23AA9-A345-4B97-85B6-B226F1617389
Loading PEIM at 0x00000815220 EntryPoint=0x00000815480 PcdPeim.efi
Install PPI: 06E81C58-4AD7-44BC-8390-F10265F72480
Install PPI: 01F34D25-4DE2-23AD-3FF3-36353FF323F1
Loading PEIM at 0x0000081C920 EntryPoint=0x0000081CB80 StatusCodePei.efi
Install PPI: 229832D3-7A30-4B36-B827-F40CB7D45436
Loading PEIM at 0x00000822220 EntryPoint=0x00000822480 PlatformPei.efi
Platform PEIM Loaded
CMOS:
00:%                                                                                                                                        

> strace -e open qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon
> file:/tmp/debug -global isa-debugcon.iobase=0x402 -global
> PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 2>&1 | grep bin
open("/usr/bin/qemu-kvm", O_RDONLY)     = 3
open("/usr/share/qemu/kvmvapic.bin", O_RDONLY) = 11
open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11

> file -L "/usr/share/qemu/vgabios-cirrus.bin" 
/usr/share/qemu/vgabios-cirrus.bin: BIOS (ia32) ROM Ext. IBM comp. Video (71*512)

I managed to run it without KVM, while it successfully runnings with KVM in qemu 1.4.2.
Bisecting showed, that regression introduced with commit
235e8982ad393e5611cb892df54881c872eea9e1: 

Author: Jordan Justen <jordan.l.justen@intel.com>
Date:   Wed May 29 01:27:26 2013 -0700

    kvm: support using KVM_MEM_READONLY flag for regions
    
    For readonly memory regions and rom devices in romd_mode,
    we make use of the KVM_MEM_READONLY. A slot that uses
    KVM_MEM_READONLY can be read from and code can execute from the
    region, but writes will exit to qemu.
    
    For rom devices with !romd_mode, we force the slot to be
    removed so reads or writes to the region will exit to qemu.
    (Note that a memory region in this state is not executable
    within kvm.)
    
    v7:
     * Update for readable => romd_mode rename (5f9a5ea1)
    
    Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
    Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> (v4)
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> (v5)
    Message-id: 1369816047-16384-4-git-send-email-jordan.l.justen@intel.com
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

:100644 100644 327ae12f08b9dddc796d753d8adfb1f70c78b2c1 8e7bbf8698f6bcaa5ae945ef86e7b51effde06fe M	kvm-all.c

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility
@ 2013-07-15 13:21 Oleksii Shevchuk
  0 siblings, 0 replies; 4+ messages in thread
From: Oleksii Shevchuk @ 2013-07-15 13:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: edk2-devel


I tried do run QEMU with OVMF UEFI bios (QEMU and EDK2 trunk). It hangs
while booting:

qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon file:/tmp/debug
 -global isa-debugcon.iobase=0x402 -global PIIX4_PM.disable_s3=0 -global
 PIIX4_PM.disable_s4=0

SecCoreStartupWithStack(0xFFFE6000, 0x80000)
File->Type: 0xB
Section->Type: 0x2
Section->Type: 0x19
Section->Type (0x19) != SectionType (0x17)
Section->Type: 0x17
File->Type: 0x2
File->Type (0x2) != FileType (0x4)
File->Type: 0xF0
File->Type (0xF0) != FileType (0x4)
File->Type: 0x4
Section->Type: 0x19
Section->Type (0x19) != SectionType (0x10)
Section->Type: 0x10
Register PPI Notify: DCD0BE23-9586-40F4-B643-06522CED4EDE
Install PPI: 8C8CE578-8A3D-4F1C-9935-896185C32DD3
Install PPI: 5473C07A-3DCB-4DCA-BD6F-1E9689E7349A
The 0th FV start address is 0x00000800000, size is 0x00800000, handle is 0x800000
Register PPI Notify: 49EDB1C1-BF21-4761-BB12-EB0031AABB39
Install PPI: B9E0ABFE-5979-4914-977F-6DEE78C278A6
Install PPI: DBE23AA9-A345-4B97-85B6-B226F1617389
Loading PEIM at 0x00000815220 EntryPoint=0x00000815480 PcdPeim.efi
Install PPI: 06E81C58-4AD7-44BC-8390-F10265F72480
Install PPI: 01F34D25-4DE2-23AD-3FF3-36353FF323F1
Loading PEIM at 0x0000081C920 EntryPoint=0x0000081CB80 StatusCodePei.efi
Install PPI: 229832D3-7A30-4B36-B827-F40CB7D45436
Loading PEIM at 0x00000822220 EntryPoint=0x00000822480 PlatformPei.efi
Platform PEIM Loaded
CMOS:
00:%                                                                                                                                        

> strace -e open qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon
> file:/tmp/debug -global isa-debugcon.iobase=0x402 -global
> PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 2>&1 | grep bin
open("/usr/bin/qemu-kvm", O_RDONLY)     = 3
open("/usr/share/qemu/kvmvapic.bin", O_RDONLY) = 11
open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11

> file -L "/usr/share/qemu/vgabios-cirrus.bin" 
/usr/share/qemu/vgabios-cirrus.bin: BIOS (ia32) ROM Ext. IBM comp. Video (71*512)

I managed to run it without KVM, while it successfully runnings with KVM in qemu 1.4.2.
Bisecting showed, that regression introduced with commit
235e8982ad393e5611cb892df54881c872eea9e1: 

Author: Jordan Justen <jordan.l.justen@intel.com>
Date:   Wed May 29 01:27:26 2013 -0700

    kvm: support using KVM_MEM_READONLY flag for regions
    
    For readonly memory regions and rom devices in romd_mode,
    we make use of the KVM_MEM_READONLY. A slot that uses
    KVM_MEM_READONLY can be read from and code can execute from the
    region, but writes will exit to qemu.
    
    For rom devices with !romd_mode, we force the slot to be
    removed so reads or writes to the region will exit to qemu.
    (Note that a memory region in this state is not executable
    within kvm.)
    
    v7:
     * Update for readable => romd_mode rename (5f9a5ea1)
    
    Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
    Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> (v4)
    Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> (v5)
    Message-id: 1369816047-16384-4-git-send-email-jordan.l.justen@intel.com
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>

:100644 100644 327ae12f08b9dddc796d753d8adfb1f70c78b2c1 8e7bbf8698f6bcaa5ae945ef86e7b51effde06fe M	kvm-all.c

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility
  2013-07-15 13:21 [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility Oleksii Shevchuk
@ 2013-07-18 12:05 ` Hannes Reinecke
  2013-07-18 15:57   ` Jordan Justen
  0 siblings, 1 reply; 4+ messages in thread
From: Hannes Reinecke @ 2013-07-18 12:05 UTC (permalink / raw)
  To: Oleksii Shevchuk; +Cc: edk2-devel, qemu-devel

On 07/15/2013 03:21 PM, Oleksii Shevchuk wrote:
>
> I tried do run QEMU with OVMF UEFI bios (QEMU and EDK2 trunk). It hangs
> while booting:
>
> qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon file:/tmp/debug
>   -global isa-debugcon.iobase=0x402 -global PIIX4_PM.disable_s3=0 -global
>   PIIX4_PM.disable_s4=0
>
> SecCoreStartupWithStack(0xFFFE6000, 0x80000)
> File->Type: 0xB
> Section->Type: 0x2
> Section->Type: 0x19
> Section->Type (0x19) != SectionType (0x17)
> Section->Type: 0x17
> File->Type: 0x2
> File->Type (0x2) != FileType (0x4)
> File->Type: 0xF0
> File->Type (0xF0) != FileType (0x4)
> File->Type: 0x4
> Section->Type: 0x19
> Section->Type (0x19) != SectionType (0x10)
> Section->Type: 0x10
> Register PPI Notify: DCD0BE23-9586-40F4-B643-06522CED4EDE
> Install PPI: 8C8CE578-8A3D-4F1C-9935-896185C32DD3
> Install PPI: 5473C07A-3DCB-4DCA-BD6F-1E9689E7349A
> The 0th FV start address is 0x00000800000, size is 0x00800000, handle is 0x800000
> Register PPI Notify: 49EDB1C1-BF21-4761-BB12-EB0031AABB39
> Install PPI: B9E0ABFE-5979-4914-977F-6DEE78C278A6
> Install PPI: DBE23AA9-A345-4B97-85B6-B226F1617389
> Loading PEIM at 0x00000815220 EntryPoint=0x00000815480 PcdPeim.efi
> Install PPI: 06E81C58-4AD7-44BC-8390-F10265F72480
> Install PPI: 01F34D25-4DE2-23AD-3FF3-36353FF323F1
> Loading PEIM at 0x0000081C920 EntryPoint=0x0000081CB80 StatusCodePei.efi
> Install PPI: 229832D3-7A30-4B36-B827-F40CB7D45436
> Loading PEIM at 0x00000822220 EntryPoint=0x00000822480 PlatformPei.efi
> Platform PEIM Loaded
> CMOS:
> 00:%
>
>> strace -e open qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon
>> file:/tmp/debug -global isa-debugcon.iobase=0x402 -global
>> PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 2>&1 | grep bin
> open("/usr/bin/qemu-kvm", O_RDONLY)     = 3
> open("/usr/share/qemu/kvmvapic.bin", O_RDONLY) = 11
> open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
> open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
>
>> file -L "/usr/share/qemu/vgabios-cirrus.bin"
> /usr/share/qemu/vgabios-cirrus.bin: BIOS (ia32) ROM Ext. IBM comp. Video (71*512)
>
> I managed to run it without KVM, while it successfully runnings with KVM in qemu 1.4.2.
> Bisecting showed, that regression introduced with commit
> 235e8982ad393e5611cb892df54881c872eea9e1:
>
> Author: Jordan Justen <jordan.l.justen@intel.com>
> Date:   Wed May 29 01:27:26 2013 -0700
>
>      kvm: support using KVM_MEM_READONLY flag for regions
>
>      For readonly memory regions and rom devices in romd_mode,
>      we make use of the KVM_MEM_READONLY. A slot that uses
>      KVM_MEM_READONLY can be read from and code can execute from the
>      region, but writes will exit to qemu.
>
>      For rom devices with !romd_mode, we force the slot to be
>      removed so reads or writes to the region will exit to qemu.
>      (Note that a memory region in this state is not executable
>      within kvm.)
>
>      v7:
>       * Update for readable => romd_mode rename (5f9a5ea1)
>
>      Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
>      Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> (v4)
>      Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> (v5)
>      Message-id: 1369816047-16384-4-git-send-email-jordan.l.justen@intel.com
>      Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>
> :100644 100644 327ae12f08b9dddc796d753d8adfb1f70c78b2c1 8e7bbf8698f6bcaa5ae945ef86e7b51effde06fe M	kvm-all.c
>
Confirmed.

Reverting the mentioned commit makes everything run smoothly again.

Cheers,

Hannes

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility
  2013-07-18 12:05 ` Hannes Reinecke
@ 2013-07-18 15:57   ` Jordan Justen
  0 siblings, 0 replies; 4+ messages in thread
From: Jordan Justen @ 2013-07-18 15:57 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Oleksii Shevchuk, edk2-devel@lists.sourceforge.net, qemu-devel

On Thu, Jul 18, 2013 at 5:05 AM, Hannes Reinecke <hare@suse.de> wrote:
> On 07/15/2013 03:21 PM, Oleksii Shevchuk wrote:
>> I tried do run QEMU with OVMF UEFI bios (QEMU and EDK2 trunk). It hangs
>> while booting:
>>
>> qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon file:/tmp/debug
>>   -global isa-debugcon.iobase=0x402 -global PIIX4_PM.disable_s3=0 -global
>>   PIIX4_PM.disable_s4=0
>>
>> SecCoreStartupWithStack(0xFFFE6000, 0x80000)
>> File->Type: 0xB
>> Section->Type: 0x2
>> Section->Type: 0x19
>> Section->Type (0x19) != SectionType (0x17)
>> Section->Type: 0x17
>> File->Type: 0x2
>> File->Type (0x2) != FileType (0x4)
>> File->Type: 0xF0
>> File->Type (0xF0) != FileType (0x4)
>> File->Type: 0x4
>> Section->Type: 0x19
>> Section->Type (0x19) != SectionType (0x10)
>> Section->Type: 0x10
>> Register PPI Notify: DCD0BE23-9586-40F4-B643-06522CED4EDE
>> Install PPI: 8C8CE578-8A3D-4F1C-9935-896185C32DD3
>> Install PPI: 5473C07A-3DCB-4DCA-BD6F-1E9689E7349A
>> The 0th FV start address is 0x00000800000, size is 0x00800000, handle is
>> 0x800000
>> Register PPI Notify: 49EDB1C1-BF21-4761-BB12-EB0031AABB39
>> Install PPI: B9E0ABFE-5979-4914-977F-6DEE78C278A6
>> Install PPI: DBE23AA9-A345-4B97-85B6-B226F1617389
>> Loading PEIM at 0x00000815220 EntryPoint=0x00000815480 PcdPeim.efi
>> Install PPI: 06E81C58-4AD7-44BC-8390-F10265F72480
>> Install PPI: 01F34D25-4DE2-23AD-3FF3-36353FF323F1
>> Loading PEIM at 0x0000081C920 EntryPoint=0x0000081CB80 StatusCodePei.efi
>> Install PPI: 229832D3-7A30-4B36-B827-F40CB7D45436
>> Loading PEIM at 0x00000822220 EntryPoint=0x00000822480 PlatformPei.efi
>> Platform PEIM Loaded
>> CMOS:
>> 00:%
>>
>>> strace -e open qemu-kvm -L . -bios OVMF.fd --enable-kvm -debugcon
>>> file:/tmp/debug -global isa-debugcon.iobase=0x402 -global
>>> PIIX4_PM.disable_s3=0 -global PIIX4_PM.disable_s4=0 2>&1 | grep bin
>>
>> open("/usr/bin/qemu-kvm", O_RDONLY)     = 3
>> open("/usr/share/qemu/kvmvapic.bin", O_RDONLY) = 11
>> open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
>> open("/usr/share/qemu/vgabios-cirrus.bin", O_RDONLY) = 11
>>
>>> file -L "/usr/share/qemu/vgabios-cirrus.bin"
>>
>> /usr/share/qemu/vgabios-cirrus.bin: BIOS (ia32) ROM Ext. IBM comp. Video
>> (71*512)
>>
>> I managed to run it without KVM, while it successfully runnings with KVM
>> in qemu 1.4.2.
>> Bisecting showed, that regression introduced with commit
>> 235e8982ad393e5611cb892df54881c872eea9e1:
>>
>> Author: Jordan Justen <jordan.l.justen@intel.com>
>> Date:   Wed May 29 01:27:26 2013 -0700
>>
>>      kvm: support using KVM_MEM_READONLY flag for regions
>>
>>      For readonly memory regions and rom devices in romd_mode,
>>      we make use of the KVM_MEM_READONLY. A slot that uses
>>      KVM_MEM_READONLY can be read from and code can execute from the
>>      region, but writes will exit to qemu.
>>
>>      For rom devices with !romd_mode, we force the slot to be
>>      removed so reads or writes to the region will exit to qemu.
>>      (Note that a memory region in this state is not executable
>>      within kvm.)
>>
>>      v7:
>>       * Update for readable => romd_mode rename (5f9a5ea1)
>>
>>      Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
>>      Reviewed-by: Xiao Guangrong <xiaoguangrong@linux.vnet.ibm.com> (v4)
>>      Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> (v5)
>>      Message-id:
>> 1369816047-16384-4-git-send-email-jordan.l.justen@intel.com
>>      Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>>
>> :100644 100644 327ae12f08b9dddc796d753d8adfb1f70c78b2c1
>> 8e7bbf8698f6bcaa5ae945ef86e7b51effde06fe M      kvm-all.c
>>
> Confirmed.
>
> Reverting the mentioned commit makes everything run smoothly again.

I've posted a 2 patch series for OVMF to edk2-devel that fixes this.
I'll probably send a v2 of that series today.

-Jordan

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-07-18 16:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-15 13:21 [Qemu-devel] support using KVM_MEM_READONLY flag for regions commit and OVMF UEFI incompatibility Oleksii Shevchuk
2013-07-18 12:05 ` Hannes Reinecke
2013-07-18 15:57   ` Jordan Justen
  -- strict thread matches above, loose matches on Subject: below --
2013-07-15 13:21 Oleksii Shevchuk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).