From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6FC4C433B4 for ; Thu, 20 May 2021 13:32:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B54BC610A2 for ; Thu, 20 May 2021 13:32:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235741AbhETNdm (ORCPT ); Thu, 20 May 2021 09:33:42 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:3628 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231733AbhETNdl (ORCPT ); Thu, 20 May 2021 09:33:41 -0400 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fm9Zy1rlJzmXDj; Thu, 20 May 2021 21:30:02 +0800 (CST) Received: from dggema764-chm.china.huawei.com (10.1.198.206) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 20 May 2021 21:32:19 +0800 Received: from [10.174.185.179] (10.174.185.179) by dggema764-chm.china.huawei.com (10.1.198.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 20 May 2021 21:32:18 +0800 Subject: Re: [PATCH v4 01/66] arm64: Add ARM64_HAS_NESTED_VIRT cpufeature To: Marc Zyngier CC: , , , Andre Przywara , "Christoffer Dall" , Jintack Lim , "Haibo Xu" , James Morse , Suzuki K Poulose , Alexandru Elisei , , Jintack Lim References: <20210510165920.1913477-1-maz@kernel.org> <20210510165920.1913477-2-maz@kernel.org> From: Zenghui Yu Message-ID: Date: Thu, 20 May 2021 21:32:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20210510165920.1913477-2-maz@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema764-chm.china.huawei.com (10.1.198.206) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 2021/5/11 0:58, Marc Zyngier wrote: > From: Jintack Lim > > Add a new ARM64_HAS_NESTED_VIRT feature to indicate that the > CPU has the ARMv8.3 nested virtualization capability. > > This will be used to support nested virtualization in KVM. > > Signed-off-by: Jintack Lim > Signed-off-by: Andre Przywara > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier > --- > .../admin-guide/kernel-parameters.txt | 4 +++ > arch/arm64/include/asm/cpucaps.h | 1 + > arch/arm64/kernel/cpufeature.c | 25 +++++++++++++++++++ > 3 files changed, 30 insertions(+) [...] > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index efed2830d141..056de86d7f6f 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -1645,6 +1645,21 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) > write_sysreg(read_sysreg(tpidr_el1), tpidr_el2); > } > > +static bool nested_param; > +static bool has_nested_virt_support(const struct arm64_cpu_capabilities *cap, > + int scope) > +{ > + return has_cpuid_feature(cap, scope) && > + nested_param; > +} Nitpick: How about putting them into a single line (they still perfectly fit within the 80-colume limit)? Zenghui From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 46607C433ED for ; Thu, 20 May 2021 13:32:29 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 7DAB6611BD for ; Thu, 20 May 2021 13:32:28 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7DAB6611BD Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id EE5A24B312; Thu, 20 May 2021 09:32:27 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fiBchv1q3CfV; Thu, 20 May 2021 09:32:26 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id D82D54B35C; Thu, 20 May 2021 09:32:26 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 862E54B323 for ; Thu, 20 May 2021 09:32:25 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1vuvjh7ef12h for ; Thu, 20 May 2021 09:32:23 -0400 (EDT) Received: from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 8820E4B312 for ; Thu, 20 May 2021 09:32:23 -0400 (EDT) Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fm9Zy1rlJzmXDj; Thu, 20 May 2021 21:30:02 +0800 (CST) Received: from dggema764-chm.china.huawei.com (10.1.198.206) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 20 May 2021 21:32:19 +0800 Received: from [10.174.185.179] (10.174.185.179) by dggema764-chm.china.huawei.com (10.1.198.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 20 May 2021 21:32:18 +0800 Subject: Re: [PATCH v4 01/66] arm64: Add ARM64_HAS_NESTED_VIRT cpufeature To: Marc Zyngier References: <20210510165920.1913477-1-maz@kernel.org> <20210510165920.1913477-2-maz@kernel.org> From: Zenghui Yu Message-ID: Date: Thu, 20 May 2021 21:32:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20210510165920.1913477-2-maz@kernel.org> Content-Language: en-US X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema764-chm.china.huawei.com (10.1.198.206) X-CFilter-Loop: Reflected Cc: kernel-team@android.com, kvm@vger.kernel.org, Andre Przywara , kvmarm@lists.cs.columbia.edu, Jintack Lim , linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On 2021/5/11 0:58, Marc Zyngier wrote: > From: Jintack Lim > > Add a new ARM64_HAS_NESTED_VIRT feature to indicate that the > CPU has the ARMv8.3 nested virtualization capability. > > This will be used to support nested virtualization in KVM. > > Signed-off-by: Jintack Lim > Signed-off-by: Andre Przywara > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier > --- > .../admin-guide/kernel-parameters.txt | 4 +++ > arch/arm64/include/asm/cpucaps.h | 1 + > arch/arm64/kernel/cpufeature.c | 25 +++++++++++++++++++ > 3 files changed, 30 insertions(+) [...] > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index efed2830d141..056de86d7f6f 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -1645,6 +1645,21 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) > write_sysreg(read_sysreg(tpidr_el1), tpidr_el2); > } > > +static bool nested_param; > +static bool has_nested_virt_support(const struct arm64_cpu_capabilities *cap, > + int scope) > +{ > + return has_cpuid_feature(cap, scope) && > + nested_param; > +} Nitpick: How about putting them into a single line (they still perfectly fit within the 80-colume limit)? Zenghui _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA6FDC433ED for ; Thu, 20 May 2021 13:33:56 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A6B82610A2 for ; Thu, 20 May 2021 13:33:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A6B82610A2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:CC:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tSNcw/Z+pC6LpbC9G32mOM1QPst5DAppCyF9sAdeJew=; b=pI/OWpUnGswiGuXMdVDAYbAhgp 0mgNsiv1yH3Smr0jSZrUEWWGa7eIFVxkJEInCH47vtNLAd1ZpSM3MZuKxDxwRJ8SWysUS9mC01LHy 603xw+NIGXuCROyR8hK3nyY+Ge13hctF5aBYulfVJn8+/YzvrkircwmoriYlJw7JF7iwkAogrkaio U2X1ckN9pF2OaPHQ7GM+ty9pCw5NsvuGZTz2QUrJndqIur1GnmTmLugZar1FnOI41XZbmi5WVKc5e E/IW2G+UeSWFP/EN5or6GtOkoO7dChOaDYqfT4FIAzLXNWH0+OtTCisDeX9rqkqa86VkoY7oXbCNM 1ZSJBnZQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljimw-001Ctx-Ex; Thu, 20 May 2021 13:32:34 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ljims-001Cto-B1 for linux-arm-kernel@desiato.infradead.org; Thu, 20 May 2021 13:32:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:MIME-Version:Date:Message-ID:From:References:CC:To: Subject:Sender:Reply-To:Content-ID:Content-Description; bh=U3K/Tk0fN6pqaY9W5BDMeeDmQje7Q52P/HWlFJEFPZk=; b=uOm4bNIUvhk9gKXps7bKpb0pzl 92KQSmLp4erJZw8kKfUjjwAiB2aiVyDmHYKD2SKNLhvUItSsCB2s+neG63HkMXjeTjREWjzDGooRe l9SoUh2CsKov/RTstZcFuqAk6jyden+0ezRF47yOfOXB6SE/ODJYfh4XVclqb3fONmc6iFz1cU4Qp FP1wmU/AXpCkQnhNZo9q0Hdxzi/yuwQ5nkjHPRPGKsZKMmGMZS0c0uq7KOIDnMXSL5IFqh+PzztFI IllSSNGAu/0i+kSvt+QxvoM0Apyy1U8ia+wN4nM2zuAY4QcyrGPNbqaRuLxRh89CLPK1nVX0ldznJ 5/tgn77w==; Received: from szxga06-in.huawei.com ([45.249.212.32]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1ljimo-00GNGU-48 for linux-arm-kernel@lists.infradead.org; Thu, 20 May 2021 13:32:27 +0000 Received: from dggems701-chm.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4Fm9Zy1rlJzmXDj; Thu, 20 May 2021 21:30:02 +0800 (CST) Received: from dggema764-chm.china.huawei.com (10.1.198.206) by dggems701-chm.china.huawei.com (10.3.19.178) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Thu, 20 May 2021 21:32:19 +0800 Received: from [10.174.185.179] (10.174.185.179) by dggema764-chm.china.huawei.com (10.1.198.206) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Thu, 20 May 2021 21:32:18 +0800 Subject: Re: [PATCH v4 01/66] arm64: Add ARM64_HAS_NESTED_VIRT cpufeature To: Marc Zyngier CC: , , , Andre Przywara , "Christoffer Dall" , Jintack Lim , "Haibo Xu" , James Morse , Suzuki K Poulose , Alexandru Elisei , , Jintack Lim References: <20210510165920.1913477-1-maz@kernel.org> <20210510165920.1913477-2-maz@kernel.org> From: Zenghui Yu Message-ID: Date: Thu, 20 May 2021 21:32:17 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.9.0 MIME-Version: 1.0 In-Reply-To: <20210510165920.1913477-2-maz@kernel.org> Content-Language: en-US X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggema764-chm.china.huawei.com (10.1.198.206) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210520_063226_365750_FEAC983B X-CRM114-Status: GOOD ( 16.17 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2021/5/11 0:58, Marc Zyngier wrote: > From: Jintack Lim > > Add a new ARM64_HAS_NESTED_VIRT feature to indicate that the > CPU has the ARMv8.3 nested virtualization capability. > > This will be used to support nested virtualization in KVM. > > Signed-off-by: Jintack Lim > Signed-off-by: Andre Przywara > Signed-off-by: Christoffer Dall > Signed-off-by: Marc Zyngier > --- > .../admin-guide/kernel-parameters.txt | 4 +++ > arch/arm64/include/asm/cpucaps.h | 1 + > arch/arm64/kernel/cpufeature.c | 25 +++++++++++++++++++ > 3 files changed, 30 insertions(+) [...] > diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c > index efed2830d141..056de86d7f6f 100644 > --- a/arch/arm64/kernel/cpufeature.c > +++ b/arch/arm64/kernel/cpufeature.c > @@ -1645,6 +1645,21 @@ static void cpu_copy_el2regs(const struct arm64_cpu_capabilities *__unused) > write_sysreg(read_sysreg(tpidr_el1), tpidr_el2); > } > > +static bool nested_param; > +static bool has_nested_virt_support(const struct arm64_cpu_capabilities *cap, > + int scope) > +{ > + return has_cpuid_feature(cap, scope) && > + nested_param; > +} Nitpick: How about putting them into a single line (they still perfectly fit within the 80-colume limit)? Zenghui _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel