All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Murray <andrew.murray@arm.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 0/3] arm64: KVM: Allow direct function calls on VHE
Date: Wed, 9 Jan 2019 14:11:36 +0000	[thread overview]
Message-ID: <20190109141135.GG56789@e119886-lin.cambridge.arm.com> (raw)
In-Reply-To: <20190109135435.178664-1-marc.zyngier@arm.com>

On Wed, Jan 09, 2019 at 01:54:32PM +0000, Marc Zyngier wrote:
> It recently appeared that the nasty hack we use to call a HYP function
> on a non-VHE system has an interesting side effect on VHE: We wrap any
> such call into a hypercall, losing any form of type checking between
> the caller and the callee.
> 
> This isn't a big deal if you can guarantee to write code that is
> always 100% correct, but it appears that I'm not you.
> 
> In order to restore some sanity, let's use the following property: On
> a VHE system, it is always possible to call any function directly as
> they live in the same address space. We can thus always emit a direct
> call, and use a static key to flip from one to the other. As a bonus,
> this also sanitizes !VHE systems as we always generate code for noth

s/noth/both/g

Andrew Murray

> revisions of the architecture.
> 
> Marc Zyngier (3):
>   arm/arm64: KVM: Introduce kvm_call_hyp_ret()
>   arm64: KVM: Allow for direct call of HYP functions when using VHE
>   arm64: KVM: Drop VHE-specific HYP call stub
> 
>  arch/arm/include/asm/kvm_host.h   |  3 +++
>  arch/arm64/include/asm/kvm_host.h | 31 ++++++++++++++++++++++++++++++-
>  arch/arm64/kvm/debug.c            |  2 +-
>  arch/arm64/kvm/hyp.S              |  3 ---
>  arch/arm64/kvm/hyp/hyp-entry.S    | 12 ------------
>  virt/kvm/arm/arm.c                |  2 +-
>  virt/kvm/arm/vgic/vgic-v3.c       |  4 ++--
>  7 files changed, 37 insertions(+), 20 deletions(-)
> 
> -- 
> 2.20.1
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Murray <andrew.murray@arm.com>
To: Marc Zyngier <marc.zyngier@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org
Subject: Re: [PATCH 0/3] arm64: KVM: Allow direct function calls on VHE
Date: Wed, 9 Jan 2019 14:11:36 +0000	[thread overview]
Message-ID: <20190109141135.GG56789@e119886-lin.cambridge.arm.com> (raw)
In-Reply-To: <20190109135435.178664-1-marc.zyngier@arm.com>

On Wed, Jan 09, 2019 at 01:54:32PM +0000, Marc Zyngier wrote:
> It recently appeared that the nasty hack we use to call a HYP function
> on a non-VHE system has an interesting side effect on VHE: We wrap any
> such call into a hypercall, losing any form of type checking between
> the caller and the callee.
> 
> This isn't a big deal if you can guarantee to write code that is
> always 100% correct, but it appears that I'm not you.
> 
> In order to restore some sanity, let's use the following property: On
> a VHE system, it is always possible to call any function directly as
> they live in the same address space. We can thus always emit a direct
> call, and use a static key to flip from one to the other. As a bonus,
> this also sanitizes !VHE systems as we always generate code for noth

s/noth/both/g

Andrew Murray

> revisions of the architecture.
> 
> Marc Zyngier (3):
>   arm/arm64: KVM: Introduce kvm_call_hyp_ret()
>   arm64: KVM: Allow for direct call of HYP functions when using VHE
>   arm64: KVM: Drop VHE-specific HYP call stub
> 
>  arch/arm/include/asm/kvm_host.h   |  3 +++
>  arch/arm64/include/asm/kvm_host.h | 31 ++++++++++++++++++++++++++++++-
>  arch/arm64/kvm/debug.c            |  2 +-
>  arch/arm64/kvm/hyp.S              |  3 ---
>  arch/arm64/kvm/hyp/hyp-entry.S    | 12 ------------
>  virt/kvm/arm/arm.c                |  2 +-
>  virt/kvm/arm/vgic/vgic-v3.c       |  4 ++--
>  7 files changed, 37 insertions(+), 20 deletions(-)
> 
> -- 
> 2.20.1
> 
> _______________________________________________
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2019-01-09 14:11 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-09 13:54 [PATCH 0/3] arm64: KVM: Allow direct function calls on VHE Marc Zyngier
2019-01-09 13:54 ` Marc Zyngier
2019-01-09 13:54 ` [PATCH 1/3] arm/arm64: KVM: Introduce kvm_call_hyp_ret() Marc Zyngier
2019-01-09 13:54   ` Marc Zyngier
2019-01-09 13:54 ` [PATCH 2/3] arm64: KVM: Allow for direct call of HYP functions when using VHE Marc Zyngier
2019-01-09 13:54   ` Marc Zyngier
2019-01-09 14:24   ` Andrew Murray
2019-01-09 14:24     ` Andrew Murray
2019-01-09 14:45     ` Marc Zyngier
2019-01-09 14:45       ` Marc Zyngier
2019-01-09 14:51       ` Julien Thierry
2019-01-09 14:51         ` Julien Thierry
2019-01-09 14:52         ` Julien Thierry
2019-01-09 14:52           ` Julien Thierry
2019-01-09 16:01         ` Marc Zyngier
2019-01-09 16:01           ` Marc Zyngier
2019-01-09 16:04           ` Andrew Murray
2019-01-09 16:04             ` Andrew Murray
2019-01-09 13:54 ` [PATCH 3/3] arm64: KVM: Drop VHE-specific HYP call stub Marc Zyngier
2019-01-09 13:54   ` Marc Zyngier
2019-01-09 14:11 ` Andrew Murray [this message]
2019-01-09 14:11   ` [PATCH 0/3] arm64: KVM: Allow direct function calls on VHE Andrew Murray

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=20190109141135.GG56789@e119886-lin.cambridge.arm.com \
    --to=andrew.murray@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marc.zyngier@arm.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.