All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antonios Motakis <antonios.motakis@huawei.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Christoffer Dall <christoffer.dall@linaro.org>
Cc: <kvmarm@lists.cs.columbia.edu>, <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <kvm@vger.kernel.org>,
	"Claudio Fontana" <claudio.fontana@huawei.com>,
	<jani.kokkonen@huawei.com>
Subject: Re: [PATCH 00/13] arm64: Virtualization Host Extension support
Date: Wed, 26 Aug 2015 11:28:47 +0200	[thread overview]
Message-ID: <55DD86CF.70309@huawei.com> (raw)
In-Reply-To: <55DD851B.4040106@siemens.com>



On 26-Aug-15 11:21, Jan Kiszka wrote:
> On 2015-08-26 11:12, Antonios Motakis wrote:
>> Hello Marc,
>>
>> On 08-Jul-15 18:19, Marc Zyngier wrote:
>>> ARMv8.1 comes with the "Virtualization Host Extension" (VHE for
>>> short), which enables simpler support of Type-2 hypervisors.
>>>
>>> This extension allows the kernel to directly run at EL2, and
>>> significantly reduces the number of system registers shared between
>>> host and guest, reducing the overhead of virtualization.
>>>
>>> In order to have the same kernel binary running on all versions of the
>>> architecture, this series makes heavy use of runtime code patching.
>>>
>>> The first ten patches massage the KVM code to deal with VHE and enable
>>> Linux to run at EL2.
>>
>> I am currently working on getting the Jailhouse hypervisor to work on AArch64.
>>
>> I've been looking at your patches, trying to figure out the implications for Jailhouse. It seems there are a few :)
>>
>> Jailhouse likes to be loaded by Linux into memory, and then to inject itself at a higher level than Linux (demoting Linux into being the "root cell"). This works on x86 and ARM (AArch32 and eventually AArch64 without VHE). What this means in ARM, is that Jailhouse hooks into the HVC stub exposed by Linux, and happily installs itself in EL2.
>>
>> With Linux running in EL2 though, that won't be as straightforward. It looks like we can't just demote Linux to EL1 without breaking something. Obviously it's OK for us that KVM won't work, but it looks like at least the timer code will break horribly if we try to do something like that.
>>
>> Any comments on this? One work around would be to just remap the incoming interrupt from the timer, so Linux never really realizes it's not running in EL2 anymore. Then we would also have to deal with the intricacies of removing and re-adding vCPUs to the Linux root cell, so we would have to maintain the illusion of running in EL2 for each one of them.
> 
> Without knowing any of the details, I would say there are two strategies
> regarding this:
> 
> - Disable KVM support in the Linux kernel - then we shouldn't boot into
>   EL2 in the first place, should we?

We would have to ask the user to patch the kernel, to ignore VHE and keep all the hyp stub magic that we rely on currently. It is an option of course.

> 
> - Emulate what Linux is missing after take-over by Jailhouse (we do
>   this on x86 with VT-d interrupt remapping which cannot be disabled
>   anymore for Linux once it started with it, and we cannot boot without
>   it when we want to use the x2APIC).

Essentially what I described above; let's call it nested virtualization without the virtualization parts? :)

> 
> Jan
> 

-- 
Antonios Motakis
Virtualization Engineer
Huawei Technologies Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 München


WARNING: multiple messages have this Message-ID (diff)
From: Antonios Motakis <antonios.motakis@huawei.com>
To: Jan Kiszka <jan.kiszka@siemens.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will.deacon@arm.com>,
	Christoffer Dall <christoffer.dall@linaro.org>
Cc: kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org,
	Claudio Fontana <claudio.fontana@huawei.com>,
	jani.kokkonen@huawei.com
Subject: Re: [PATCH 00/13] arm64: Virtualization Host Extension support
Date: Wed, 26 Aug 2015 11:28:47 +0200	[thread overview]
Message-ID: <55DD86CF.70309@huawei.com> (raw)
In-Reply-To: <55DD851B.4040106@siemens.com>



