All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Alexander Graf <agraf@suse.de>
Cc: "Bogdan.Vlad@freescale.com" <Bogdan.Vlad@freescale.com>,
	QEMU Developers <qemu-devel@nongnu.org>,
	"qemu-ppc@nongnu.org" <qemu-ppc@nongnu.org>,
	"Varun.Sethi@freescale.com" <Varun.Sethi@freescale.com>,
	Scott Wood <scottwood@freescale.com>,
	"mihai.caraman@freescale.com" <mihai.caraman@freescale.com>
Subject: Re: [Qemu-devel] [PATCH] roms: Flush icache when writing roms to guest memory
Date: Wed, 11 Dec 2013 15:03:48 +0100	[thread overview]
Message-ID: <52A870C4.8010406@redhat.com> (raw)
In-Reply-To: <1C26F4F8-7257-4096-88FA-432755A892A0@suse.de>

Il 11/12/2013 14:35, Alexander Graf ha scritto:
>>> >> +            if (kvm_enabled()) {
>>> >> +                /*
>>> >> +                 * The guest may want to directly execute from the rom region,
>>> >> +                 * so we better invalidate its icache
>>> >> +                 */
>>> >> +                flush_icache_range((uintptr_t)ptr, (uintptr_t)ptr + l);
>>> >> +            }
>> > 
>> > Shouldn't KVM itself do that when a memslot is registered?  There should
>> > be no reason for non-TCG QEMU to flush the icache.
> How would KVM know when things changed inside of a memory region? It's up to user space to manage the contents of a memory region, no?

Yeah, that is true.  BTW, shouldn't the same happen when you do migration?

I'd prefer the above snippet to be replaced by a function in
kvm-stub.c/kvm-all.c (kvm_flush_icache_range).

I wonder if there would be a reason to add a KVM_FLUSH_ICACHE ioctl
though.  Could a virtually-indexed/virtually-tagged icache require
flushing by guest address instead of host address?

Paolo

  reply	other threads:[~2013-12-11 14:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-11 13:23 [Qemu-devel] [PATCH] roms: Flush icache when writing roms to guest memory Alexander Graf
2013-12-11 13:27 ` Paolo Bonzini
2013-12-11 13:35   ` Alexander Graf
2013-12-11 14:03     ` Paolo Bonzini [this message]
2013-12-11 14:20       ` Alexander Graf
2013-12-11 14:07     ` Peter Maydell
2013-12-11 14:17       ` Alexander Graf
2013-12-11 14:27         ` mihai.caraman
2013-12-11 14:18       ` mihai.caraman
2013-12-11 14:25         ` Peter Maydell
2013-12-11 14:31           ` Alexander Graf
2013-12-11 14:58           ` mihai.caraman
2013-12-11 13:56 ` Peter Maydell
2013-12-13 19:18   ` Scott Wood
2013-12-14 10:58     ` Paolo Bonzini
2013-12-14 11:08       ` Peter Maydell

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=52A870C4.8010406@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=Bogdan.Vlad@freescale.com \
    --cc=Varun.Sethi@freescale.com \
    --cc=agraf@suse.de \
    --cc=mihai.caraman@freescale.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=scottwood@freescale.com \
    /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.