From: Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei•com>
To: "linux-arm-kernel@lists•infradead.org"
<linux-arm-kernel@lists•infradead.org>,
"kvmarm@lists•cs.columbia.edu" <kvmarm@lists•cs.columbia.edu>,
"linux-kernel@vger•kernel.org" <linux-kernel@vger•kernel.org>
Cc: "maz@kernel•org" <maz@kernel•org>,
"will@kernel•org" <will@kernel•org>,
"catalin.marinas@arm•com" <catalin.marinas@arm•com>,
"james.morse@arm•com" <james.morse@arm•com>,
"julien.thierry.kdev@gmail•com" <julien.thierry.kdev@gmail•com>,
"suzuki.poulose@arm•com" <suzuki.poulose@arm•com>,
"jean-philippe@linaro•org" <jean-philippe@linaro•org>,
"Alexandru.Elisei@arm•com" <Alexandru.Elisei@arm•com>,
"qperret@google•com" <qperret@google•com>,
Jonathan Cameron <jonathan.cameron@huawei•com>,
Linuxarm <linuxarm@huawei•com>
Subject: RE: [PATCH v4 0/4] kvm/arm: New VMID allocator based on asid
Date: Wed, 5 Jan 2022 13:25:13 +0000 [thread overview]
Message-ID: <d82034bb5c954de692a02bd13ccbf5d8@huawei.com> (raw)
In-Reply-To: <20211122121844.867-1-shameerali.kolothum.thodi@huawei.com>
Hi,
A gentle ping on this series. Please take a look and let me know the new approach
taken in this revision is good enough or not.
Appreciate your feedback.
Thanks,
Shameer
> -----Original Message-----
> From: linux-arm-kernel [mailto:linux-arm-kernel-bounces@lists•infradead.org]
> On Behalf Of Shameer Kolothum
> Sent: 22 November 2021 12:19
> To: linux-arm-kernel@lists•infradead.org; kvmarm@lists•cs.columbia.edu;
> linux-kernel@vger•kernel.org
> Cc: maz@kernel•org; will@kernel•org; catalin.marinas@arm•com;
> james.morse@arm•com; julien.thierry.kdev@gmail•com;
> suzuki.poulose@arm•com; jean-philippe@linaro•org;
> Alexandru.Elisei@arm•com; qperret@google•com; Jonathan Cameron
> <jonathan.cameron@huawei•com>; Linuxarm <linuxarm@huawei•com>
> Subject: [PATCH v4 0/4] kvm/arm: New VMID allocator based on asid
>
> Changes from v3:
> - Main change is in patch #4, where the VMID is now set to an
> invalid one on vCPU schedule out. Introduced an
> INVALID_ACTIVE_VMID which is basically a VMID 0 with generation 1.
> Since the basic allocator algorithm reserves vmid #0, it is never
> used as an active VMID. This (hopefully) will fix the issue of
> unnecessarily reserving VMID space with active_vmids when those
> VMs are no longer active[0] and at the same time address the
> problem noted in v3 wherein everything ends up in slow-path[1].
>
> Testing:
> -Run with VMID bit set to 4 and maxcpus to 8 on D06. The test
> involves running concurrently 50 guests with 4 vCPUs. Each
> guest will then execute hackbench 5 times before exiting.
> No crash was observed for a 4-day continuous run.
> The latest branch is here,
> https://github.com/hisilicon/kernel-dev/tree/private-v5.16-rc1-vmid-v4
>
> -TLA+ model. Modified the asidalloc model to incorporate the new
> VMID algo. The main differences are,
> -flush_tlb_all() instead of local_tlb_flush_all() on rollover.
> -Introduced INVALID_VMID and vCPU Sched Out logic.
> -No CnP (Removed UniqueASIDAllCPUs & UniqueASIDActiveTask invariants).
> -Removed UniqueVMIDPerCPU invariant for now as it looks like
> because of the speculative fetching with flush_tlb_all() there
> is a small window where this gets triggered. If I change the
> logic back to local_flush_tlb_all(), UniqueVMIDPerCPU seems to
> be fine. With my limited knowledge on TLA+ model, it is not
> clear to me whether this is a problem with the above logic
> or the VMID model implementation. Really appreciate any help
> with the model.
> The initial VMID TLA+ model is here,
> https://github.com/shamiali2008/kernel-tla/tree/private-vmidalloc-v1
>
> Please take a look and let me know.
>
> Thanks,
> Shameer
>
> [0]
> https://lore.kernel.org/kvmarm/20210721160614.GC11003@willie-the-truck/
> [1]
> https://lore.kernel.org/kvmarm/20210803114034.GB30853@willie-the-truck/
>
> History:
> --------
> v2 --> v3
> -Dropped adding a new static key and cpufeature for retrieving
> supported VMID bits. Instead, we now make use of the
> kvm_arm_vmid_bits variable (patch #2).
>
> -Since we expect less frequent rollover in the case of VMIDs,
> the TLB invalidation is now broadcasted on rollover instead
> of keeping per CPU flush_pending info and issuing a local
> context flush.
>
> -Clear active_vmids on vCPU schedule out to avoid unnecessarily
> reserving the VMID space(patch #3).
>
> -I have kept the struct kvm_vmid as it is for now(instead of a
> typedef as suggested), as we may soon add another variable to
> it when we introduce Pinned KVM VMID support.
>
> RFCv1 --> v2
> -Dropped "pinned VMID" support for now.
> -Dropped RFC tag.
> RFCv1
>
> https://lore.kernel.org/kvmarm/20210506165232.1969-1-shameerali.kolothu
> m.thodi@huawei•com/
>
> Julien Grall (1):
> KVM: arm64: Align the VMID allocation with the arm64 ASID
>
> Shameer Kolothum (3):
> KVM: arm64: Introduce a new VMID allocator for KVM
> KVM: arm64: Make VMID bits accessible outside of allocator
> KVM: arm64: Make active_vmids invalid on vCPU schedule out
>
> arch/arm64/include/asm/kvm_host.h | 10 +-
> arch/arm64/include/asm/kvm_mmu.h | 4 +-
> arch/arm64/kernel/image-vars.h | 3 +
> arch/arm64/kvm/Makefile | 2 +-
> arch/arm64/kvm/arm.c | 106 +++-----------
> arch/arm64/kvm/hyp/nvhe/mem_protect.c | 3 +-
> arch/arm64/kvm/mmu.c | 1 -
> arch/arm64/kvm/vmid.c | 196
> ++++++++++++++++++++++++++
> 8 files changed, 228 insertions(+), 97 deletions(-) create mode 100644
> arch/arm64/kvm/vmid.c
>
> --
> 2.17.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists•infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists•infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2022-01-05 13:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-22 12:18 [PATCH v4 0/4] kvm/arm: New VMID allocator based on asid Shameer Kolothum
2021-11-22 12:18 ` [PATCH v4 1/4] KVM: arm64: Introduce a new VMID allocator for KVM Shameer Kolothum
2022-01-21 7:35 ` Reiji Watanabe
2022-01-21 8:44 ` Shameerali Kolothum Thodi
2021-11-22 12:18 ` [PATCH v4 2/4] KVM: arm64: Make VMID bits accessible outside of allocator Shameer Kolothum
2021-11-22 12:18 ` [PATCH v4 3/4] KVM: arm64: Align the VMID allocation with the arm64 ASID Shameer Kolothum
2021-11-22 12:18 ` [PATCH v4 4/4] KVM: arm64: Make active_vmids invalid on vCPU schedule out Shameer Kolothum
2022-01-05 13:25 ` Shameerali Kolothum Thodi [this message]
2022-01-18 12:32 ` [PATCH v4 0/4] kvm/arm: New VMID allocator based on asid Catalin Marinas
2022-01-19 9:23 ` Shameerali Kolothum Thodi
2022-01-19 11:49 ` Catalin Marinas
2022-01-19 12:30 ` Shameerali Kolothum Thodi
2022-02-08 17:37 ` 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=d82034bb5c954de692a02bd13ccbf5d8@huawei.com \
--to=shameerali.kolothum.thodi@huawei$(echo .)com \
--cc=Alexandru.Elisei@arm$(echo .)com \
--cc=catalin.marinas@arm$(echo .)com \
--cc=james.morse@arm$(echo .)com \
--cc=jean-philippe@linaro$(echo .)org \
--cc=jonathan.cameron@huawei$(echo .)com \
--cc=julien.thierry.kdev@gmail$(echo .)com \
--cc=kvmarm@lists$(echo .)cs.columbia.edu \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linuxarm@huawei$(echo .)com \
--cc=maz@kernel$(echo .)org \
--cc=qperret@google$(echo .)com \
--cc=suzuki.poulose@arm$(echo .)com \
--cc=will@kernel$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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