On 26-Aug-15 11:21, Jan Kiszka wrote:
> On 2015-08-26 11:12, Antonios Motakis wrote:
>> Hello Marc,
>>
>> On 08-Jul-15 18:19, Marc Zyngier wrote:
>>> ARMv8.1 comes with the "Virtualization Host Extension" (VHE for
>>> short), which enables simpler support of Type-2 hypervisors.
>>>
>>> This extension allows the kernel to directly run at EL2, and
>>> significantly reduces the number of system registers shared between
>>> host and guest, reducing the overhead of virtualization.
>>>
>>> In order to have the same kernel binary running on all versions of the
>>> architecture, this series makes heavy use of runtime code patching.
>>>
>>> The first ten patches massage the KVM code to deal with VHE and enable
>>> Linux to run at EL2.
>>
>> I am currently working on getting the Jailhouse hypervisor to work on AArch64.
>>
>> I've been looking at your patches, trying to figure out the implications for Jailhouse. It seems there are a few :)
>>
>> Jailhouse likes to be loaded by Linux into memory, and then to inject itself at a higher level than Linux (demoting Linux into being the "root cell"). This works on x86 and ARM (AArch32 and eventually AArch64 without VHE). What this means in ARM, is that Jailhouse hooks into the HVC stub exposed by Linux, and happily installs itself in EL2.
>>
>> With Linux running in EL2 though, that won't be as straightforward. It looks like we can't just demote Linux to EL1 without breaking something. Obviously it's OK for us that KVM won't work, but it looks like at least the timer code will break horribly if we try to do something like that.
>>
>> Any comments on this? One work around would be to just remap the incoming interrupt from the timer, so Linux never really realizes it's not running in EL2 anymore. Then we would also have to deal with the intricacies of removing and re-adding vCPUs to the Linux root cell, so we would have to maintain the illusion of running in EL2 for each one of them.
> 
> Without knowing any of the details, I would say there are two strategies
> regarding this:
> 
> - Disable KVM support in the Linux kernel - then we shouldn't boot into
>   EL2 in the first place, should we?

We would have to ask the user to patch the kernel, to ignore VHE and keep all the hyp stub magic that we rely on currently. It is an option of course.

> 
> - Emulate what Linux is missing after take-over by Jailhouse (we do
>   this on x86 with VT-d interrupt remapping which cannot be disabled
>   anymore for Linux once it started with it, and we cannot boot without
>   it when we want to use the x2APIC).

Essentially what I described above; let's call it nested virtualization without the virtualization parts? :)

> 
> Jan
> 

-- 
Antonios Motakis
Virtualization Engineer
Huawei Technologies Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 München


WARNING: multiple messages have this Message-ID (diff)
From: antonios.motakis@huawei.com (Antonios Motakis)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/13] arm64: Virtualization Host Extension support
Date: Wed, 26 Aug 2015 11:28:47 +0200	[thread overview]
Message-ID: <55DD86CF.70309@huawei.com> (raw)
In-Reply-To: <55DD851B.4040106@siemens.com>



