RE: [PATCH][v2] kvm-userspace: Load PCI option ROMs

Liu, Kechao
2008-12-29T09:36:19Z

Hi Avi,

>-----Original Message-----
>From: Avi Kivity [mailto:avi@redhat.com]
>Sent: 2008年12月29日 16:29
>To: Liu, Kechao
>Cc: kvm@vger.kernel.org; Shan, Haitao
>Subject: Re: [PATCH][v2] kvm-userspace: Load PCI option ROMs
>
>Liu, Kechao wrote:
>> Hi Avi,
>>
>> Thanks for your comments. I've updated the patch according to them.
>> Please review it. Thank you.
>>
>> Load assigned devices' PCI option ROMs to the RAM of
>> guest OS. And pass the corresponding devfns to BIOS.
>>
>>
>
>Looks good.
>
>> +
>> + /* Write ROM data and devfn to phys_addr */
>> + cpu_physical_memory_write_rom(0xd0000 + offset, rom, size);
>> + cpu_physical_memory_write_rom(0xd0000 + offset + size, &devfn, 1);
>> +
>
>How is the last bit performed on real hardware? Obviously the ROM can't
>have devfn embedded.

On a real hardware, BIOS scans PCI devices, loads ROMs and it can get devices' devfns. Here, in an easier way, we load option ROMs in QEMU and thus need to
store and pass the devfns.
>
>--
>I have a truly marvellous patch that fixes the bug which this
>signature is too narrow to contain.

Best Regards,
Liu, Kechao