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 X-Spam-Level: X-Spam-Status: No, score=-8.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63D7CC433E9 for ; Wed, 3 Feb 2021 18:32:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0963E64F65 for ; Wed, 3 Feb 2021 18:32:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232704AbhBCSc2 (ORCPT ); Wed, 3 Feb 2021 13:32:28 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:34958 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232145AbhBCScV (ORCPT ); Wed, 3 Feb 2021 13:32:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1612377055; 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=TiOisWoMM5J0+N5wrdR7qjGRMcCnnxa5MwmQ2/1A7Ww=; b=XqoUUP8S+eCfDG1g7ePQ9oF1eIoTIPClV0Xyg4LGCZDGotxzYsaz/AzmA2USRAQ+7kIiuv I/nHwDXbvkfUSCWO2cMOxZrlVJp2YFurav2AbCnILFPZLdiQroFWb2VojR2zIsw+/Rb29f cEoOmbcqXisMEA9OqLSbla9D2det5eY= Received: from mail-ed1-f69.google.com (mail-ed1-f69.google.com [209.85.208.69]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-565-LRuGz08NP2WZrhxM1Rv6Zw-1; Wed, 03 Feb 2021 13:30:53 -0500 X-MC-Unique: LRuGz08NP2WZrhxM1Rv6Zw-1 Received: by mail-ed1-f69.google.com with SMTP id g6so404718edy.9 for ; Wed, 03 Feb 2021 10:30:53 -0800 (PST) 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=TiOisWoMM5J0+N5wrdR7qjGRMcCnnxa5MwmQ2/1A7Ww=; b=QoDKeiyRu1EHZJPtaOSqTqZjbC/Fxi18n4L3jAlbjArLyz9kFNvKnFu2K/iwiRfvGp RaI1vUsy1OG4bED3WGKS9qg+Itdf/Yb0xFMl8M6L6VhcebcvBhG9GL7WBvF8+Eu0yg/N Tp+EDZa6tZDPi4Q6ELE35LUdoszR6B4dP+vs+ov9fbrdXAOpkkgYyhVIuS1q44T3HSBr 5w5sRvmBNIe3LdZax0hNXyvGVB4EenziUCGLGTJ9UdQ1KDgmGQj0Z3QLat9/zImNVhbj XAswFKNRVHd4jZRWw2qyCI65UdOIR09nOv4Gf2uMSVx69vfqn0j0xikQ9wSn6vPI2ekK rVZA== X-Gm-Message-State: AOAM530JW+z3ro5+yYRsY25y7i/UlMKgJIN8bxpRwx/mvEut0Yge0dtK +AuTza6yRByUvE6JZuzQeIfPXr8OuFF13Q7hRGdXSH3VEUqfvr6aYozDhhon3Zuns8R66vzyn4c yjG17AK28XSMAeKTgZFiIRMNA X-Received: by 2002:a17:906:2b11:: with SMTP id a17mr4461048ejg.203.1612377052471; Wed, 03 Feb 2021 10:30:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJxuzKzmIpNThLgL2hkQbClOrns4+7OkKK8je1Ds3SP1NLbweMJ1vlqIoalInh1oEg4EUt/rnw== X-Received: by 2002:a17:906:2b11:: with SMTP id a17mr4461028ejg.203.1612377052335; Wed, 03 Feb 2021 10:30:52 -0800 (PST) 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 c18sm1263910edu.20.2021.02.03.10.30.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 03 Feb 2021 10:30:51 -0800 (PST) Subject: Re: [PATCH v2 23/28] KVM: x86/mmu: Allow parallel page faults for the TDP MMU To: Ben Gardon Cc: LKML , kvm , Peter Xu , Sean Christopherson , Peter Shier , Peter Feiner , Junaid Shahid , Jim Mattson , Yulei Zhang , Wanpeng Li , Vitaly Kuznetsov , Xiao Guangrong References: <20210202185734.1680553-1-bgardon@google.com> <20210202185734.1680553-24-bgardon@google.com> From: Paolo Bonzini Message-ID: <39751a29-3a47-a108-f626-8abf0008ea09@redhat.com> Date: Wed, 3 Feb 2021 19:30:50 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.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 03/02/21 18:46, Ben Gardon wrote: > enum kvm_mmu_lock_mode lock_mode = > get_mmu_lock_mode_for_root(vcpu->kvm, vcpu->arch.mmu->root_hpa); > .... > kvm_mmu_lock_for_mode(lock_mode); > > Not sure if either of those are actually clearer, but the latter > trends in the direction the RCF took, having an enum to capture > read/write and whether or not yo yield in a lock mode parameter. Could be a possibility. Also: enum kvm_mmu_lock_mode lock_mode = kvm_mmu_lock_for_root(vcpu->kvm, vcpu->arch.mmu->root_hpa); kvm_mmu_unlock(vcpu->kvm, lock_mode); Anyway it can be done on top. Paolo