On 26-Aug-15 11:21, Jan Kiszka wrote:
> On 2015-08-26 11:12, Antonios Motakis wrote:
>> Hello Marc,
>>
>> On 08-Jul-15 18:19, Marc Zyngier wrote:
>>> ARMv8.1 comes with the "Virtualization Host Extension" (VHE for
>>> short), which enables simpler support of Type-2 hypervisors.
>>>
>>> This extension allows the kernel to directly run at EL2, and
>>> significantly reduces the number of system registers shared between
>>> host and guest, reducing the overhead of virtualization.
>>>
>>> In order to have the same kernel binary running on all versions of the
>>> architecture, this series makes heavy use of runtime code patching.
>>>
>>> The first ten patches massage the KVM code to deal with VHE and enable
>>> Linux to run at EL2.
>>
>> I am currently working on getting the Jailhouse hypervisor to work on AArch64.
>>
>> I've been looking at your patches, trying to figure out the implications for Jailhouse. It seems there are a few :)
>>
>> Jailhouse likes to be loaded by Linux into memory, and then to inject itself at a higher level than Linux (demoting Linux into being the "root cell"). This works on x86 and ARM (AArch32 and eventually AArch64 without VHE). What this means in ARM, is that Jailhouse hooks into the HVC stub exposed by Linux, and happily installs itself in EL2.
>>
>> With Linux running in EL2 though, that won't be as straightforward. It looks like we can't just demote Linux to EL1 without breaking something. Obviously it's OK for us that KVM won't work, but it looks like at least the timer code will break horribly if we try to do something like that.
>>
>> Any comments on this? One work around would be to just remap the incoming interrupt from the timer, so Linux never really realizes it's not running in EL2 anymore. Then we would also have to deal with the intricacies of removing and re-adding vCPUs to the Linux root cell, so we would have to maintain the illusion of running in EL2 for each one of them.
> 
> Without knowing any of the details, I would say there are two strategies
> regarding this:
> 
> - Disable KVM support in the Linux kernel - then we shouldn't boot into
>   EL2 in the first place, should we?

We would have to ask the user to patch the kernel, to ignore VHE and keep all the hyp stub magic that we rely on currently. It is an option of course.

> 
> - Emulate what Linux is missing after take-over by Jailhouse (we do
>   this on x86 with VT-d interrupt remapping which cannot be disabled
>   anymore for Linux once it started with it, and we cannot boot without
>   it when we want to use the x2APIC).

Essentially what I described above; let's call it nested virtualization without the virtualization parts? :)

> 
> Jan
> 

-- 
Antonios Motakis
Virtualization Engineer
Huawei Technologies Duesseldorf GmbH
European Research Center
Riesstrasse 25, 80992 M?nchen

  reply	other threads:[~2015-08-26  9:29 UTC|newest]

