Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1157412pxf; Fri, 9 Apr 2021 01:11:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxdN3Omh9kVhrJpKaGpMbpRh0a3lEOOepFFoLzjWRUHSMc8Ku3A+HeRrNsLKw4XzPIjRhAz X-Received: by 2002:a17:906:7194:: with SMTP id h20mr14347128ejk.432.1617955866210; Fri, 09 Apr 2021 01:11:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617955866; cv=none; d=google.com; s=arc-20160816; b=Ta5Q74swqbVaXcL9ruan7a5atku7LCb9lg5y67faFFIoVKdh2NHjHqDgTevKbwO749 cqIHvRXPwdJ5FWgEULl6mmnggDGrGQRdTNv/f3/8vDmUrClqtb2CO431hY86Yb9mGOtj AIIBlRtiQch0Rez/+jCPJRxPYS+4UH86n33ovxdxbxYgUSDrEhYg6hG+Sreqr90hEZR5 fvXqBJoGDzkUWSbS0tFeri6qOblS1iRGnu+W9Dy48bJXX0uOWt9DP0DVg8t1RLGW0snQ +rQkxdySPWNG8gYDygpZTyjlGEDPskI1Qm/A9Kmaas3BgeNIsV3JscJHRe9XvZWs507s cHbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=4n5XQyXIMcAvvSVHJa1+lHKqEgUtFQKp+M5Ydfb4ys4=; b=0T3LyrSHgSOVKOyayqAkpzJR9cj09oe/K1F5rdX7SBFr0pwB/3MSLz7B+prfhga4d7 O/gZ1ztAfjJxvN844sByvxae4XkAufzir3JvFjir2cgp3/Pva+KndKSRtz+aSXOLC7XA CsAe2tY96xN30eAcaQtCfV39sUweasr0xaYFe2jAcgQTmbI8OzUTlh3aZlIqOzghPYNO wivGKyrag/MHIwpxIJitmKoHgZ1GefpftZ6CmHTLm1C4zaYrdv05ihbuS6JEph1QQZY3 e6ZeJ2Zf/TfOCDdN95waOj7YOLZcDZVisNVccgIReFv3+yrd5XK01DByrSzvzkRJso31 DkTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=PBaL3LS2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cw26si1516932ejb.516.2021.04.09.01.10.43; Fri, 09 Apr 2021 01:11:06 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=PBaL3LS2; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232005AbhDIII2 (ORCPT + 99 others); Fri, 9 Apr 2021 04:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbhDIII2 (ORCPT ); Fri, 9 Apr 2021 04:08:28 -0400 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B8C8C061760 for ; Fri, 9 Apr 2021 01:08:15 -0700 (PDT) Received: by mail-wr1-x431.google.com with SMTP id e12so4676406wro.11 for ; Fri, 09 Apr 2021 01:08:15 -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=4n5XQyXIMcAvvSVHJa1+lHKqEgUtFQKp+M5Ydfb4ys4=; b=PBaL3LS2SQBr213UpbZLcQZtzq8Tftnqxcf972qOnt5LcxDOzXyTUP4oKSW2ZS5/Vd FP1LTP3r747Omm5WJgBItRP4SGiXHuPPovxyhQIKcRyh/azg5wC6tC3NmdUHtNIFjWfR /c+crwDj4lx11ztCTwZ6v5qIRbyzblZUGR76rTxW5lvCggLHC38yKc9lzTubbRdV+rEr 3x1pGsyZe9omFLP2X4dBbpzV+uMYZgdKJoIU/im8w88aFlyHzl9r8K2GIjNtxIVLFMj4 JvQ191AvXnwi+/vhXtdnlXOwaKdGcBqLEow+QVLGlr34TIa2H/HuNu65/tO1/PuG/Qbp IO1Q== 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=4n5XQyXIMcAvvSVHJa1+lHKqEgUtFQKp+M5Ydfb4ys4=; b=ehxp3EVEuw403t5DAhXsn7RFcpXvl1tJdjXZAXmIubtekfwVgQdbZf9B0wFUtKVSTW Dpjdr8PpUbsNQKk/OOxQAsCf6pcrRcy2cDsPdxP6AqMuMfugU2EhUefgqqecac5/kfOH yMdwZg0m61A3ZDlPxIUzCDXwQV3HqtZrg6flK4DZAlXEKhPPzg/9aTwjZZzIx0/DwDP8 kFfsJCh2fYH+DVvGLpGbb4K+0b2+1QMwUWmlpTeLc5ZW6qAFeDE1rTpbfp54GK7RPYkn TyK7Ew6Tl7EoRKbd1jrMLfJ8kzp6lWiN1rGCHar2tUJO360vl7mjni0at2xHcROaamsm p+xg== X-Gm-Message-State: AOAM530/4DpkbhhZP+86fYZshgTHhQRfeD6WPh7IE+0+urj6MzSye4Yl V0ux+cQ0xTj3UX7Q5epHHIHqyQ== X-Received: by 2002:adf:9d48:: with SMTP id o8mr16279163wre.183.1617955694111; Fri, 09 Apr 2021 01:08:14 -0700 (PDT) Received: from google.com (105.168.195.35.bc.googleusercontent.com. [35.195.168.105]) by smtp.gmail.com with ESMTPSA id z1sm3276489wrt.8.2021.04.09.01.08.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Apr 2021 01:08:13 -0700 (PDT) Date: Fri, 9 Apr 2021 08:08:11 +0000 From: Quentin Perret To: Yanan Wang Cc: Marc Zyngier , Will Deacon , Alexandru Elisei , Catalin Marinas , kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, James Morse , Julien Thierry , Suzuki K Poulose , Gavin Shan , wanghaibin.wang@huawei.com, zhukeqian1@huawei.com, yuzenghui@huawei.com Subject: Re: [PATCH v4 1/2] KVM: arm64: Move CMOs from user_mem_abort to the fault handlers Message-ID: References: <20210409033652.28316-1-wangyanan55@huawei.com> <20210409033652.28316-2-wangyanan55@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210409033652.28316-2-wangyanan55@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Yanan, On Friday 09 Apr 2021 at 11:36:51 (+0800), Yanan Wang wrote: > diff --git a/arch/arm64/kvm/hyp/pgtable.c b/arch/arm64/kvm/hyp/pgtable.c > +static void stage2_invalidate_icache(void *addr, u64 size) > +{ > + if (icache_is_aliasing()) { > + /* Flush any kind of VIPT icache */ > + __flush_icache_all(); > + } else if (is_kernel_in_hyp_mode() || !icache_is_vpipt()) { > + /* PIPT or VPIPT at EL2 */ > + invalidate_icache_range((unsigned long)addr, > + (unsigned long)addr + size); > + } > +} > + I would recommend to try and rebase this patch on kvmarm/next because we've made a few changes in pgtable.c recently. It is now linked into the EL2 NVHE code which means there are constraints on what can be used from there -- you'll need a bit of extra work to make some of these functions available to EL2. Thanks, Quentin