From: Igor Mammedov <imammedo@redhat.com>
To: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Cc: ehabkost@redhat.com, qemu-devel@nongnu.org,
izumi.taku@jp.fujitsu.com, chen.fan.fnst@cn.fujitsu.com,
pbonzini@redhat.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [PATCH v12 2/5] apic: use per CPU AS to map APIC MMIO for TCG
Date: Tue, 22 Sep 2015 14:29:01 +0200 [thread overview]
Message-ID: <20150922142901.444bfd35@nial.brq.redhat.com> (raw)
In-Reply-To: <d4d8553a21c981b11a5cf85d28ee0c0f634beb26.1442380656.git.zhugh.fnst@cn.fujitsu.com>
On Wed, 16 Sep 2015 17:19:12 +0800
Zhu Guihua <zhugh.fnst@cn.fujitsu.com> wrote:
> TCG supports per CPU address space, and the emulation quality is
> a bit better with it.
> So use per CPU address space to map APIC MMIO area. This allows the
> APIC base address of each cpu to be moved independent of others.
>
> Signed-off-by: Zhu Guihua <zhugh.fnst@cn.fujitsu.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> target-i386/cpu.c | 13 +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/target-i386/cpu.c b/target-i386/cpu.c
> index 050ce11..692a284 100644
> --- a/target-i386/cpu.c
> +++ b/target-i386/cpu.c
> @@ -2759,9 +2759,18 @@ static void x86_cpu_apic_realize(X86CPU *cpu, Error **errp)
> object_property_set_bool(OBJECT(cpu->apic_state), true, "realized",
> errp);
>
> - /* Map APIC MMIO area */
> + /* Map APIC MMIO area, use per-CPU address space if available (TCG
> + * supports it, KVM doesn't). This allows the APIC base address of
> + * each CPU to be moved independently.
> + */
> apic = APIC_COMMON(cpu->apic_state);
> - if (!apic_mmio_map_once) {
> + if (tcg_enabled()) {
> + memory_region_add_subregion_overlap(cpu->cpu_as_root,
> + apic->apicbase &
> + MSR_IA32_APICBASE_BASE,
> + &apic->io_memory,
> + 0x1000);
> + } else if (!apic_mmio_map_once) {
> memory_region_add_subregion_overlap(get_system_memory(),
> apic->apicbase &
> MSR_IA32_APICBASE_BASE,
next prev parent reply other threads:[~2015-09-22 12:29 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 9:19 [Qemu-devel] [PATCH v12 0/5] remove icc bus/bridge Zhu Guihua
2015-09-16 9:19 ` [Qemu-devel] [PATCH v12 1/5] apic: move APIC's MMIO region mapping into APIC Zhu Guihua
2015-09-22 12:28 ` Igor Mammedov
2015-09-16 9:19 ` [Qemu-devel] [PATCH v12 2/5] apic: use per CPU AS to map APIC MMIO for TCG Zhu Guihua
2015-09-22 12:29 ` Igor Mammedov [this message]
2015-10-02 18:24 ` Eduardo Habkost
2015-10-02 19:21 ` Eduardo Habkost
2015-10-09 9:00 ` Zhu Guihua
2015-09-16 9:19 ` [Qemu-devel] [PATCH v12 3/5] x86: use new method to correct reset sequence Zhu Guihua
2015-09-22 12:29 ` Igor Mammedov
2015-09-16 9:19 ` [Qemu-devel] [PATCH v12 4/5] cpu/apic: drop icc bus/bridge Zhu Guihua
2015-09-22 12:29 ` Igor Mammedov
2015-09-16 9:19 ` [Qemu-devel] [PATCH v12 5/5] icc_bus: drop the unused files Zhu Guihua
2015-09-22 12:30 ` Igor Mammedov
2015-09-30 6:35 ` [Qemu-devel] [PATCH v12 0/5] remove icc bus/bridge Zhu Guihua
2015-10-02 17:58 ` Eduardo Habkost
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=20150922142901.444bfd35@nial.brq.redhat.com \
--to=imammedo@redhat.com \
--cc=afaerber@suse.de \
--cc=chen.fan.fnst@cn.fujitsu.com \
--cc=ehabkost@redhat.com \
--cc=izumi.taku@jp.fujitsu.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=zhugh.fnst@cn.fujitsu.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 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).