All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Graf <agraf@suse.de>
To: Andrew Jones <drjones@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	kvm@vger.kernel.org, cdall@linaro.org, qemu-arm@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH v3] ARM: KVM: Enable in-kernel timers with user space gic
Date: Wed, 28 Jun 2017 14:36:17 +0200	[thread overview]
Message-ID: <9e3a0693-d69b-4ae7-c449-457f7428fbff@suse.de> (raw)
In-Reply-To: <20170628115110.nq7wdsrhxxjelzq6@kamzik.brq.redhat.com>



On 28.06.17 13:51, Andrew Jones wrote:
> On Tue, Jun 27, 2017 at 05:35:37PM +0200, Alexander Graf wrote:
>> When running with KVM enabled, you can choose between emulating the
>> gic in kernel or user space. If the kernel supports in-kernel virtualization
>> of the interrupt controller, it will default to that. If not, if will
>> default to user space emulation.
>>
>> Unfortunately when running in user mode gic emulation, we miss out on
>> interrupt events which are only available from kernel space, such as the timer.
>> This patch leverages the new kernel/user space pending line synchronization for
>> timer events. It does not handle PMU events yet.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> Reviewed-by: Andrew Jones <drjones@redhat.com>
>>
>> ---
>>
>> v1 -> v2:
>>
>>    - whitespace fixes
>>    - use !! to determine whether bit is set
>>    - call in-kernel device IRQs out by their name everywhere
>>
>> v2 -> v3:
>>
>>    - fix last occurence of calling out timer IRQs explicitly
>> ---
>>   accel/kvm/kvm-all.c    |  5 +++++
>>   accel/stubs/kvm-stub.c |  5 +++++
>>   hw/intc/arm_gic.c      |  7 +++++++
>>   include/sysemu/kvm.h   | 11 +++++++++++
>>   target/arm/cpu.h       |  3 +++
>>   target/arm/kvm.c       | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   6 files changed, 82 insertions(+)
>>
> 
> Tried testing this on a gicv3 machine, a ThunderX2. The guest kernel

Did you patch QEMU to automatically choose the gic version? The upstream 
default is to have gicv2 as the guest gic type. And gicv2 should work 
just fine.

I have seen issues with gicv3 emulation in user space, yes. I guess we 
don't have a channel to properly trap the MSRs into user space yet.


Alex

WARNING: multiple messages have this Message-ID (diff)
From: Alexander Graf <agraf@suse.de>
To: Andrew Jones <drjones@redhat.com>
Cc: qemu-devel@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
	kvm@vger.kernel.org, cdall@linaro.org, qemu-arm@nongnu.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v3] ARM: KVM: Enable in-kernel timers with user space gic
Date: Wed, 28 Jun 2017 14:36:17 +0200	[thread overview]
Message-ID: <9e3a0693-d69b-4ae7-c449-457f7428fbff@suse.de> (raw)
In-Reply-To: <20170628115110.nq7wdsrhxxjelzq6@kamzik.brq.redhat.com>



On 28.06.17 13:51, Andrew Jones wrote:
> On Tue, Jun 27, 2017 at 05:35:37PM +0200, Alexander Graf wrote:
>> When running with KVM enabled, you can choose between emulating the
>> gic in kernel or user space. If the kernel supports in-kernel virtualization
>> of the interrupt controller, it will default to that. If not, if will
>> default to user space emulation.
>>
>> Unfortunately when running in user mode gic emulation, we miss out on
>> interrupt events which are only available from kernel space, such as the timer.
>> This patch leverages the new kernel/user space pending line synchronization for
>> timer events. It does not handle PMU events yet.
>>
>> Signed-off-by: Alexander Graf <agraf@suse.de>
>> Reviewed-by: Andrew Jones <drjones@redhat.com>
>>
>> ---
>>
>> v1 -> v2:
>>
>>    - whitespace fixes
>>    - use !! to determine whether bit is set
>>    - call in-kernel device IRQs out by their name everywhere
>>
>> v2 -> v3:
>>
>>    - fix last occurence of calling out timer IRQs explicitly
>> ---
>>   accel/kvm/kvm-all.c    |  5 +++++
>>   accel/stubs/kvm-stub.c |  5 +++++
>>   hw/intc/arm_gic.c      |  7 +++++++
>>   include/sysemu/kvm.h   | 11 +++++++++++
>>   target/arm/cpu.h       |  3 +++
>>   target/arm/kvm.c       | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++
>>   6 files changed, 82 insertions(+)
>>
> 
> Tried testing this on a gicv3 machine, a ThunderX2. The guest kernel

Did you patch QEMU to automatically choose the gic version? The upstream 
default is to have gicv2 as the guest gic type. And gicv2 should work 
just fine.

I have seen issues with gicv3 emulation in user space, yes. I guess we 
don't have a channel to properly trap the MSRs into user space yet.


Alex

  reply	other threads:[~2017-06-28 12:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-27 15:35 [PATCH v3] ARM: KVM: Enable in-kernel timers with user space gic Alexander Graf
2017-06-27 15:35 ` [Qemu-devel] " Alexander Graf
2017-06-28 11:51 ` Andrew Jones
2017-06-28 11:51   ` [Qemu-devel] " Andrew Jones
2017-06-28 12:36   ` Alexander Graf [this message]
2017-06-28 12:36     ` Alexander Graf
2017-06-28 13:43     ` Andrew Jones
2017-06-29 15:22 ` Peter Maydell
2017-06-29 15:22   ` [Qemu-devel] " Peter Maydell

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=9e3a0693-d69b-4ae7-c449-457f7428fbff@suse.de \
    --to=agraf@suse.de \
    --cc=cdall@linaro.org \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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.