Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1095628pxb; Wed, 6 Apr 2022 08:36:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2mCxgRbf6jr+wO0UFHw+LNYcTwTKR7RhTwNZtlSI09JTmHNIEIpGtmQFGG10AnRnXJGTm X-Received: by 2002:a17:90b:314b:b0:1c7:4a4f:6740 with SMTP id ip11-20020a17090b314b00b001c74a4f6740mr10626432pjb.145.1649259396669; Wed, 06 Apr 2022 08:36:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649259396; cv=none; d=google.com; s=arc-20160816; b=WEA/rB0THBGN+91ymjQaC9/mz6H6gZF96+W82MtuGVds5nRMouylM4coKjh1smkAZt OP0BLbCPiVHmprO1hDyAOGDaWIRDjTHeX12i0Liruf+FgzBZ3NfIEfeAEbdzvUKWBnVr brAa0v3Gwpe9JlEnid1IGv4f3giv4f+yb7yZMKYp2A58Tj2O2w6B5YWP0cdJlV6yud03 MDFU89I3+YLEny33qUGh7fR2d/8SDuCdADaJASlJZ4Bo5yGnF4WkH2aOwjvw7IXcVq6G gTO+qah9Mvg11//K7zcxGyk9lqcNI7dkukTpLECBaoIYyDS/SezQrtD2P4JitGN6lvjS rbnQ== 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=clK4mQhSKxURoMrRIrMnAnalT08fuiMGN0eGeD3I/lY=; b=ztSJoUS3Jzvp0I8DZTyz9hhWyeGxJHBVHRhgrLI9k98S/GnLzTJT+oLkvpefHY68Zj BLuervyGjLqSArjTY27HyJowoej+g8+Oo0cEP1luXzqHY6CPWmpkqbnqWHRJlCS56x8/ to/OREPoz7PJIUxdFcZOVfRygmJXc41ZGxA0n748ViYlWNMMBvpZkidZZj/Ev/WsDfrO b0XxjjWqzqL86U6K3u6ePzZxsugPeJF9msCpMRZDtnrMmmRrWuoq75GLL39be8Ycvmu6 wWF5KOwdfJ4fRRMlTIcSfEAXBx+nkM3eVqNyWydDvzHPasMlual9wbVMVy9nuHDUm9ta +xoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YZSOPJBB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id x3-20020a654143000000b00399345490cesi7177188pgp.419.2022.04.06.08.36.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:36:36 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YZSOPJBB; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 029754E4B91; Wed, 6 Apr 2022 06:49:51 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233707AbiDFNvm (ORCPT + 99 others); Wed, 6 Apr 2022 09:51:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42066 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233908AbiDFNvR (ORCPT ); Wed, 6 Apr 2022 09:51:17 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D2B7D59BC for ; Wed, 6 Apr 2022 04:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649244365; 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=clK4mQhSKxURoMrRIrMnAnalT08fuiMGN0eGeD3I/lY=; b=YZSOPJBByx4IAOm8bAOITjwKkVE+h4ryWxB7HZQovZueDUQ0G+XZQm1xzPC47thp94HTpV kors3Q+K185WcNOf3HMuLT/dgQPAZ0VwW0a/fjRkYVVjD/p/UbhpiVcwt1MiZJSALgjo68 dR1lgsoRGPLfCj95U4qGYNyc/hwku3k= Received: from mail-ed1-f71.google.com (mail-ed1-f71.google.com [209.85.208.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-520-y7EyUPy8NFWq30-3pZuXPw-1; Wed, 06 Apr 2022 07:26:04 -0400 X-MC-Unique: y7EyUPy8NFWq30-3pZuXPw-1 Received: by mail-ed1-f71.google.com with SMTP id l14-20020aa7cace000000b003f7f8e1cbbdso1036280edt.20 for ; Wed, 06 Apr 2022 04:26:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=clK4mQhSKxURoMrRIrMnAnalT08fuiMGN0eGeD3I/lY=; b=kMevSrWgqcli0jAlWKg5SqlquS3Yy03rU+LCkl+mGI1d5fT7/6+EqgoQDdR1wj72l7 kMlpIOSTscFqlGP2t3Vi3B6VaK4eRqJVBDJFoJCdj6hAp3Kth3FKf5ZQuEux9tMvZbWp LKs5aXJ7LVxWI+kAUoy7YaYa5M5iWAZIKS/Gk98v7AgWLMepNiYtysn51FEzkGGKxICX 6tFt/Q1Er0jq1MDm510MybrvqEddpJ6gZeAGfgdbRsPwUC8bbfHJtgm0nrDiOMTUCA+0 311tDI+e1IBi8Itp4zY6TUa01NPh7IiJMdU1iIQGRUitsJ1+h0EaAVjvLqskNT4UyhQ+ TXZQ== X-Gm-Message-State: AOAM5332ydZwbzTPvM56W330UHL/7SMr7SMmiR+PfTt87X9LpaPcYfsV PqTPEKvfPwNWUxiflVskqBkRIu7fnWGgcqvicTxM7LecU76PMPYpM3frYDtJraT5phS6wljZQOV jPVBxCwdWpSM5uM+HKovd9iZJ X-Received: by 2002:a17:907:eaa:b0:6e8:2f3:45f9 with SMTP id ho42-20020a1709070eaa00b006e802f345f9mr8050128ejc.323.1649244363397; Wed, 06 Apr 2022 04:26:03 -0700 (PDT) X-Received: by 2002:a17:907:eaa:b0:6e8:2f3:45f9 with SMTP id ho42-20020a1709070eaa00b006e802f345f9mr8050115ejc.323.1649244363157; Wed, 06 Apr 2022 04:26:03 -0700 (PDT) Received: from ?IPV6:2001:b07:6468:f312:c8dd:75d4:99ab:290a? ([2001:b07:6468:f312:c8dd:75d4:99ab:290a]) by smtp.googlemail.com with ESMTPSA id cn27-20020a0564020cbb00b00418b0c7fbbfsm7634266edb.32.2022.04.06.04.26.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 04:26:02 -0700 (PDT) Message-ID: Date: Wed, 6 Apr 2022 13:26:01 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [RFC PATCH v5 033/104] KVM: x86: Add infrastructure for stolen GPA bits Content-Language: en-US To: Kai Huang , isaku.yamahata@intel.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: isaku.yamahata@gmail.com, Jim Mattson , erdemaktas@google.com, Connor Kuehl , Sean Christopherson References: <2b8038c17b85658a054191b362840240bd66e46b.camel@intel.com> <5443b630-d2c8-b0c3-14f5-2b6b3f71221c@redhat.com> From: Paolo Bonzini In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE, T_SCC_BODY_TEXT_LINE 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 4/6/22 04:23, Kai Huang wrote: >> >>>> >>>> >>>> - gfn = gpte_to_gfn(gpte); >>>> + gfn = gpte_to_gfn(vcpu, gpte); >>>> pte_access = sp->role.access; >>>> pte_access &= FNAME(gpte_access)(gpte); >>>> FNAME(protect_clean_gpte)(vcpu->arch.mmu, &pte_access, gpte); >>> >>> In commit message you mentioned "Don't support stolen bits for shadow EPT" (you >>> actually mean shadow MMU I suppose), yet there's bunch of code change to shadow >>> MMU. >> >> It's a bit ugly, but it's uglier to keep two versions of gpte_to_gfn. > > gpte_to_gfn() is only used in paging_tmpl.h. Could you elaborate why we need to > keep two versions of it? You're right. Yeah, considering page table walks are not supported when private memory is available, it shouldn't be necessary to change paging_tmpl.h. Paolo