Thread overview: 118+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 16:19 [PATCH 00/13] arm64: Virtualization Host Extension support Marc Zyngier
2015-07-08 16:19 ` Marc Zyngier
2015-07-08 16:19 ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 01/13] arm/arm64: Add new is_kernel_in_hyp_mode predicate Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-09  9:42   ` Mark Rutland
2015-07-09  9:42     ` Mark Rutland
2015-07-09  9:42     ` Mark Rutland
2015-07-09 10:05     ` Marc Zyngier
2015-07-09 10:05       ` Marc Zyngier
2015-07-09 10:05       ` Marc Zyngier
2015-07-09 10:12       ` Mark Rutland
2015-07-09 10:12         ` Mark Rutland
2015-07-09 10:12         ` Mark Rutland
2015-07-16 18:08   ` Will Deacon
2015-07-16 18:08     ` Will Deacon
2015-07-16 18:08     ` Will Deacon
2015-07-08 16:19 ` [PATCH 02/13] arm64: Allow the arch timer to use the HYP timer Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 03/13] arm64: Add ARM64_HAS_VIRT_HOST_EXTN feature Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-09  9:48   ` Mark Rutland
2015-07-09  9:48     ` Mark Rutland
2015-07-09  9:48     ` Mark Rutland
2015-07-09  9:59     ` Marc Zyngier
2015-07-09  9:59       ` Marc Zyngier
2015-07-09  9:59       ` Marc Zyngier
2015-07-16 18:04   ` Will Deacon
2015-07-16 18:04     ` Will Deacon
2015-07-16 18:04     ` Will Deacon
2015-07-08 16:19 ` [PATCH 04/13] arm64: KVM: skip HYP setup when already running in HYP Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 05/13] arm64: KVM: VHE: macroize VTCR_EL2 setup Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 06/13] arm64: KVM: VHE: Patch out kern_hyp_va Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 07/13] arm64: KVM: VHE: Patch out use of HVC Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 17:14   ` Paolo Bonzini
2015-07-08 17:14     ` Paolo Bonzini
2015-07-08 17:14     ` Paolo Bonzini
2015-07-08 17:54     ` Marc Zyngier
2015-07-08 17:54       ` Marc Zyngier
2015-07-08 17:54       ` Marc Zyngier
2015-07-10 11:02       ` Paolo Bonzini
2015-07-10 11:02         ` Paolo Bonzini
2015-07-10 11:02         ` Paolo Bonzini
2015-08-05 17:57   ` Catalin Marinas
2015-08-05 17:57     ` Catalin Marinas
2015-07-08 16:19 ` [PATCH 08/13] arm64: KVM: VHE: Preserve VHE config in world switch Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19 ` [PATCH 09/13] arm64: KVM: VHE: Add alternatives for VHE-enabled world-switch Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-09  1:29   ` Mario Smarduch
2015-07-09  1:29     ` Mario Smarduch
2015-07-09  8:06     ` Marc Zyngier
2015-07-09  8:06       ` Marc Zyngier
2015-07-09  8:06       ` Marc Zyngier
2015-07-09 20:58       ` Mario Smarduch
2015-07-09 20:58         ` Mario Smarduch
2015-07-09 20:58         ` Mario Smarduch
2015-08-31 18:46   ` Christoffer Dall
2015-08-31 18:46     ` Christoffer Dall
2015-07-08 16:19 ` [PATCH 10/13] arm64: Add support for running Linux in EL2 mode Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-16 17:48   ` Will Deacon
2015-07-16 17:48     ` Will Deacon
2015-07-16 17:48     ` Will Deacon
2015-07-08 16:19 ` [PATCH 11/13] arm64: Panic when VHE and non VHE CPUs coexist Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-16 18:03   ` Will Deacon
2015-07-16 18:03     ` Will Deacon
2015-07-16 18:03     ` Will Deacon
2015-08-06 14:08   ` Catalin Marinas
2015-08-06 14:08     ` Catalin Marinas
2015-08-06 14:08     ` Catalin Marinas
2015-07-08 16:19 ` [PATCH 12/13] arm64: KVM: Split sysreg save/restore Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-08-31 18:49   ` Christoffer Dall
2015-08-31 18:49     ` Christoffer Dall
2015-07-08 16:19 ` [PATCH 13/13] arm64: KVM: VHE: Early interrupt handling Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-07-08 16:19   ` Marc Zyngier
2015-08-31 18:52   ` Christoffer Dall
2015-08-31 18:52     ` Christoffer Dall
2015-08-06 17:43 ` [PATCH 00/13] arm64: Virtualization Host Extension support Catalin Marinas
2015-08-06 17:43   ` Catalin Marinas
2015-08-26  9:12 ` Antonios Motakis
2015-08-26  9:12   ` Antonios Motakis
2015-08-26  9:12   ` Antonios Motakis
2015-08-26  9:21   ` Jan Kiszka
2015-08-26  9:21     ` Jan Kiszka
2015-08-26  9:28     ` Antonios Motakis [this message]
2015-08-26  9:28       ` Antonios Motakis
2015-08-26  9:28       ` Antonios Motakis
2015-08-26  9:54       ` Jan Kiszka
2015-08-26  9:54         ` Jan Kiszka
2015-08-26  9:54         ` Jan Kiszka
2015-08-26  9:59     ` Marc Zyngier
2015-08-26  9:59       ` Marc Zyngier
2015-08-26  9:59       ` Marc Zyngier
2015-08-26 11:16       ` Antonios Motakis
2015-08-26 11:16         ` Antonios Motakis
2015-08-26 11:16         ` Antonios Motakis
2015-08-28  7:04         ` Marc Zyngier
2015-08-28  7:04           ` Marc Zyngier
2015-08-28  7:04           ` 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=55DD86CF.70309@huawei.com \
    --to=antonios.motakis@huawei.com \
    --cc=catalin.marinas@arm.com \
    --cc=christoffer.dall@linaro.org \
    --cc=claudio.fontana@huawei.com \
    --cc=jan.kiszka@siemens.com \
    --cc=jani.kokkonen@huawei.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=will.deacon@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.