Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6388434rwl; Tue, 4 Apr 2023 11:54:40 -0700 (PDT) X-Google-Smtp-Source: AKy350ZOCybo6mkqwNRlJDSQTvwrNbewKRs/b3u04qC3lqIV+V/iVEFOgLllwCrfxdT//w7SYn7X X-Received: by 2002:a17:90b:4c4a:b0:23d:4229:f7cf with SMTP id np10-20020a17090b4c4a00b0023d4229f7cfmr4093563pjb.41.1680634480131; Tue, 04 Apr 2023 11:54:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680634480; cv=none; d=google.com; s=arc-20160816; b=MLzQXENjQATjh9vyJKoQ5IbA79SFbbkQY4Nq68GFQZYdG4FfQc/0YhgTidK7XaCu84 lfIuwtKiaHRvlNpRA/AWQ0ZjbvDaFAOhd8FWP0UqA2vxmY2PigoYMIuSzyocgyVO1cT5 pA8d5yBB7yHCG4fTedbBcljmGIEXaw2UCT/HF/kKY2wWzgkIOqPrkP11JoYOftf31fAY gXRuv1Fey6T4TfBbswErkjfpA4TTUAwU8bDPXz4UDmcYTopJbIWXfRp9NbuH5iFle1qD CWclYn0M+PmJ30CMXRgKlYUl6gk6Ubl97Sz/N1gaOpGSpHWNVGE0AvsDZ4VygZLT0Gum hW+g== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:dkim-signature:date; bh=zjskJ/+K4RYnRGaiw8Qyw6yBk5pv87S2MCPATkCEId8=; b=xJDG+737YFHlhiRNWikeSEYm9PNcnHi8o/EOUMqhOKoSrFxhPzOUQDbH1nX81lXvIn /gkzPWtrMqUBa+kDymC3RJ1hUCYhjJ9MK1ixsQUC8m27S5+cZphl6JIhG6VMFONM83at 9LsHen8Kd0tQWyGDDcye3MaJTkkYedfzx8T9IKNbYTKg3wAqAau7Xya62ENCRbSwOShs wV8xpV5GkRpGfZsE9OlMH2NcE6B9ROAttBZmgnTcv9PnnQq9VlbveCMSUWnsdAcDvUQ0 bQ2FMmISvDBRUsNbp9rrcXmC7vC14tj0GbeT0y6H6HIk26OuM1vIFDBSnJujgxgADrXw IOVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=RU0QINMp; 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=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pf6-20020a17090b1d8600b0023b2fff4d50si1150010pjb.119.2023.04.04.11.54.28; Tue, 04 Apr 2023 11:54:40 -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=@linux.dev header.s=key1 header.b=RU0QINMp; 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=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236047AbjDDSvI (ORCPT + 99 others); Tue, 4 Apr 2023 14:51:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235989AbjDDSvH (ORCPT ); Tue, 4 Apr 2023 14:51:07 -0400 Received: from out-38.mta0.migadu.com (out-38.mta0.migadu.com [IPv6:2001:41d0:1004:224b::26]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A94DA3C00 for ; Tue, 4 Apr 2023 11:51:05 -0700 (PDT) Date: Tue, 4 Apr 2023 18:50:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1680634264; 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=zjskJ/+K4RYnRGaiw8Qyw6yBk5pv87S2MCPATkCEId8=; b=RU0QINMpSErQ04BD1mGX/o9p8yR/QvrVf5TAqJ+B0pLUCxlNxu1B7R7LkVkoP7JGYL7LUz jEfaLi/d/MEkINFRhOVJnkIsMAYSrvpbp62YYwIAXojJutdmnhHH5FrTjB/EC2SDr4zovx evYXQ5F9H+NtK4KK+RTsFefQZk43INQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Raghavendra Rao Ananta Cc: Oliver Upton , Marc Zyngier , Ricardo Koller , Reiji Watanabe , James Morse , Alexandru Elisei , Suzuki K Poulose , Will Deacon , Paolo Bonzini , Catalin Marinas , Jing Zhang , Colton Lewis , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v2 2/7] KVM: arm64: Add FEAT_TLBIRANGE support Message-ID: References: <20230206172340.2639971-1-rananta@google.com> <20230206172340.2639971-3-rananta@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Tue, Apr 04, 2023 at 06:41:34PM +0000, Oliver Upton wrote: > On Mon, Apr 03, 2023 at 10:26:01AM -0700, Raghavendra Rao Ananta wrote: > > On Wed, Mar 29, 2023 at 6:19 PM Oliver Upton wrote: > > > > + start = round_down(start, stride); \ > > > > + end = round_up(end, stride); \ > > > > + pages = (end - start) >> PAGE_SHIFT; \ > > > > + \ > > > > + if ((!system_supports_tlb_range() && \ > > > > + (end - start) >= (MAX_TLBI_OPS * stride)) || \ > > > > > > Doesn't checking for TLBIRANGE above eliminate the need to test against > > > MAX_TLBI_OPS? > > > > > Derived from __flush_tlb_range(), I think the condition is used to > > just flush everything if the range is too large to iterate and flush > > when the system doesn't support TLBIRANGE. Probably to prevent > > soft-lockups? > > Right, but you test above for system_supports_tlb_range(), meaning that > you'd unconditionally call __kvm_tlb_flush_vmid() below. Gah, I misread the parenthesis and managed to miss your statement in the changelog about !TLBIRANGE systems. Apologies. -- Thanks, Oliver