mbox series

[RFC,0/5] QEMU v7.2.0 aarch64 Nested Virtualization Support

Message ID 20230227163718.62003-1-miguel.luis@oracle.com (mailing list archive)
Headers show
Series QEMU v7.2.0 aarch64 Nested Virtualization Support | expand

Message

Miguel Luis Feb. 27, 2023, 4:37 p.m. UTC
This series adds ARMv8.3/8.4 nested virtualization support in KVM mode.
    
To enable nested virtualization for a guest, the host must expose EL2
support via QEMU command line switches:

-machine virt,accel=kvm,virtualization=on

Inspired on Haibo Xu's previous work [0][1], Marc Zyngier's kvmtool branch [2]
and kernel patches [3] on nested virtualization for aarch64, this has been
tested on an Ampere implementation.

This series adapts previous work on top of v7.2.0, it considers comments given
at the time and preserves authorship of the original patches.

[0]: https://lore.kernel.org/qemu-devel/cover.1616052889.git.haibo.xu@linaro.org/
[1]: https://lore.kernel.org/qemu-devel/cover.1617281290.git.haibo.xu@linaro.org/
[2]: https://git.kernel.org/pub/scm/linux/kernel/git/maz/kvmtool.git/log/?h=arm64/nv-5.16
[3]: https://lore.kernel.org/linux-arm-kernel/20230131092504.2880505-1-maz@kernel.org/

Miguel Luis (5):
  linux-headers: [kvm,arm64] add the necessary definitions to match host
    kernel
  hw/intc/gicv3: add support for setting KVM vGIC maintenance IRQ
  target/arm/kvm: add helper to detect EL2 when using KVM
  target/arm: enable feature ARM_FEATURE_EL2 if EL2 is supported
  arm/virt: provide virtualization extensions to the guest

 hw/arm/virt.c                      |  8 +++++++-
 hw/intc/arm_gicv3_common.c         |  1 +
 hw/intc/arm_gicv3_kvm.c            | 25 +++++++++++++++++++++++++
 include/hw/intc/arm_gicv3_common.h |  1 +
 linux-headers/asm-arm64/kvm.h      |  2 ++
 linux-headers/linux/kvm.h          |  1 +
 target/arm/cpu.h                   |  2 +-
 target/arm/kvm64.c                 | 21 +++++++++++++++++++++
 target/arm/kvm_arm.h               | 12 ++++++++++++
 9 files changed, 71 insertions(+), 2 deletions(-)

Comments

Eric Auger Feb. 8, 2024, 4:55 p.m. UTC | #1
Hi Miguel,

On 2/27/23 17:37, Miguel Luis wrote:
> This series adds ARMv8.3/8.4 nested virtualization support in KVM mode.
>     
> To enable nested virtualization for a guest, the host must expose EL2
> support via QEMU command line switches:
> 
> -machine virt,accel=kvm,virtualization=on
> 
> Inspired on Haibo Xu's previous work [0][1], Marc Zyngier's kvmtool branch [2]
> and kernel patches [3] on nested virtualization for aarch64, this has been
> tested on an Ampere implementation.
> 
> This series adapts previous work on top of v7.2.0, it considers comments given
> at the time and preserves authorship of the original patches.
> 
> [0]: https://lore.kernel.org/qemu-devel/cover.1616052889.git.haibo.xu@linaro.org/
> [1]: https://lore.kernel.org/qemu-devel/cover.1617281290.git.haibo.xu@linaro.org/
> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/maz/kvmtool.git/log/?h=arm64/nv-5.16
> [3]: https://lore.kernel.org/linux-arm-kernel/20230131092504.2880505-1-maz@kernel.org/

I rebased the series on top of v8.2. I was able to boot some L2 guests
with it, although it still does not work with guests featuring edk2.

Do you plan to send a respin or may I do?

Thanks

Eric
> 
> Miguel Luis (5):
>   linux-headers: [kvm,arm64] add the necessary definitions to match host
>     kernel
>   hw/intc/gicv3: add support for setting KVM vGIC maintenance IRQ
>   target/arm/kvm: add helper to detect EL2 when using KVM
>   target/arm: enable feature ARM_FEATURE_EL2 if EL2 is supported
>   arm/virt: provide virtualization extensions to the guest
> 
>  hw/arm/virt.c                      |  8 +++++++-
>  hw/intc/arm_gicv3_common.c         |  1 +
>  hw/intc/arm_gicv3_kvm.c            | 25 +++++++++++++++++++++++++
>  include/hw/intc/arm_gicv3_common.h |  1 +
>  linux-headers/asm-arm64/kvm.h      |  2 ++
>  linux-headers/linux/kvm.h          |  1 +
>  target/arm/cpu.h                   |  2 +-
>  target/arm/kvm64.c                 | 21 +++++++++++++++++++++
>  target/arm/kvm_arm.h               | 12 ++++++++++++
>  9 files changed, 71 insertions(+), 2 deletions(-)
>
Miguel Luis Feb. 8, 2024, 5:33 p.m. UTC | #2
Hi Eric,

