From: Eduardo Habkost <ehabkost@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: peter.maydell@linaro.org, zhugh.fnst@cn.fujitsu.com,
qemu-devel@nongnu.org, chen.fan.fnst@cn.fujitsu.com,
imammedo@redhat.com, afaerber@suse.de
Subject: Re: [Qemu-devel] [RESEND PATCH v9 1/4] apic: map APIC's MMIO region at each CPU's address space
Date: Wed, 26 Aug 2015 12:49:04 -0300 [thread overview]
Message-ID: <20150826154904.GG4230@thinpad.lan.raisama.net> (raw)
In-Reply-To: <37768706.19450373.1440602828235.JavaMail.zimbra@zmail13.collab.prod.int.phx2.redhat.com>
On Wed, Aug 26, 2015 at 11:27:08AM -0400, Paolo Bonzini wrote:
[...]
> > >> > + if (tcg_enabled()) {
> > >> > + memory_region_add_subregion_overlap(cpu->cpu_as_root,
> > >> > + apic->apicbase &
> > >> > + MSR_IA32_APICBASE_BASE,
> > >> > + &apic->io_memory,
> > >> > + 0x1000);
> > >>
> > >> Why exactly is this necessary? If this is necessary, why don't we need
> > >> to do this for non-TCG accelerators?
> > >
> > > At least KVM and qtest do not support per-CPU address spaces.
> >
> > Right, but given this restriction why can't we also do whatever
> > we need to work without the per-CPU address spaces with TCG?
> >
>
> Because the emulation quality is indeed a bit better with the per-CPU
> address spaces; you could move each APIC's base address independent of
> the others. However, this is not a feature that is actually used by
> anything in practice, so I doubt anyone cares about TCG implementing
> it correctly.
Do we need additional changes in TCG to implement it correctly, or is
this going to work out of the box as soon as we apply this series?
If it's the latter, the patch makes sense to me (but please add a
comment to the code explaining why). If it's the former, I don't see the
point of making the code more complex before that feature is actually
implemented by TCG.
Also, we could make the logic simpler if we just check if
cpu->cpu_as_root is set, e.g.:
/* 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.
*/
memory_region_add_subregion_overlap(cpu->cpu_as_root ?:
get_system_memory(),
apic->apicbase &
MSR_IA32_APICBASE_BASE,
&apic->io_memory,
0x1000);
--
Eduardo
next prev parent reply other threads:[~2015-08-26 15:49 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-19 9:36 [Qemu-devel] [RESEND PATCH v9 0/4] remove icc bus/bridge Zhu Guihua
2015-08-19 9:36 ` [Qemu-devel] [RESEND PATCH v9 1/4] apic: map APIC's MMIO region at each CPU's address space Zhu Guihua
2015-08-21 22:54 ` Eduardo Habkost
2015-08-24 0:55 ` Paolo Bonzini
2015-08-24 14:56 ` Peter Maydell
2015-08-26 14:59 ` Eduardo Habkost
2015-08-26 15:27 ` Paolo Bonzini
2015-08-26 15:49 ` Eduardo Habkost [this message]
2015-08-27 8:18 ` Zhu Guihua
2015-08-19 9:36 ` [Qemu-devel] [RESEND PATCH v9 2/4] x86: use new method to correct reset sequence Zhu Guihua
2015-08-21 22:57 ` Eduardo Habkost
2015-08-19 9:36 ` [Qemu-devel] [RESEND PATCH v9 3/4] cpu/apic: drop icc bus/bridge Zhu Guihua
2015-08-19 9:36 ` [Qemu-devel] [RESEND PATCH v9 4/4] icc_bus: drop the unused files Zhu Guihua
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=20150826154904.GG4230@thinpad.lan.raisama.net \
--to=ehabkost@redhat.com \
--cc=afaerber@suse.de \
--cc=chen.fan.fnst@cn.fujitsu.com \
--cc=imammedo@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--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 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.