[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 7/7] pc: limit 64 bit hole to 2G by default
From: |
Andreas Färber |
Subject: |
Re: [Qemu-devel] [PATCH 7/7] pc: limit 64 bit hole to 2G by default |
Date: |
Fri, 02 Aug 2013 19:31:54 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130620 Thunderbird/17.0.7 |
Am 29.07.2013 16:47, schrieb Igor Mammedov:
> diff --git a/hw/i386/pc.c b/hw/i386/pc.c
> index b0b98a8..a2b9d88 100644
> --- a/hw/i386/pc.c
> +++ b/hw/i386/pc.c
[...]
> @@ -1003,15 +1004,27 @@ typedef struct PcRomPciInfo {
> static void pc_fw_cfg_guest_info(PcGuestInfo *guest_info)
> {
> PcRomPciInfo *info;
> + Object *pci_info;
> + bool ambiguous = false;
> +
> if (!guest_info->has_pci_info || !guest_info->fw_cfg) {
> return;
> }
> + pci_info = object_resolve_path_type("", TYPE_PCI_HOST_BRIDGE,
> &ambiguous);
> + g_assert(!ambiguous);
> + if (!pci_info) {
> + return;
> + }
>
> info = g_malloc(sizeof *info);
> - info->w32_min = cpu_to_le64(guest_info->pci_info.w32.begin);
> - info->w32_max = cpu_to_le64(guest_info->pci_info.w32.end);
> - info->w64_min = cpu_to_le64(guest_info->pci_info.w64.begin);
> - info->w64_max = cpu_to_le64(guest_info->pci_info.w64.end);
> + info->w32_min = cpu_to_le64(object_property_get_int(pci_info,
> + PCI_HOST_PROP_PCI_HOLE_START, NULL));
> + info->w32_max = cpu_to_le64(object_property_get_int(pci_info,
> + PCI_HOST_PROP_PCI_HOLE_END, NULL));
> + info->w64_min = cpu_to_le64(object_property_get_int(pci_info,
> + PCI_HOST_PROP_PCI_HOLE64_START, NULL));
> + info->w64_max = cpu_to_le64(object_property_get_int(pci_info,
> + PCI_HOST_PROP_PCI_HOLE64_END, NULL));
> /* Pass PCI hole info to guest via a side channel.
> * Required so guest PCI enumeration does the right thing. */
> fw_cfg_add_file(guest_info->fw_cfg, "etc/pci-info", info, sizeof *info);
I wonder, if we're passing PcRomInfo out to SeaBIOS via fw_cfg,
shouldn't it be QEMU_PACKED just in case?
Not strictly related to this patch, obviously.
Regards,
Andreas
/* pci-info ROM file. Little endian format */
typedef struct PcRomPciInfo {
uint64_t w32_min;
uint64_t w32_max;
uint64_t w64_min;
uint64_t w64_max;
} PcRomPciInfo;
--
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-devel] [PATCH 7/7] pc: limit 64 bit hole to 2G by default,
Andreas Färber <=