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=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 92FE8C47083 for ; Wed, 2 Jun 2021 10:43:57 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id 191F8613B4 for ; Wed, 2 Jun 2021 10:43:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 191F8613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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 925904019D; Wed, 2 Jun 2021 06:43:56 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com 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 KyYLvio5Buxd; Wed, 2 Jun 2021 06:43:52 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id A9AD9407A0; Wed, 2 Jun 2021 06:43:52 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id DE823407A0 for ; Wed, 2 Jun 2021 06:43:50 -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 FFrSg9wtKs0T for ; Wed, 2 Jun 2021 06:43:44 -0400 (EDT) Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id B449C4019D for ; Wed, 2 Jun 2021 06:43:44 -0400 (EDT) Received: by mail-wm1-f50.google.com with SMTP id p13-20020a05600c358db029019f44afc845so1376189wmq.3 for ; Wed, 02 Jun 2021 03:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=S5AMEA55e6WiHfILJvvLPJjjSa/Yq2hHfihL5FLlwc0nkqiEigDVv6zGaQ9Zqw30CZ ZcNArqEE1KLDPi62Lj3DON4XRA4lRQEPl3mkiGXqf1NuzcbVyz2xB5213Beslcbi0VY+ vsODVyRmobfR1fCmUKCnp2nQgPmer3uq6shiln93ca9H6FsgwmDg30qGDQ8d9/7e24Mp CSLPgs6X+XyQ7pC/c2x8ETo1zkBVPUtq9sPOkmehhhoJFv3lhBEv40tvpOSBlEY1/b8H QUE7F5ZbBoi4Gyi+g8C3tw7hkEOfNdrM3DT6aidkaFGmRGF0N81BVxOpbVVxuR5GQeKr JnRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=CzA0Uz1AoZT7bWs2qWmt9ZRTBZGqngG0xCY5/UF5ULvsx1D575HjIA5/OXYes1h1oq OcY/fL/Lx0I8tpyqpFutqrMOAu0O7e/luqIr91F3Q2oHhhC6tVvFbJ0ufdkDOYK2vtpl sxpae/pwZdfAmkpc6XLd+FiPEnYho+uhFm1yt7A512FWk6S5lYT9E0gT9TUm9Weosf3Z 4cZIogwS3oj2hhbZcYWMTVtI75F0f8ra06/lDnXRRsbye/1dS2+SZD14QvdWOWqmoBW6 MDkZsagHsQ1N/C15A/GUJUzHvRPQM9X2Z46DrODsGyn0jY3LhR0sDwII35QNs5Ynbk10 apSw== X-Gm-Message-State: AOAM530UnD3Z77USscyvWpxHiTORgWGZPju/lvvduK9rP8QNRtwPqEvr c685tNPX39oenuwT+j/gbTc9jw== X-Google-Smtp-Source: ABdhPJwVt/mkHfPZsWQ7XeVPY+TVxGZoc9ruOznSEZgl2V+JcARglYdu24JT3h1Ue3fGnhgc5QDPqA== X-Received: by 2002:a7b:c042:: with SMTP id u2mr30819876wmc.127.1622630623364; Wed, 02 Jun 2021 03:43:43 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id 31sm7003760wrc.96.2021.06.02.03.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 03:43:42 -0700 (PDT) Date: Wed, 2 Jun 2021 10:43:40 +0000 From: Quentin Perret To: Yanan Wang Subject: Re: [PATCH v5 1/6] KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2 flag Message-ID: References: <20210415115032.35760-1-wangyanan55@huawei.com> <20210415115032.35760-2-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210415115032.35760-2-wangyanan55@huawei.com> Cc: kvm@vger.kernel.org, Marc Zyngier , linux-kernel@vger.kernel.org, Catalin Marinas , Will Deacon , kvmarm@lists.cs.columbia.edu, 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu Hi Yanan, On Thursday 15 Apr 2021 at 19:50:27 (+0800), Yanan Wang wrote: > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index c3674c47d48c..a43cbe697b37 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -61,10 +61,12 @@ struct kvm_pgtable_mm_ops { > * @KVM_PGTABLE_S2_NOFWB: Don't enforce Normal-WB even if the CPUs have > * ARM64_HAS_STAGE2_FWB. > * @KVM_PGTABLE_S2_IDMAP: Only use identity mappings. > + * @KVM_PGTABLE_S2_GUEST: Whether the page-tables are guest stage-2. > */ > enum kvm_pgtable_stage2_flags { > KVM_PGTABLE_S2_NOFWB = BIT(0), > KVM_PGTABLE_S2_IDMAP = BIT(1), > + KVM_PGTABLE_S2_GUEST = BIT(2), Assuming that we need this flag (maybe not given Marc's suggestion on another patch), I'd recommend re-naming it to explain _what_ it does, rather than _who_ is using it. That's the principle we followed for e.g. KVM_PGTABLE_S2_IDMAP, so we should be consistent here as well. Thanks, Quentin _______________________________________________ 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=-9.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 F2EAFC4708F for ; Wed, 2 Jun 2021 10:45:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 C4AAF613B4 for ; Wed, 2 Jun 2021 10:45:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C4AAF613B4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZfFnKBXEHu2+ef+kBaAcxav4wFsIf5Sw/hLqPmqJ6F0=; b=JuWr++wMsPOsUr ig8r24Bm2ilK11jKYxrd12WtSVSL292G7AlWQcEzl7uSgJYjbEKXxfieUp+KTkCt5B8uSbAmHsmBR cgcBdlfalwpL/688k4WxlQn7TAxyoVfp+RsAwXAlSYTThASfJuyjCPAryFoQGkc1tIQ48ZZ6ZUoqV pxePSHO8qnotrtxJEop6CE5fJY5Noz/h3fgJ+6Wf2ryZJQmtK+Defs1mrwrV7B1+zU09YvBicSsZj 8j3rSzjl4REF48MSUT46wqkDld+POlQAZaNAV1e0nqgyw2EixMgyBqB6/16jMtRls5SOVuFygQnPg 1qaqs2VHDUP4vVNlj+Ig==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1loOLo-003QAU-3w; Wed, 02 Jun 2021 10:43:52 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1loOLh-003Q8G-AC for linux-arm-kernel@lists.infradead.org; Wed, 02 Jun 2021 10:43:46 +0000 Received: by mail-wm1-x32d.google.com with SMTP id s5-20020a7bc0c50000b0290147d0c21c51so1377084wmh.4 for ; Wed, 02 Jun 2021 03:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=S5AMEA55e6WiHfILJvvLPJjjSa/Yq2hHfihL5FLlwc0nkqiEigDVv6zGaQ9Zqw30CZ ZcNArqEE1KLDPi62Lj3DON4XRA4lRQEPl3mkiGXqf1NuzcbVyz2xB5213Beslcbi0VY+ vsODVyRmobfR1fCmUKCnp2nQgPmer3uq6shiln93ca9H6FsgwmDg30qGDQ8d9/7e24Mp CSLPgs6X+XyQ7pC/c2x8ETo1zkBVPUtq9sPOkmehhhoJFv3lhBEv40tvpOSBlEY1/b8H QUE7F5ZbBoi4Gyi+g8C3tw7hkEOfNdrM3DT6aidkaFGmRGF0N81BVxOpbVVxuR5GQeKr JnRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=Qvl3wmmauir5WZqIJyD9udssfP9K5YeRapxt4ajwQ/81e2LcpwG1SpuCpbuaSNN1Tk SjtAivcURmguLM2NMAoRIVIYbkxBZS//8luZjsb+IqL79fL7HTqDpSW+dC+4+d4S0EMk lW+mLANRSD5YKqldNxvjVahYqJuxbtoBrtVAQlF4uzyfUXSaZAVmbAcS/5tsoKjK7WE2 kH6vafi4a2b4K6jINR7vfay0BgYJtfc0mz8d7U1ZkkF0kiHU7GC7LiJwuzXJMh1m26VI 4nfFCDiSdB9lyCAFW2EySfKa6XXhsfrTL6TNPRwaLDal470hC2w43JhDXX7j7vLpx2bU jGew== X-Gm-Message-State: AOAM532wRpWGtTFKb4Mz+eG4kUludvVWkyhxdtB5OR09ZP2y5zByEjdz 89YP7ncaj5y2qGfOJGJSmdf2gA== X-Google-Smtp-Source: ABdhPJwVt/mkHfPZsWQ7XeVPY+TVxGZoc9ruOznSEZgl2V+JcARglYdu24JT3h1Ue3fGnhgc5QDPqA== X-Received: by 2002:a7b:c042:: with SMTP id u2mr30819876wmc.127.1622630623364; Wed, 02 Jun 2021 03:43:43 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id 31sm7003760wrc.96.2021.06.02.03.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 03:43:42 -0700 (PDT) Date: Wed, 2 Jun 2021 10:43:40 +0000 From: Quentin Perret To: Yanan Wang Cc: Marc Zyngier , Will Deacon , Alexandru Elisei , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , Gavin Shan , wanghaibin.wang@huawei.com, zhukeqian1@huawei.com, yuzenghui@huawei.com Subject: Re: [PATCH v5 1/6] KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2 flag Message-ID: References: <20210415115032.35760-1-wangyanan55@huawei.com> <20210415115032.35760-2-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210415115032.35760-2-wangyanan55@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210602_034345_410793_E68543D5 X-CRM114-Status: GOOD ( 13.89 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Yanan, On Thursday 15 Apr 2021 at 19:50:27 (+0800), Yanan Wang wrote: > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index c3674c47d48c..a43cbe697b37 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -61,10 +61,12 @@ struct kvm_pgtable_mm_ops { > * @KVM_PGTABLE_S2_NOFWB: Don't enforce Normal-WB even if the CPUs have > * ARM64_HAS_STAGE2_FWB. > * @KVM_PGTABLE_S2_IDMAP: Only use identity mappings. > + * @KVM_PGTABLE_S2_GUEST: Whether the page-tables are guest stage-2. > */ > enum kvm_pgtable_stage2_flags { > KVM_PGTABLE_S2_NOFWB = BIT(0), > KVM_PGTABLE_S2_IDMAP = BIT(1), > + KVM_PGTABLE_S2_GUEST = BIT(2), Assuming that we need this flag (maybe not given Marc's suggestion on another patch), I'd recommend re-naming it to explain _what_ it does, rather than _who_ is using it. That's the principle we followed for e.g. KVM_PGTABLE_S2_IDMAP, so we should be consistent here as well. Thanks, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-18.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 2B6BBC4708F for ; Wed, 2 Jun 2021 10:43:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F5006108D for ; Wed, 2 Jun 2021 10:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231357AbhFBKpd (ORCPT ); Wed, 2 Jun 2021 06:45:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229721AbhFBKp1 (ORCPT ); Wed, 2 Jun 2021 06:45:27 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D784AC06174A for ; Wed, 2 Jun 2021 03:43:44 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id m18so986795wmq.0 for ; Wed, 02 Jun 2021 03:43:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=S5AMEA55e6WiHfILJvvLPJjjSa/Yq2hHfihL5FLlwc0nkqiEigDVv6zGaQ9Zqw30CZ ZcNArqEE1KLDPi62Lj3DON4XRA4lRQEPl3mkiGXqf1NuzcbVyz2xB5213Beslcbi0VY+ vsODVyRmobfR1fCmUKCnp2nQgPmer3uq6shiln93ca9H6FsgwmDg30qGDQ8d9/7e24Mp CSLPgs6X+XyQ7pC/c2x8ETo1zkBVPUtq9sPOkmehhhoJFv3lhBEv40tvpOSBlEY1/b8H QUE7F5ZbBoi4Gyi+g8C3tw7hkEOfNdrM3DT6aidkaFGmRGF0N81BVxOpbVVxuR5GQeKr JnRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=uetljnpMVagZUL5muUxDZIQ/D9uiCnsyXeZAzCtugkc=; b=EabnedHfJjxK9Uclk/B0JSTsVPNpl8GghbPpaSaL13k7Xrj0kbzrGiO/z0czkNsDf1 6o6Jmnxylvv4NRd+swJ3EmKdqDp0e3UGvI1smMegUEJupAhbORhKVjXK6RFZsTaBHGtw z/BhOwb6i6lMpqSqTHGd2KQeo743vnTS/HSuPhVnGYd9qLCRzqExRLwtSV5XmmHeVEuT crpVK0KYfTkrKnXjhPh1qaI+nEQCcKpDbPy+l44DP+g3XsLudpNTbQUFSJ66896BMrjc vi5KVm1jKRdIe2+4556nQTF/Ix8dBmQJRUGo7kpkR2t1ccYUMiiu8odNoeGuMstXHnbZ 8OAg== X-Gm-Message-State: AOAM533jymDGQFGch6vDeOROtQNNX/xR+cJt3cpHyihQmJdYiJ1kJYQW h4+4Gv4qOC0hS92HVOjTmml/qM2uNxcj3w== X-Google-Smtp-Source: ABdhPJwVt/mkHfPZsWQ7XeVPY+TVxGZoc9ruOznSEZgl2V+JcARglYdu24JT3h1Ue3fGnhgc5QDPqA== X-Received: by 2002:a7b:c042:: with SMTP id u2mr30819876wmc.127.1622630623364; Wed, 02 Jun 2021 03:43:43 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id 31sm7003760wrc.96.2021.06.02.03.43.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Jun 2021 03:43:42 -0700 (PDT) Date: Wed, 2 Jun 2021 10:43:40 +0000 From: Quentin Perret To: Yanan Wang Cc: Marc Zyngier , Will Deacon , Alexandru Elisei , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Catalin Marinas , James Morse , Julien Thierry , Suzuki K Poulose , Gavin Shan , wanghaibin.wang@huawei.com, zhukeqian1@huawei.com, yuzenghui@huawei.com Subject: Re: [PATCH v5 1/6] KVM: arm64: Introduce KVM_PGTABLE_S2_GUEST stage-2 flag Message-ID: References: <20210415115032.35760-1-wangyanan55@huawei.com> <20210415115032.35760-2-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210415115032.35760-2-wangyanan55@huawei.com> Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Yanan, On Thursday 15 Apr 2021 at 19:50:27 (+0800), Yanan Wang wrote: > diff --git a/arch/arm64/include/asm/kvm_pgtable.h b/arch/arm64/include/asm/kvm_pgtable.h > index c3674c47d48c..a43cbe697b37 100644 > --- a/arch/arm64/include/asm/kvm_pgtable.h > +++ b/arch/arm64/include/asm/kvm_pgtable.h > @@ -61,10 +61,12 @@ struct kvm_pgtable_mm_ops { > * @KVM_PGTABLE_S2_NOFWB: Don't enforce Normal-WB even if the CPUs have > * ARM64_HAS_STAGE2_FWB. > * @KVM_PGTABLE_S2_IDMAP: Only use identity mappings. > + * @KVM_PGTABLE_S2_GUEST: Whether the page-tables are guest stage-2. > */ > enum kvm_pgtable_stage2_flags { > KVM_PGTABLE_S2_NOFWB = BIT(0), > KVM_PGTABLE_S2_IDMAP = BIT(1), > + KVM_PGTABLE_S2_GUEST = BIT(2), Assuming that we need this flag (maybe not given Marc's suggestion on another patch), I'd recommend re-naming it to explain _what_ it does, rather than _who_ is using it. That's the principle we followed for e.g. KVM_PGTABLE_S2_IDMAP, so we should be consistent here as well. Thanks, Quentin