[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v12 2/5] apic: use per CPU AS to map APIC MMIO f
From: |
Igor Mammedov |
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 |
On Wed, 16 Sep 2015 17:19:12 +0800
Zhu Guihua <address@hidden> 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 <address@hidden>
Reviewed-by: Igor Mammedov <address@hidden>
> ---
> 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,
- [Qemu-devel] [PATCH v12 0/5] remove icc bus/bridge, Zhu Guihua, 2015/09/16
- [Qemu-devel] [PATCH v12 1/5] apic: move APIC's MMIO region mapping into APIC, Zhu Guihua, 2015/09/16
- [Qemu-devel] [PATCH v12 3/5] x86: use new method to correct reset sequence, Zhu Guihua, 2015/09/16
- [Qemu-devel] [PATCH v12 2/5] apic: use per CPU AS to map APIC MMIO for TCG, Zhu Guihua, 2015/09/16
- Re: [Qemu-devel] [PATCH v12 2/5] apic: use per CPU AS to map APIC MMIO for TCG,
Igor Mammedov <=
- [Qemu-devel] [PATCH v12 4/5] cpu/apic: drop icc bus/bridge, Zhu Guihua, 2015/09/16
- [Qemu-devel] [PATCH v12 5/5] icc_bus: drop the unused files, Zhu Guihua, 2015/09/16