mbox series

[0/5] KVM: arm64: Miscellaneous improvements

Message ID 20201201150157.223625-1-alexandru.elisei@arm.com (mailing list archive)
Headers show
Series KVM: arm64: Miscellaneous improvements | expand

Message

Alexandru Elisei Dec. 1, 2020, 3:01 p.m. UTC
The documentation update in the first patch was suggested by Marc [1]. When
I was going through the code to track down all the places error codes were
coming from I noticed a few things that in my opinion could be improved.
The following patches aim to do just that. I'm fine dropping them if the
churn looks unjustified.

Tested the Documentation changes by building pdfdocs, didn't notice any
warnings regarding api.rst.

Tested the other patches on a rockpro64 on the little cores. I ran
kvm-unit-tests with qemu and kvmtool. I also ran a Linux guest with qemu
and ran perf:

$ perf record -a -- iperf3 -c 127.0.0.1 -t 60

I checked that interrupts were firing and nothing looked out of the
ordinary. I used qemu because qemu VCPUs do initialization concurrently
from their own thread, not from the main thread like kvmtool.

To check that kvm_timer_enable() is never reached if the VGIC is not
initialized, I hacked kvmtool to remove the ioctl
KVM_DEV_ARM_VGIC_GRP_CTRL(KVM_DEV_ARM_VGIC_CTRL_INIT) from gic__init_gic().
When trying to run a guest, I got the following error message:

KVM_RUN failed: Device or resource busy

which is consistent with the EBUSY return code from
vgic_v3_map_resources(). Double checked that that's where the code is
coming from by adding a pr_info statement to
kvm_arch_vcpu_first_run_init().

[1] https://www.spinics.net/lists/arm-kernel/msg858024.html

Alexandru Elisei (5):
  KVM: Documentation: Add arm64 KVM_RUN error codes
  KVM: arm64: arch_timer: Remove VGIC initialization check
  KVM: arm64: Move double-checked lock to kvm_vgic_map_resources()
  KVM: arm64: Update comment in kvm_vgic_map_resources()
  KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()

 Documentation/virt/kvm/api.rst  | 9 +++++++--
 arch/arm64/kvm/arch_timer.c     | 3 ---
 arch/arm64/kvm/arm.c            | 8 +++-----
 arch/arm64/kvm/pmu-emul.c       | 2 --
 arch/arm64/kvm/vgic/vgic-init.c | 9 ++++++++-
 arch/arm64/kvm/vgic/vgic-v2.c   | 3 ---
 arch/arm64/kvm/vgic/vgic-v3.c   | 3 ---
 7 files changed, 18 insertions(+), 19 deletions(-)

Comments

Marc Zyngier Dec. 27, 2020, 2:41 p.m. UTC | #1
On Tue, 1 Dec 2020 15:01:52 +0000, Alexandru Elisei wrote:
> The documentation update in the first patch was suggested by Marc [1]. When
> I was going through the code to track down all the places error codes were
> coming from I noticed a few things that in my opinion could be improved.
> The following patches aim to do just that. I'm fine dropping them if the
> churn looks unjustified.
> 
> Tested the Documentation changes by building pdfdocs, didn't notice any
> warnings regarding api.rst.
> 
> [...]

Applied to next, thanks!

[1/5] KVM: Documentation: Add arm64 KVM_RUN error codes
      commit: 3557ae187c32203d1bb8b48ee1e2e7bdb23d98d5
[2/5] KVM: arm64: arch_timer: Remove VGIC initialization check
      commit: f16570ba47ff2b3766ebeaba6f4b80ad48cfd6a1
[3/5] KVM: arm64: Move double-checked lock to kvm_vgic_map_resources()
      commit: 1c91f06d296de4f0c27022f5ec464e047d471215
[4/5] KVM: arm64: Update comment in kvm_vgic_map_resources()
      commit: 9e5c23b9bd71d00b07720b2a8037b019d356e9df
[5/5] KVM: arm64: Remove redundant call to kvm_pmu_vcpu_reset()
      commit: 282ff80135717cc43f1e33ddd4b0cd9e760d060b

Cheers,

	M.