From: "Andreas Färber" <afaerber@suse.de>
To: Igor Mammedov <imammedo@redhat.com>, mst@redhat.com
Cc: qemu-devel@nongnu.org, Richard Henderson <rth@twiddle.net>
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 [thread overview]
Message-ID: <51FBED0A.7010502@suse.de> (raw)
In-Reply-To: <1375109277-25561-8-git-send-email-imammedo@redhat.com>
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
next prev parent reply other threads:[~2013-08-02 17:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 14:47 [Qemu-devel] [PATCH for-1.6 v3 0/7] pc: limit 64 bit hole to 2G by default Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 1/7] pc: move IO_APIC_DEFAULT_ADDRESS to include/hw/i386/ioapic.h Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 2/7] pc: add I440FX QOM cast macro Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 3/7] pc: replace i440fx_common_init() with i440fx_init() Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 4/7] pc: add Q35 to QOM composition tree under /machine Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 5/7] qapi: make visit_type_size fallback to type_int Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 6/7] qdev: Add SIZE type to qdev properties Igor Mammedov
2013-07-29 14:47 ` [Qemu-devel] [PATCH 7/7] pc: limit 64 bit hole to 2G by default Igor Mammedov
2013-07-29 18:05 ` Michael S. Tsirkin
2013-08-02 17:31 ` Andreas Färber [this message]
2013-07-29 18:06 ` [Qemu-devel] [PATCH for-1.6 v3 0/7] " Michael S. Tsirkin
2013-08-02 12:35 ` Anthony Liguori
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51FBED0A.7010502@suse.de \
--to=afaerber@suse.de \
--cc=imammedo@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.