kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Zyngier <marc.zyngier@arm.com>
To: Pavel Fedin <p.fedin@samsung.com>,
	"kvmarm@lists.cs.columbia.edu" <kvmarm@lists.cs.columbia.edu>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Cc: Christoffer Dall <christoffer.dall@linaro.org>,
	Eric Auger <eric.auger@linaro.org>
Subject: Re: [PATCH v2 3/3] KVM: arm64: Introduce default dummy save/restore functions
Date: Tue, 14 Jul 2015 13:28:42 +0100	[thread overview]
Message-ID: <55A5007A.4040802@arm.com> (raw)
In-Reply-To: <248fcfc798e243b618c5275eef8aa333253fd4da.1436874248.git.p.fedin@samsung.com>

On 14/07/15 13:06, Pavel Fedin wrote:
> Necessary for KVM without irqchip to function on ARM64. Allows to use
> software GICv2 emulation where hardware acceleration is not available.
> 
> Signed-off-by: Pavel Fedin <p.fedin@samsung.com>
> ---
>  arch/arm/include/asm/kvm_host.h   | 5 +++++
>  arch/arm64/include/asm/kvm_asm.h  | 1 +
>  arch/arm64/include/asm/kvm_host.h | 8 ++++++++
>  arch/arm64/kvm/vgic-v2-switch.S   | 5 +++++
>  virt/kvm/arm/vgic.c               | 2 ++
>  5 files changed, 21 insertions(+)
> 
> diff --git a/arch/arm/include/asm/kvm_host.h b/arch/arm/include/asm/kvm_host.h
> index d71607c..c469c95 100644
> --- a/arch/arm/include/asm/kvm_host.h
> +++ b/arch/arm/include/asm/kvm_host.h
> @@ -218,6 +218,11 @@ static inline int kvm_arch_dev_ioctl_check_extension(long ext)
>  	return 0;
>  }
>  
> +static inline void vgic_arch_pre_setup(void)
> +{
> +
> +}
> +
>  static inline void vgic_arch_setup(const struct vgic_params *vgic)
>  {
>  	BUG_ON(vgic->type != VGIC_V2);
> diff --git a/arch/arm64/include/asm/kvm_asm.h b/arch/arm64/include/asm/kvm_asm.h
> index 4f7310f..933a442 100644
> --- a/arch/arm64/include/asm/kvm_asm.h
> +++ b/arch/arm64/include/asm/kvm_asm.h
> @@ -132,6 +132,7 @@ extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu);
>  
>  extern u64 __vgic_v3_get_ich_vtr_el2(void);
>  
> +extern char __dummy_vgic_save_restore[];
>  extern char __save_vgic_v2_state[];
>  extern char __restore_vgic_v2_state[];
>  extern char __save_vgic_v3_state[];
> diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
> index f0f58c9..b322895 100644
> --- a/arch/arm64/include/asm/kvm_host.h
> +++ b/arch/arm64/include/asm/kvm_host.h
> @@ -221,6 +221,14 @@ struct vgic_sr_vectors {
>  	void	*restore_vgic;
>  };
>  
> +static inline void vgic_arch_pre_setup(void)
> +{
> +	extern struct vgic_sr_vectors __vgic_sr_vectors;
> +
> +	__vgic_sr_vectors.save_vgic	= __dummy_vgic_save_restore;
> +	__vgic_sr_vectors.restore_vgic	= __dummy_vgic_save_restore;
> +}
> +

You may want to check commit 8a14849, which makes this whole patch
irrelevant.

Also, we do check whether or not the GIC is enabled for a given VM, and
not touching the registers if they are not. What is wrong with that?

	M.
-- 
Jazz is not dead. It just smells funny...

  reply	other threads:[~2015-07-14 12:28 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 12:06 [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip Pavel Fedin
2015-07-14 12:06 ` [PATCH v2 1/3] KVM: arm: Fix NULL pointer dereference if KVM is used " Pavel Fedin
2015-07-17 16:47   ` Marc Zyngier
2015-07-19 14:19     ` Pavel Fedin
2015-07-14 12:06 ` [PATCH v2 2/3] KVM: arm: Detect vGIC presence at runtime Pavel Fedin
2015-07-17 17:14   ` Marc Zyngier
2015-07-14 12:06 ` [PATCH v2 3/3] KVM: arm64: Introduce default dummy save/restore functions Pavel Fedin
2015-07-14 12:28   ` Marc Zyngier [this message]
2015-07-14 13:02     ` Pavel Fedin
2015-07-16 13:30       ` Christoffer Dall
2015-07-14 14:15     ` Pavel Fedin
2015-07-17 16:59 ` [PATCH v2 0/3] KVM: arm/arm64: Allow to use KVM without in-kernel irqchip Marc Zyngier
2015-07-19 14:05   ` Pavel Fedin
2015-07-20  8:08     ` Marc Zyngier
2015-07-22  7:19       ` Pavel Fedin
2015-07-23 16:48         ` Marc Zyngier
2015-07-24 15:27           ` Pavel Fedin
2015-07-24 16:06             ` Marc Zyngier
2015-07-26 12:50               ` Pavel Fedin
2015-07-27  7:28                 ` Marc Zyngier
2015-07-27  8:36                   ` Pavel Fedin
2015-07-27  9:02                     ` Marc Zyngier

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=55A5007A.4040802@arm.com \
    --to=marc.zyngier@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=eric.auger@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=p.fedin@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).