> On 8 Feb 2024, at 15:55, Eric Auger <eauger@redhat.com> wrote:
> 
> Hi Miguel,
> 
> On 2/27/23 17:37, Miguel Luis wrote:
>> This series adds ARMv8.3/8.4 nested virtualization support in KVM mode.
>> 
>> To enable nested virtualization for a guest, the host must expose EL2
>> support via QEMU command line switches:
>> 
>> -machine virt,accel=kvm,virtualization=on
>> 
>> Inspired on Haibo Xu's previous work [0][1], Marc Zyngier's kvmtool branch [2]
>> and kernel patches [3] on nested virtualization for aarch64, this has been
>> tested on an Ampere implementation.
>> 
>> This series adapts previous work on top of v7.2.0, it considers comments given
>> at the time and preserves authorship of the original patches.
>> 
>> [0]: https://lore.kernel.org/qemu-devel/cover.1616052889.git.haibo.xu@linaro.org/
>> [1]: https://lore.kernel.org/qemu-devel/cover.1617281290.git.haibo.xu@linaro.org/
>> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/maz/kvmtool.git/log/?h=arm64/nv-5.16
>> [3]: https://lore.kernel.org/linux-arm-kernel/20230131092504.2880505-1-maz@kernel.org/
> 
> I rebased the series on top of v8.2. I was able to boot some L2 guests
> with it, although it still does not work with guests featuring edk2.
> 
> Do you plan to send a respin or may I do?
> 

I do not have a short-term respin planned.
Please, feel free to do.

Thanks

Miguel

> Thanks
> 
> Eric
>> 
>> Miguel Luis (5):
>>  linux-headers: [kvm,arm64] add the necessary definitions to match host
>>    kernel
>>  hw/intc/gicv3: add support for setting KVM vGIC maintenance IRQ
>>  target/arm/kvm: add helper to detect EL2 when using KVM
>>  target/arm: enable feature ARM_FEATURE_EL2 if EL2 is supported
>>  arm/virt: provide virtualization extensions to the guest
>> 
>> hw/arm/virt.c                      |  8 +++++++-
>> hw/intc/arm_gicv3_common.c         |  1 +
>> hw/intc/arm_gicv3_kvm.c            | 25 +++++++++++++++++++++++++
>> include/hw/intc/arm_gicv3_common.h |  1 +
>> linux-headers/asm-arm64/kvm.h      |  2 ++
>> linux-headers/linux/kvm.h          |  1 +
>> target/arm/cpu.h                   |  2 +-
>> target/arm/kvm64.c                 | 21 +++++++++++++++++++++
>> target/arm/kvm_arm.h               | 12 ++++++++++++
>> 9 files changed, 71 insertions(+), 2 deletions(-)
Eric Auger Feb. 8, 2024, 6:23 p.m. UTC | #3
Hi Miguel,

On 2/8/24 18:33, Miguel Luis wrote:
> Hi Eric,
> 
>> On 8 Feb 2024, at 15:55, Eric Auger <eauger@redhat.com> wrote:
>>
>> Hi Miguel,
>>
>> On 2/27/23 17:37, Miguel Luis wrote:
>>> This series adds ARMv8.3/8.4 nested virtualization support in KVM mode.
>>>
>>> To enable nested virtualization for a guest, the host must expose EL2
>>> support via QEMU command line switches:
>>>
>>> -machine virt,accel=kvm,virtualization=on
>>>
>>> Inspired on Haibo Xu's previous work [0][1], Marc Zyngier's kvmtool branch [2]
>>> and kernel patches [3] on nested virtualization for aarch64, this has been
>>> tested on an Ampere implementation.
>>>
>>> This series adapts previous work on top of v7.2.0, it considers comments given
>>> at the time and preserves authorship of the original patches.
>>>
>>> [0]: https://lore.kernel.org/qemu-devel/cover.1616052889.git.haibo.xu@linaro.org/
>>> [1]: https://lore.kernel.org/qemu-devel/cover.1617281290.git.haibo.xu@linaro.org/
>>> [2]: https://git.kernel.org/pub/scm/linux/kernel/git/maz/kvmtool.git/log/?h=arm64/nv-5.16
>>> [3]: https://lore.kernel.org/linux-arm-kernel/20230131092504.2880505-1-maz@kernel.org/
>>
>> I rebased the series on top of v8.2. I was able to boot some L2 guests
>> with it, although it still does not work with guests featuring edk2.
>>
>> Do you plan to send a respin or may I do?
>>
> 
> I do not have a short-term respin planned.
> Please, feel free to do.

OK thanks. I will send it tomorrow.

Eric
> 
> Thanks
> 
> Miguel
> 
>> Thanks
>>
>> Eric
>>>
>>> Miguel Luis (5):
>>>  linux-headers: [kvm,arm64] add the necessary definitions to match host
>>>    kernel
>>>  hw/intc/gicv3: add support for setting KVM vGIC maintenance IRQ
>>>  target/arm/kvm: add helper to detect EL2 when using KVM
>>>  target/arm: enable feature ARM_FEATURE_EL2 if EL2 is supported
>>>  arm/virt: provide virtualization extensions to the guest
>>>
>>> hw/arm/virt.c                      |  8 +++++++-
>>> hw/intc/arm_gicv3_common.c         |  1 +
>>> hw/intc/arm_gicv3_kvm.c            | 25 +++++++++++++++++++++++++
>>> include/hw/intc/arm_gicv3_common.h |  1 +
>>> linux-headers/asm-arm64/kvm.h      |  2 ++
>>> linux-headers/linux/kvm.h          |  1 +
>>> target/arm/cpu.h                   |  2 +-
>>> target/arm/kvm64.c                 | 21 +++++++++++++++++++++
>>> target/arm/kvm_arm.h               | 12 ++++++++++++
>>> 9 files changed, 71 insertions(+), 2 deletions(-)
> 
>