Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp758737rdg; Thu, 10 Aug 2023 20:40:27 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFWoKf6DN5pO6BFNF7V7yqcIMPVqP5RPQHaPcz40x7jtjSR4wEdqaDv6kK8vVu/wEoI/uOL X-Received: by 2002:a05:6358:920f:b0:139:d4f2:b03e with SMTP id d15-20020a056358920f00b00139d4f2b03emr881599rwb.6.1691725227351; Thu, 10 Aug 2023 20:40:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691725227; cv=none; d=google.com; s=arc-20160816; b=c/iHChho6lRjHsqGFNB9WXMN8DviNr/zQvj6KAgdLzUUQ5NQxva51gKhN/iabi2ru7 hirjqm7yB25zxWyUegCmAeH7O4vjyCxPCjs6isa2MqONVIMe/e3qhajit7n0QZDHEZh1 uhq029x+W131YOG1nqFpbgkfmr7CO78NLzE+01GIuZajnGzBF+m8hrNMhbCOhlG1+x6g PTCTBwuw6EasdRugAJZE0ldXtW7t9+VmEuRhblxUVxfhfNCIM5RYAiN+Lkz7ztx607XF J9tZQW+UPnGYNCPEhYV53IKTkWGKT4ONNQbtpW+lgZ+UKJ1b8b9nOCw2S1v9N0V3Ij6E bUzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=1DMrZ/cVVx9oJnb2z2JJ4WKVaGEEQv2IXABVTFJ5wRQ=; fh=ad6vJxgYdmjp1AX3pzh0EYxiKdG1YEK6uyZENE8XtG8=; b=znJYDK34btQ1EJxlhumgGLHhtnvb7MK8uOaI+R/HsgNcr5CMs0BXkBcqAt1L/E1LuS GmADXcUM98+rKRCX34cEEmqX7hGcc6KnU9Qj7Y7rLh9g7PKpbUK95M5s5c5C9cQW+ghE fPtTtEci6WvCrwlgiABFCr9VWx5d90b6dbAuYqMQKQ41lxK1cct4Oynppmp1/as31SMB UL/OC8c37ZJkxXROaxF5bYlMx+P3Z+OpN0xmldKjDTCB40qOCGPdo54vcO29nn5Yqqqp F6xoJOfL/F0VQDyfdJwULSDqfDZmw9loRXoxrLIb9/i+qaxbBLtsF1Vb4bTZX/PRZQxh Movw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eViK7cmu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rj6-20020a17090b3e8600b0026805ee16e0si2782859pjb.130.2023.08.10.20.40.14; Thu, 10 Aug 2023 20:40:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=eViK7cmu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229379AbjHKDEt (ORCPT + 99 others); Thu, 10 Aug 2023 23:04:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59976 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbjHKDEr (ORCPT ); Thu, 10 Aug 2023 23:04:47 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B822D64 for ; Thu, 10 Aug 2023 20:04:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691723039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=1DMrZ/cVVx9oJnb2z2JJ4WKVaGEEQv2IXABVTFJ5wRQ=; b=eViK7cmuXm7qapoTxs6HXXdJUQhVUf3IG+2xlSwJoNIYd1q9QtxUE8VjCkxlsVaWY5w+Z4 nwgEE4MIyp4EVuwoUI+LiXKj7A03U3Eo5AhQXPIdK7En3GUGRUEx7AJl/v9w6N8vsFs3Bm G9OiwS79Kov8mJFII5i6icfZn10Ni2Y= Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-311-eMwwJpyYOHKf930deS3UUg-1; Thu, 10 Aug 2023 23:03:57 -0400 X-MC-Unique: eMwwJpyYOHKf930deS3UUg-1 Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-56561aaaeeeso234318a12.0 for ; Thu, 10 Aug 2023 20:03:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691723037; x=1692327837; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=1DMrZ/cVVx9oJnb2z2JJ4WKVaGEEQv2IXABVTFJ5wRQ=; b=acUFnL1JOGMb0InDi4hVD2VErXMXChdffr0D53gMXAiz7AFaTg4b1PAlQC8AF61Imj Bw1AQSMwSOHhmconkrdws9TDjtfxuG9keXGTwcwMJIjnaxPIzY+MKUC8pygetdZ7dTTt jtDtWthaQMhM1ak6gEZtABO4ZVHvpFwSdKfWmPKHcZ1OV2HmIcyVFbk5kcgRt+T/sSVb 0+mOOv9B1V0L2stRB6zBakX4XNVUgLF6RFQRqagqhfh2ce4JRQ1eiDWo5VzWslfX8wvN f+K+I2GLOyF8lSl6XOMym+TnVWNsk1s7xFLGocGyplrKNUrYE3brwv7k+O8wSG6Zx32t sZFg== X-Gm-Message-State: AOJu0Yzm9r/zxnkKvfbbJFtpwELwwZ2Y4jHamGXVN/PhbyzvSo7nVnx9 Xc1lcI8U8ncNSsW0R1j7cAO3gZ3iF9keTEqrDEZuaHfy09THvh0RHGlL49uCJitAAtRjxHsKF4v kmuONnTvLSde0q0lo63dBBjKJ X-Received: by 2002:a05:6a21:6d88:b0:13a:3649:dc1a with SMTP id wl8-20020a056a216d8800b0013a3649dc1amr1316471pzb.0.1691723036997; Thu, 10 Aug 2023 20:03:56 -0700 (PDT) X-Received: by 2002:a05:6a21:6d88:b0:13a:3649:dc1a with SMTP id wl8-20020a056a216d8800b0013a3649dc1amr1316435pzb.0.1691723036603; Thu, 10 Aug 2023 20:03:56 -0700 (PDT) Received: from [10.72.112.92] ([43.228.180.230]) by smtp.gmail.com with ESMTPSA id y15-20020a637d0f000000b00553d42a7cb5sm2239376pgc.68.2023.08.10.20.03.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Aug 2023 20:03:56 -0700 (PDT) Message-ID: Date: Fri, 11 Aug 2023 11:03:45 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v8 11/14] KVM: arm64: Implement kvm_arch_flush_remote_tlbs_range() Content-Language: en-US To: Raghavendra Rao Ananta , Oliver Upton , Marc Zyngier , James Morse , Suzuki K Poulose Cc: Paolo Bonzini , Sean Christopherson , Huacai Chen , Zenghui Yu , Anup Patel , Atish Patra , Jing Zhang , Reiji Watanabe , Colton Lewis , David Matlack , Fuad Tabba , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-mips@vger.kernel.org, kvm-riscv@lists.infradead.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, Gavin Shan References: <20230808231330.3855936-1-rananta@google.com> <20230808231330.3855936-12-rananta@google.com> From: Shaoqin Huang In-Reply-To: <20230808231330.3855936-12-rananta@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/9/23 07:13, Raghavendra Rao Ananta wrote: > Implement kvm_arch_flush_remote_tlbs_range() for arm64 > to invalidate the given range in the TLB. > > Signed-off-by: Raghavendra Rao Ananta > Reviewed-by: Gavin Shan > Reviewed-by: Shaoqin Huang > --- > arch/arm64/include/asm/kvm_host.h | 2 ++ > arch/arm64/kvm/mmu.c | 8 ++++++++ > 2 files changed, 10 insertions(+) > > diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h > index 20f2ba149c70c..8f2d99eaab036 100644 > --- a/arch/arm64/include/asm/kvm_host.h > +++ b/arch/arm64/include/asm/kvm_host.h > @@ -1113,6 +1113,8 @@ struct kvm *kvm_arch_alloc_vm(void); > > #define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS > > +#define __KVM_HAVE_ARCH_FLUSH_REMOTE_TLBS_RANGE > + > static inline bool kvm_vm_is_protected(struct kvm *kvm) > { > return false; > diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c > index 0ac721fa27f18..294078ce16349 100644 > --- a/arch/arm64/kvm/mmu.c > +++ b/arch/arm64/kvm/mmu.c > @@ -172,6 +172,14 @@ int kvm_arch_flush_remote_tlbs(struct kvm *kvm) > return 0; > } > > +int kvm_arch_flush_remote_tlbs_range(struct kvm *kvm, > + gfn_t gfn, u64 nr_pages) Hi Raghavendra, As the kernel test robot points out, the parameter `gfn` should change to `start_gfn`. Thanks, Shaoqin > +{ > + kvm_tlb_flush_vmid_range(&kvm->arch.mmu, > + start_gfn << PAGE_SHIFT, nr_pages << PAGE_SHIFT); > + return 0; > +} > + > static bool kvm_is_device_pfn(unsigned long pfn) > { > return !pfn_is_map_memory(pfn); -- Shaoqin