Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp868042pxj; Wed, 16 Jun 2021 15:49:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkTCRvDXK+7FzuXA9h33R7fcmGolp30FzJQuMiz2g2+ou/UGS/Wikeprvx17onFYgHwvai X-Received: by 2002:a92:cc51:: with SMTP id t17mr1277562ilq.113.1623883796908; Wed, 16 Jun 2021 15:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623883796; cv=none; d=google.com; s=arc-20160816; b=qg9NR7OTRCF043OAP5AUt8qXLTE13D4v0pOfQU3HYOnDLXS+tKMUFPZMuzEaKatCwL vyxqCRVUfhoAxNxdAo6vL6r3auQSFJLYDdYgTBTkZLbgQYAXsZVwXt7uzSXQxTM/5Tos 3QCQPN3PtEZtq1YsoKNLbZXnz62NKXwyYQaRz6XHjLAY6UH7qam0YmnUezBH9bIkMXbq 4Y4qn1yw4/KjFdX1M9QgQbvPy0/7O4+4/RZe5rFspwe1RMGGeZp7NWLAX7ujiP/lHNzO MQYkgD1sJo+zA/SdISKOUmVh/GjkiopCPb745XsnZeNatDYkrXGKa718U3kqMZcQFozg xDFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=8n+g1//udLEkCpRvwUoQlccw9v7d6cEbAwTSe0EGbrU=; b=rHoz61JvR61Sj/kvSw9Qe15t9jzt1NYkf4x4s5upbHJLfzFt1mShxlESSIK/64wthg JN2dH+8gP3WQGiBoo8lpkY4PIxC9My6DMnISRhIkVlKLrfvGqLXr+bVjkSXmIxWGFuov 3XDoUVdWlCtikmLBw/nhNWOB5Jf82W28ZTEjBbRDtG29MmkO1ur+InM6H6Z4Coi0B2b/ O7Dk/guYh0km35zhbCMHf1+GfMqTc2X+rQF2g1znK6JOEsfODoofGLtPTV0JhBME39VV CxCXrQbmLFGCi922Hrvnnl6cNcD+MwOo/2+srVSI2nmCrVtPcxRskllr0wM4LDSf+cnr hnag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i26si3395190iol.73.2021.06.16.15.49.40; Wed, 16 Jun 2021 15:49:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234878AbhFPP7x (ORCPT + 99 others); Wed, 16 Jun 2021 11:59:53 -0400 Received: from frasgout.his.huawei.com ([185.176.79.56]:3252 "EHLO frasgout.his.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234961AbhFPP7R (ORCPT ); Wed, 16 Jun 2021 11:59:17 -0400 Received: from fraeml705-chm.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4G4qQ70ZBzz6G7NW; Wed, 16 Jun 2021 23:50:07 +0800 (CST) Received: from lhreml710-chm.china.huawei.com (10.201.108.61) by fraeml705-chm.china.huawei.com (10.206.15.54) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Wed, 16 Jun 2021 17:57:09 +0200 Received: from A2006125610.china.huawei.com (10.47.83.191) by lhreml710-chm.china.huawei.com (10.201.108.61) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Wed, 16 Jun 2021 16:57:02 +0100 From: Shameer Kolothum To: , , CC: , , , , , , , , Subject: [PATCH v2 0/3] kvm/arm: New VMID allocator based on asid Date: Wed, 16 Jun 2021 16:56:03 +0100 Message-ID: <20210616155606.2806-1-shameerali.kolothum.thodi@huawei.com> X-Mailer: git-send-email 2.12.0.windows.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.47.83.191] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To lhreml710-chm.china.huawei.com (10.201.108.61) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, RFCv1 --> v2 - Dropped "pinned VMID" support for now. - Dropped RFC tag. Sanity tested on HiSilicon D06 board. Thanks, Shameer History: ------- Please find the RFC series here, https://lore.kernel.org/kvmarm/20210506165232.1969-1-shameerali.kolothum.thodi@huawei.com/ From RFCv1: This is based on a suggestion from Will [0] to try out the asid based kvm vmid solution as a separate VMID allocator instead of the shared lib approach attempted in v4[1]. The idea is to compare both the approaches and see whether the shared lib solution with callbacks make sense or not. Though we are not using the pinned vmids yet, patch #2 has code for pinned vmid support. This is just to help the comparison. Test Setup/Results ---------------- The measurement was made with maxcpus set to 8 and with the number of VMID limited to 4-bit. The test involves running concurrently 40 guests with 2 vCPUs. Each guest will then execute hackbench 5 times before exiting. The performance difference between the current algo and the new one are(avg. of 10 runs): - 1.9% less entry/exit from the guest - 0.5% faster This is more or less comparable to v4 numbers. For the complete series, please see, https://github.com/hisilicon/kernel-dev/tree/private-v5.12-rc7-vmid-2nd-rfc and for the shared asid lib v4 solution, https://github.com/hisilicon/kernel-dev/tree/private-v5.12-rc7-asid-v4 As you can see there are ofcourse code duplication with this approach but may be it is more easy to maintain considering the complexity involved. [0] https://lore.kernel.org/lkml/20210422160846.GB2214@willie-the-truck/ [1] https://lore.kernel.org/lkml/20210414112312.13704-1-shameerali.kolothum.thodi@huawei.com/ Julien Grall (2): arch/arm64: Introduce a capability to tell whether 16-bit VMID is available kvm/arm: Align the VMID allocation with the arm64 ASID one Shameer Kolothum (1): kvm/arm: Introduce a new vmid allocator for KVM arch/arm64/include/asm/kvm_asm.h | 4 +- arch/arm64/include/asm/kvm_host.h | 10 +- arch/arm64/include/asm/kvm_mmu.h | 7 +- arch/arm64/kernel/cpufeature.c | 9 ++ arch/arm64/kvm/Makefile | 2 +- arch/arm64/kvm/arm.c | 115 ++++---------- arch/arm64/kvm/hyp/nvhe/hyp-main.c | 6 +- arch/arm64/kvm/hyp/nvhe/mem_protect.c | 3 +- arch/arm64/kvm/hyp/nvhe/tlb.c | 10 +- arch/arm64/kvm/hyp/vhe/tlb.c | 10 +- arch/arm64/kvm/mmu.c | 1 - arch/arm64/kvm/vmid.c | 206 ++++++++++++++++++++++++++ arch/arm64/tools/cpucaps | 1 + 13 files changed, 273 insertions(+), 111 deletions(-) create mode 100644 arch/arm64/kvm/vmid.c -- 2.17.1