Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp486805rdg; Tue, 10 Oct 2023 17:08:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6ZJKxqt4iJaMCugM5FMKe51nkN6NrzT4luPrUPsmgFJ53PuT9f4hW17s2eFCECmYlyOiG X-Received: by 2002:a92:c56e:0:b0:351:50f1:1f98 with SMTP id b14-20020a92c56e000000b0035150f11f98mr21500034ilj.32.1696982902625; Tue, 10 Oct 2023 17:08:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696982902; cv=none; d=google.com; s=arc-20160816; b=VOiqbZTBynAK3LMj+UGkhizK8fpFaCfeo8VaNKf1SaPWVSveSfqwWH2bJdW9MXrrYc l9IejeY5aUN+OzQMv3qitay/i2VLBtNnHXzmdDVG7IOeFXzeoDBoPOtJ08PWw3f1AcXY qbAP9Vd5ryqMTy9Jj+mB+6lv3E/SP8GVwcNRZ0Us6I+hdRRqPY/FF5HgiddarqzcdnCq HI5cWK/xGVktPlKr3kIscToPPYL3kjZejFeoW0FZ8OdsbTLR5Qef3eMS1jkYKIS6FvE6 SoLG/ca8vPMVwMsq4KY8X8vpT1wMGpmlAZJqVKQbwsm+/+DSsIF4u6VemYFjYGUu0QnF uiCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=Zd/nacEbxpo/jAXF8pqfkyF745LkcXcc4cVmKOG5Cnc=; fh=ihtjVjmLO7aQQDhRUr8sC7ZG3uixogS1CGjMUwsflQI=; b=XSOWjFT8+TP9tT1B/kvdeMkZvKLZNF3C4gsp4GXDL+dCZO9/J8RW1Gnh9lLM1NZrNe 1rficsf0x14q2ENFLnFAqo6L9I6Vq2lsOzDWrt0xlyrJFczsfi5YtqmWHvyyi7LmKnWn PEpBMq0XO344SAJ6jHjWUyGX3EcDPJBcuKIgpxZaV5ynNu5dB2SPDVPrc/3vOnJcdhDJ htBKAH7PB4LYJlZuoldRDTUw+AmLOlYw2Zq2akR/y/x3QcjsdWRrPBkWzq9GzKpTB8AE 4duv85VuXJILFH1ETHBW55UeD12XwnFFT0i1o84guEbziDSohlbCLGUseWDHTIkY7B3A wfTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bRa8OQEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j64-20020a638043000000b00565ec2a1e2asi13394292pgd.760.2023.10.10.17.08.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 17:08:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=bRa8OQEf; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 95E0D80E65B3; Tue, 10 Oct 2023 17:08:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344277AbjJKAIQ (ORCPT + 99 others); Tue, 10 Oct 2023 20:08:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229523AbjJKAIM (ORCPT ); Tue, 10 Oct 2023 20:08:12 -0400 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 964FF94 for ; Tue, 10 Oct 2023 17:08:10 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id 3f1490d57ef6-d815354ea7fso8335949276.1 for ; Tue, 10 Oct 2023 17:08:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1696982890; x=1697587690; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Zd/nacEbxpo/jAXF8pqfkyF745LkcXcc4cVmKOG5Cnc=; b=bRa8OQEfYVX+NWc9dsps3hAtbxwl6xhCaCdfGPb87lERItoje9u/wLlc3eTE1P/HKz 6ydAbsbZUrgaUXU9Ylm9JRFz403scKolnCxHRBnlLuSrIUuPyEpi5WtanqHUBfqy+21k x/q68oIwG/LOcIFMOnJNYYZ6ypdDEn9NfetUhrylfesVTehhXNAjn51Ds9QnQdRmL74p zjK5F37/623wxaY2VSS5rPwxoRRXrgslMrF4FqSlz5h8fJaQMZkI9akUkbaEe9U9U+6y ssvLfTeJH54fo+yzuWA5dE5c76t4ZLv8xl1gojIT5VYiS3cNPV8NJXG3xVVYtzSW92qA U8fQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696982890; x=1697587690; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Zd/nacEbxpo/jAXF8pqfkyF745LkcXcc4cVmKOG5Cnc=; b=OEWzpZqGVmhafpQSPkz1i+JJRyA912hMdEUxT+adPFj1zVqSun4kC8QH7Tzu3IPD4S HzwsR36U6f8xuUaNSDHlcP6RBtNMqMcXzwfdgpd1SmjNdcmFpgOG/Me2+dEbXKWEMVxJ bjmJPaiMdTfbbD83vVOPT3M52KNL8kXXebkEcwLYnMCu39Yh2WIxCVHFO5XtfG0UhLBc sr87xrrVEQzTPpriPNgnAcMDjOHKe3FFqyiHPCIyayxNvrBIoUd463NvEeXtJBws+95x +ThVqjDQClRq4XkJ5YZ93SJczJD48yA2cMgy14hXljSyELWC7gZYfvXHX4Q0GbeV2qcS 7cng== X-Gm-Message-State: AOJu0YxPEKXjhfunkB8LKvIJi3OPBVXKhYiPGihMlNYtjqPUdoCzZOUF ZKZ1F61bqwfiaan84zWSc2e/t7YnlKU= X-Received: from zagreus.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:5c37]) (user=seanjc job=sendgmr) by 2002:a25:514:0:b0:d91:c7f2:764 with SMTP id 20-20020a250514000000b00d91c7f20764mr272449ybf.0.1696982889881; Tue, 10 Oct 2023 17:08:09 -0700 (PDT) Date: Tue, 10 Oct 2023 17:08:08 -0700 In-Reply-To: Mime-Version: 1.0 References: <20230714064656.20147-1-yan.y.zhao@intel.com> <20230714065006.20201-1-yan.y.zhao@intel.com> <553e3a0f-156b-e5d2-037b-2d9acaf52329@gmail.com> Message-ID: Subject: Re: [PATCH v4 01/12] KVM: x86/mmu: helpers to return if KVM honors guest MTRRs From: Sean Christopherson To: Yan Zhao Cc: Like Xu , pbonzini@redhat.com, chao.gao@intel.com, kai.huang@intel.com, robert.hoo.linux@gmail.com, yuan.yao@linux.intel.com, kvm list , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Tue, 10 Oct 2023 17:08:21 -0700 (PDT) On Tue, Oct 10, 2023, Yan Zhao wrote: > BTW, as param "kvm" is now removed from the helper, better to remove the word > "second" in comment in patch 4, i.e. > > - * So, specify the second parameter as true here to indicate > - * non-coherent DMAs are/were involved and TDP zap might be > - * necessary. > + * So, specify the parameter as true here to indicate non-coherent > + * DMAs are/were involved and TDP zap might be necessary. > > Sorry and thanks a lot for helps on this series! Heh, don't be sorry, it's not your fault I can't get this quite right. Fixed up yet again, hopefully for the last time. This is what I ended up with for the comment: /* * Non-coherent DMA assignment and de-assignment will affect * whether KVM honors guest MTRRs and cause changes in memtypes * in TDP. * So, pass %true unconditionally to indicate non-coherent DMA was, * or will be involved, and that zapping SPTEs might be necessary. */ and the hashes: [1/5] KVM: x86/mmu: Add helpers to return if KVM honors guest MTRRs https://github.com/kvm-x86/linux/commit/1affe455d66d [2/5] KVM: x86/mmu: Zap SPTEs when CR0.CD is toggled iff guest MTRRs are honored https://github.com/kvm-x86/linux/commit/7a18c7c2b69a [3/5] KVM: x86/mmu: Zap SPTEs on MTRR update iff guest MTRRs are honored https://github.com/kvm-x86/linux/commit/9a3768191d95 [4/5] KVM: x86/mmu: Zap KVM TDP when noncoherent DMA assignment starts/stops https://github.com/kvm-x86/linux/commit/362ff6dca541 [5/5] KVM: VMX: drop IPAT in memtype when CD=1 for KVM_X86_QUIRK_CD_NW_CLEARED https://github.com/kvm-x86/linux/commit/c9f65a3f2d92