Received: by 2002:a05:6a10:8a4d:0:0:0:0 with SMTP id dn13csp96108pxb; Thu, 12 Aug 2021 11:37:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyDeSx/fbGgPJqnXOa9K+ea58IMTO8a6VrSmsVTJc1GU7gZWKXufd+Q0A+z5zQ1+IS7TQDi X-Received: by 2002:a05:6e02:b4b:: with SMTP id f11mr2087ilu.130.1628793451616; Thu, 12 Aug 2021 11:37:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628793451; cv=none; d=google.com; s=arc-20160816; b=VppBDv0FoV1S/SZs49dkc4E58C0BaZPujoe294dSAqHeINnji/pfafisSmAHnXbv35 /1sgfV/bpCZCGKM9zn6of95//Cxoi1x5FPPvW7SPvC1ipmleLiN9z0raK+vPNVPSr05t J2+uHco2eY4J0yIH+ZUEf025ld/+5ljX1uWGUmdYIJqwfT0n2vPpGtffA9WfJ+tZ6DYM cjKOOVNMMeQi2bbz2sZfNaFmENchd1zkrnd7DXhwl3768BA/cqPW2RKYqhItun+VtX4y iwZ291JqLQ351IMl2WrLC8/wznIoqx3wB4SiPDntvWnMXbEBC2v6BIbyjgk0+ZuZ+0y4 XEZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=Hl2q/IBeDF11InTwkjo+Q88yO1GQYT5aRVKT9ieIQAI=; b=nZlOnI+vPeORvxepxg8jWFg8psfqgQ1GmP3md0AWBcty3xIUSg10HS499emkApXTQ1 StQp8UPpgZp/I3D2Tbqj6gWhwM+kBRNxmQAhtz49V/F2WazqPeol/QTD1AwdEZ6wHCVn +WES4YW7fa0XVqxzUHPaezS2g7/X3lxvxE8R31YgYThwwYCBUIXsP/tPDybJBasB5bup fl5tpseKNAN5QzpktJqJEOUyfEZUSvOkJfUEFSlEdteh9YlGhoc450JKN4FhZH17iHrl FJ1bW3kccpFa56eM+FdTlDQshjIBH1+g3GwxT+YtxQH/ZfddaqIXa3l03VhmTiElJqea voBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FT+ry8+q; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l8si3692163jap.104.2021.08.12.11.37.18; Thu, 12 Aug 2021 11:37:31 -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=@redhat.com header.s=mimecast20190719 header.b=FT+ry8+q; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235102AbhHLRPc (ORCPT + 99 others); Thu, 12 Aug 2021 13:15:32 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:36953 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234570AbhHLRPc (ORCPT ); Thu, 12 Aug 2021 13:15:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1628788506; 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=Hl2q/IBeDF11InTwkjo+Q88yO1GQYT5aRVKT9ieIQAI=; b=FT+ry8+qt1epauQX3tA7iZAI3cisYNrBewW2C/2M3Fd8o9ofEBJjAX2nKbT7u6wjpUuX8I 2wCmA6OqgMHoqgVkJdLrBARE5hLgT0lcZDDoEIcNHw5lzpdU4FptFDdywwvTKQtMxWMiI7 qMpaa5S8lnUxjZxOAbAk2H+xhlqoTSE= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-594-m95tS8d9ONu6M2gPJHwmIw-1; Thu, 12 Aug 2021 13:15:05 -0400 X-MC-Unique: m95tS8d9ONu6M2gPJHwmIw-1 Received: by mail-ej1-f69.google.com with SMTP id ja25-20020a1709079899b02905b2a2bf1a62so2087709ejc.4 for ; Thu, 12 Aug 2021 10:15:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Hl2q/IBeDF11InTwkjo+Q88yO1GQYT5aRVKT9ieIQAI=; b=pAREIUL2bVXtm/LfHt9Uk3Phs9fob/hw6Fnc0CVeQE3OzyHOS0z/3qfkfywDNwrwnC uEMU+fHxK5CX5D1/BWQhtUo2xdWdIlQFvItmTD/ZYPgrQwBrA/twazZ5NNBLd9bNzJtt yUHtwzHjJ5V6el++lfDMCzPpGAXQNKu7EU3JQx8pafHvgHPlvi8ljUpt7Fyh8t3s8STd D5ofOBLWVW8/iA/oyeY+tv7fA0mD/LNPgOuEz5oI9aIOPah4evYyzGNSpZIGqDuy7/X6 NEbQRXt43KVpQ578OorsJ6QKFhvEwZXyU8mH92c/2lXoyoQjvjvK0N68TNFQoiqY/RZa rGlg== X-Gm-Message-State: AOAM531dd97HuPivjRvQ1lI7VSTPb7d88smETG+h8v+ggclLH2Ybgm1N aAokq74bv68pGO+w/E1gtdllhXWWjWMWCPFgBCaiv8R89Jp6T0/GJdtqUq7urxrrBFMgaugGaJb 16DM3hv/yeg3bLjzysVHdhFX4cI2Tp5uyTF6t9pmCe0Kigogottqp6AskGqN/lqJRO4g9hs/MsY MH X-Received: by 2002:a17:906:27c2:: with SMTP id k2mr4767566ejc.83.1628788503934; Thu, 12 Aug 2021 10:15:03 -0700 (PDT) X-Received: by 2002:a17:906:27c2:: with SMTP id k2mr4767524ejc.83.1628788503613; Thu, 12 Aug 2021 10:15:03 -0700 (PDT) Received: from ?IPv6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.gmail.com with ESMTPSA id n26sm1408416eds.63.2021.08.12.10.15.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 12 Aug 2021 10:15:02 -0700 (PDT) Subject: Re: [PATCH 2/2] KVM: x86/mmu: Don't step down in the TDP iterator when zapping all SPTEs To: Sean Christopherson , Ben Gardon Cc: Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm , LKML References: <20210812050717.3176478-1-seanjc@google.com> <20210812050717.3176478-3-seanjc@google.com> From: Paolo Bonzini Message-ID: <928be04d-e60e-924c-1f3a-cb5fef8b0042@redhat.com> Date: Thu, 12 Aug 2021 19:15:01 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/08/21 19:07, Sean Christopherson wrote: > Yeah, I was/am on the fence too, I almost included a blurb in the cover letter > saying as much. I'll do that for v2 and let Paolo decide. I think it makes sense to have it. You can even use the ternary operator /* * When zapping everything, all entries at the top level * ultimately go away, and the levels below go down with them. * So do not bother iterating all the way down to the leaves. */ int min_level = zap_all ? root->role.level : PG_LEVEL_4K; Paolo