[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communica
From: |
Gleb Natapov |
Subject: |
Re: [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communication. |
Date: |
Mon, 25 Aug 2008 12:48:54 +0300 |
On Sun, Aug 24, 2008 at 08:39:44PM +0300, Blue Swirl wrote:
> On 8/24/08, Gleb Natapov <address@hidden> wrote:
> > Use PIO to get configuration info between qemu process and guest BIOS.
>
> Could you make this a separate device, so that it could be used in
> other machines? There is nothing PC-specific.
The code is less then 50 lines. Is it worth to move it to a separate
file (two of them .c and .h) before there is a real need?
>
> > +static uint32_t bios_cfg_read(void *opaque, uint32_t addr)
> > +{
> > + BIOSCfgEntry *e = &bios_params.entries[bios_params.entry];
>
> You should use the opaque parameter and cast that to BIOSCfgState.
>
> > + if (!e->data)
> > + return 0;
> > +
> > + return e->data[bios_params.cur_offset++ % e->len];
>
> Instead of using modular arithmetic, zero should be returned for invalid
> values.
>
> > +static void bios_cfg_write(void *opaque, uint32_t addr, uint32_t value)
> > +{
> > + bios_params.entry = value % BIOS_CFG_MAX_ENTRY;
>
> Same here, its important for downward compatibility.
>
> > + bios_cfg_add_data(BIOS_CFG_SIGNATURE, "QEMU", 4);
>
> I'd add:
> + bios_cfg_add_data(BIOS_CFG_ID, 1, 4);
>
Done.
--
Gleb.
- [Qemu-devel] [PATCH 0/6] Add UUID command-line option, Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 1/6] Use IO port for qemu<->guest BIOS communication., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 2/6] Add -uuid command line option., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 3/6] Add "info uuid" command to monitor., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 4/6] Use libuuid if available., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 5/6] Add UUID to BIOS configuration info., Gleb Natapov, 2008/08/24
- [Qemu-devel] [PATCH 6/6] Pass cpu speed into SM BIOS., Gleb Natapov, 2008/08/24