From: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>, qemu-devel@nongnu.org
Cc: Marcel Apfelbaum <marcel@redhat.com>
Subject: Re: [Qemu-devel] [PATCH] pci: mark ROMs read-only
Date: Mon, 23 Jan 2017 21:07:41 +0200 [thread overview]
Message-ID: <f6751d6e-9cbe-6b28-abc1-8d13efea2e3e@gmail.com> (raw)
In-Reply-To: <1484859633-24889-1-git-send-email-mst@redhat.com>
On 01/19/2017 11:00 PM, Michael S. Tsirkin wrote:
> Looks like we didn't mark PCI ROMs as RO allowing
> mischief such as guests writing there.
> Further, e.g. vhost gets confused trying to allocate
> enough space to log writes there. Fix it up.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
> ---
> hw/pci/pci.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/pci/pci.c b/hw/pci/pci.c
> index 637d545..eaac185 100644
> --- a/hw/pci/pci.c
> +++ b/hw/pci/pci.c
> @@ -2199,7 +2199,7 @@ static void pci_add_option_rom(PCIDevice *pdev, bool is_default_rom,
> snprintf(name, sizeof(name), "%s.rom", object_get_typename(OBJECT(pdev)));
> }
> pdev->has_rom = true;
> - memory_region_init_ram(&pdev->rom, OBJECT(pdev), name, size, &error_fatal);
> + memory_region_init_rom(&pdev->rom, OBJECT(pdev), name, size, &error_fatal);
> vmstate_register_ram(&pdev->rom, &pdev->qdev);
> ptr = memory_region_get_ram_ptr(&pdev->rom);
> load_image(path, ptr);
>
Reviewed-by: Marcel Apfelbaum <marcel@redhat.com>
Thanks,
Marcel
next prev parent reply other threads:[~2017-01-23 19:07 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 21:00 [Qemu-devel] [PATCH] pci: mark ROMs read-only Michael S. Tsirkin
2017-01-23 19:07 ` Marcel Apfelbaum [this message]
2017-01-24 16:12 ` Laurent Vivier
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=f6751d6e-9cbe-6b28-abc1-8d13efea2e3e@gmail.com \
--to=marcel.apfelbaum@gmail.com \
--cc=marcel@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
/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 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).