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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E470C77B60 for ; Tue, 4 Apr 2023 18:51:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236046AbjDDSvK (ORCPT ); Tue, 4 Apr 2023 14:51:10 -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 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