From: Joel Schopp <joel.schopp@amd.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
arm-mail-list <linux-arm-kernel@lists.infradead.org>,
"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
kvm-devel <kvm@vger.kernel.org>
Subject: Re: [PATCH v2 9/9] arm64: KVM: vgic: deal with GIC sub-page alignment
Date: Wed, 25 Jun 2014 14:34:51 -0500 [thread overview]
Message-ID: <53AB245B.8080409@amd.com> (raw)
In-Reply-To: <CAFEAcA-5CaE6T2JkNdf7M9t3LTqv05Um-nWbWjSDVbu_Bo+a2w@mail.gmail.com>
On 06/25/2014 12:34 PM, Peter Maydell wrote:
> On 25 June 2014 15:56, Joel Schopp <joel.schopp@amd.com> wrote:
>> On 06/24/2014 05:28 PM, Peter Maydell wrote:
>>> On 24 June 2014 20:28, Joel Schopp <joel.schopp@amd.com> wrote:
>>>> Does this mean there is a corresponding patch for qemu?
>>> Not as far as I know. It's a bit awkward on the QEMU end because
>>> we really want to provide the guest a consistent memory map
>>> regardless of the host CPU. So at best we'd probably use it to
>>> say "sorry, can't run on this CPU/host kernel".
>> I think most arm64 servers are going to run with 64k pages. It seems like a
>> major problem to have qemu not work on these systems.
> QEMU should already work fine on servers with 64K pages;
> you just need to have the host offset of the GICV within the 64K page
> and the guest offset of the GICC within the 64K page be the same
> (and at the moment both must also be zero, which I believe is true
> for all of them at the moment except possibly the AEM model;
> counterexamples welcome). Disclaimer: I haven't personally
> tested this, but on the other hand I don't think anybody's
> reported it as not working either.
It doesn't work for me. Maybe I'm doing something wrong, but I can't
see what. I am unique in that I'm running a gic-400 (gicv2m) on aarch64
hardware with 64k pages. I'm also unique in that my hardware maps each
4K gic entry to a 64K page (aliasing each 4k of gic 16 times in a 64K
page, ie the gic virtual ic is at 0xe1140000 and 0xe1141000 and
0xe1142000, etc). This is inline with appendix F of the server base
system architecture. This is inconvenient when the size is 0x2000
(8K). As a result all the offsets in the device tree entries are to the
last 4K in the page so that an 8K read will read the last 4k from one
page and the first 4k from the next and actually get 8k of the gic.
gic: interrupt-controller@e1101000 {
compatible = "arm,gic-400";
#interrupt-cells = <3>;
#address-cells = <0>;
interrupt-controller;
msi-controller;
reg = <0x0 0xe1110000 0 0x1000>, /* gic dist */
<0x0 0xe112f000 0 0x2000>, /* gic cpu */
<0x0 0xe114f000 0 0x2000>, /* gic virtual ic*/
<0x0 0xe116f000 0 0x2000>, /* gic virtual cpu*/
<0x0 0xe1180000 0 0x1000>; /* gic msi */
interrupts = <1 8 0xf04>;
};
My concern here is that if userspace is going to look at 8k starting at
the beginning of the page, guest offset 0 in your terminology, (say
0xe1140000) instead of starting at the last 4k of the page, offset
0xf000 (say 0xe114f000) it is going to get the second 4k wrong by
reading 0xe1141000 instead of 0xe1150000.
next prev parent reply other threads:[~2014-06-25 19:35 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-19 9:21 [PATCH v2 0/9] arm/arm64: KVM: dynamic VGIC sizing Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 1/9] KVM: ARM: vgic: plug irq injection race Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 2/9] arm/arm64: KVM: vgic: switch to dynamic allocation Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 3/9] arm/arm64: KVM: vgic: Parametrize VGIC_NR_SHARED_IRQS Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 4/9] arm/arm64: KVM: vgic: kill VGIC_MAX_CPUS Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 5/9] arm/arm64: KVM: vgic: handle out-of-range MMIO accesses Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 6/9] arm/arm64: KVM: vgic: kill VGIC_NR_IRQS Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 7/9] arm/arm64: KVM: vgic: delay vgic allocation until init time Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 8/9] arm/arm64: KVM: vgic: make number of irqs a configurable attribute Marc Zyngier
2014-06-19 9:21 ` [PATCH v2 9/9] arm64: KVM: vgic: deal with GIC sub-page alignment Marc Zyngier
2014-06-24 19:28 ` Joel Schopp
2014-06-24 22:28 ` Peter Maydell
2014-06-25 14:56 ` Joel Schopp
2014-06-25 15:00 ` Marc Zyngier
2014-06-25 15:09 ` Joel Schopp
2014-06-25 17:34 ` Peter Maydell
2014-06-25 19:34 ` Joel Schopp [this message]
2014-06-25 20:45 ` Peter Maydell
2014-06-25 21:18 ` Joel Schopp
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=53AB245B.8080409@amd.com \
--to=joel.schopp@amd.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.cs.columbia.edu \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=marc.zyngier@arm.com \
--cc=peter.maydell@linaro.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