All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Zyngier <maz@kernel.org>
To: "Lukas Jünger" <lukas.juenger@ice.rwth-aachen.de>
Cc: catalin.marinas@arm.com, will@kernel.org, kvmarm@lists.cs.columbia.edu
Subject: Re: KVM userspace GICv2 IRQ controller on platform with GICv3
Date: Mon, 04 Oct 2021 11:24:24 +0100	[thread overview]
Message-ID: <877detrstj.wl-maz@kernel.org> (raw)
In-Reply-To: <c3cff3de-61f6-0e19-6825-02c934dfbb76@ice.rwth-aachen.de>

Hi Lukas,

On Mon, 04 Oct 2021 11:07:47 +0100,
Lukas Jünger <lukas.juenger@ice.rwth-aachen.de> wrote:
> 
> Hello,
> 
> I am trying to run an emulator that uses KVM on arm64 to execute
> code. The emulator contains a userspace model of a GICv2 IRQ
> controller. The platform that I am running on (n1sdp) has a

N1-SDP? My condolences...

> GICv3. When I boot Linux in the emulator I run into
> gic_check_cpu_features()  in drivers/irqchip/irq-gic.c, which taints
> the kernel as the host uses system registers to communicate with the
> host GICv3. I saw that ICC_SRE_ELx can be used to force MMIO, but
> setting this from inside the VM did not work and using KVM_SET_ONE_REG
> failed with error.

N1-SDP doesn't implement the MMIO interface at all, and our GIC
emulation doesn't either. Both are valid implementations.

> 
> Is there a way to use a userspace GICv2 model with KVM on a GICv3 host
> without tainting?

The tainting happens because you have created a VM with a GICv3
irqchip (at some point, your VMM calls into KVM to create a device
with the KVM_DEV_TYPE_ARM_VGIC_V3 attribute). The guest then sees that
GICv3 is enabled (ICC_SRE_ELx.SRE==1), and yet you somehow expose a
GICv2 to the guest (either via DT or ACPI). That's illegal.

If you want a userspace interrupt controller, you need prevent the
creation of an in-kernel interrupt controller, which is a change in
your VMM or maybe a configuration change.

	M.

-- 
Without deviation from the norm, progress is not possible.
_______________________________________________
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

  reply	other threads:[~2021-10-04 10:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-04 10:07 KVM userspace GICv2 IRQ controller on platform with GICv3 Lukas Jünger
2021-10-04 10:24 ` Marc Zyngier [this message]
2021-10-04 10:30   ` Lukas Jünger
2021-10-04 11:02     ` Marc Zyngier
2021-10-04 11:27       ` Lukas Jünger
2021-10-04 13:11         ` Marc Zyngier
2021-10-04 14:15           ` Lukas Jünger
2021-10-04 15:48             ` Marc Zyngier
2021-10-05 12:06               ` Lukas Jünger

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=877detrstj.wl-maz@kernel.org \
    --to=maz@kernel.org \
    --cc=catalin.marinas@arm.com \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=lukas.juenger@ice.rwth-aachen.de \
    --cc=will@kernel.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 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.