Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5561739pxv; Wed, 28 Jul 2021 13:47:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1w5s/t/s1iIxRjQK1KYlj7rZe9w6/39W+znk9fCGTnyDoxAFq/Xv1BYn6F1XmT8uubEhE X-Received: by 2002:a5d:84d2:: with SMTP id z18mr1115395ior.130.1627505234622; Wed, 28 Jul 2021 13:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627505234; cv=none; d=google.com; s=arc-20160816; b=gq1awsprkr139fhaahEAHxwMUuuTjLArWiJ7cg7VOVPraWZ7+WhFFy1itTU3NMtCAp rZLBAwchuJigvwFCWa6cEYZDWuiHr+j2Q+3vpAGYwTqoX6Qbfiz8vp6glKdP1Xu6agA3 HwmK825YmuERCZQIqQOLBDHgTUA2aEdJsTEo7KGvn6ZMSBa9MfY2AnBIXYZZOoypz6bL M4WafmCHi40EJdJdvSs0B82HnSKj0sRyKcXxkbcOLtTm0Jx6XUYl3xZIk/veIgZ6VbuA mPvt2v54bdDAqgb2KTV7GzBhbWs1CFjo5GyyHsB2YKQDC+9rCKfCSGEEkJ+HHqiybR5y 7myQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=JKhYNwVtUcp4ro2cn3vBpepmIsUitpS2N9O0Akilpxs=; b=heUzbnoHvkV4WVPlfAVm0zBtPlFMq53+iqWMlfyjrgGqAVpQATqEOH6ggeqvVwmwBT +sWqzjvNGfp7i3b8YFZwf2/eEiIezPei/sTSTFI3N16NHhXWEgL/iVJ1KkqD+FnB8yhS 20aTt0G0akX+Sx0bJitKR2yWnJBfypYAMgGRvk07D5RwarrE3O1ouq0rd+3Bn6bQqawf lX1OpgREXCJEY4QI6lhVT7hW4XBr5+QZ5/Z0aFGKERSHMjnIq35XBSuxa6PgsKNv3pfB 7XDNe21G4st/cjZqUsgY9BA/su/KBjLvbYQvSxoLl+n8pOSLYJ8wXlFlppMVO4ua4/mU swwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=TjRNT1lB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y11si1012806jat.64.2021.07.28.13.47.02; Wed, 28 Jul 2021 13:47:14 -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=@google.com header.s=20161025 header.b=TjRNT1lB; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231636AbhG1Uol (ORCPT + 99 others); Wed, 28 Jul 2021 16:44:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41000 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231594AbhG1Uol (ORCPT ); Wed, 28 Jul 2021 16:44:41 -0400 Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F072C061765 for ; Wed, 28 Jul 2021 13:44:38 -0700 (PDT) Received: by mail-pl1-x629.google.com with SMTP id k1so4172961plt.12 for ; Wed, 28 Jul 2021 13:44:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=JKhYNwVtUcp4ro2cn3vBpepmIsUitpS2N9O0Akilpxs=; b=TjRNT1lBPk9nMKLFJP4cYldUWDOJ85jWLeh7Fm6QUt+euyu2F9X+/9RhdzUaAaCk6c 68wNsxdZrCHj9MPFrP1HymbrqMOHz+YW1bkHcj2b3ZvOZ4J3pGKpUWN8B7qaoxRb+DmC RPs0AegkISl8MzmjBNr7uM8kqWmkuDsEI4tuk4bRBjxQVntvR/zwCz6MyMWN+lxQM0sJ e3JRPxfoVMRzZLhjMfXyGIGAi3YTfTV9rWX3MCO2xwsbeCUxg7icDHuiOzfmfOL0Jqnr 3JcZ1DvHH82smpwmExd9Bt7WUP0DN5GrgXX6TCvXuLcTllJj9sMR1Eyrg7zVplWQ4ONa tKNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=JKhYNwVtUcp4ro2cn3vBpepmIsUitpS2N9O0Akilpxs=; b=Z/ucBY0U4kM6INCQZg9HmaiB3WD+dlCWQ8jXVxRbKa9JmM5NgSyYe1w4w9pWlxgleH U7n0sG2FkBE3NIMFE3Cx+9ys/8Ir4A07gfuGmhMgecGYh6j2pgDQpwRfKZp/+d1XTlSr 4ZHnwCrZO1Nk24tXaYrOSmqTkeQ14OCmlxs4a+XXqkdW6QOsUUMRoV1rDoLdR1DaMMCG de/mZQ/JkBU7neQyPxh78OTOPpNyhxCM25JKVCb8ODQDl2Hh2IbJgb0Eo2rh7F4+GlXl XkD9QYQaioVirc/HC1dIxD/KRvC4KSCn7u/MLpsta3uvy6fIHTiDegsnDO/r1AU2s8Ik TkNg== X-Gm-Message-State: AOAM530FEfpz7OZRdaICSVZPPjhJIeZ7c8bMrIOkqt/gshdAMjRiorzj y48Q3Dy+/fKZ/bjSKaHmwnHLag== X-Received: by 2002:a63:4423:: with SMTP id r35mr685414pga.358.1627505077700; Wed, 28 Jul 2021 13:44:37 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id on9sm6637907pjb.47.2021.07.28.13.44.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 13:44:37 -0700 (PDT) Date: Wed, 28 Jul 2021 20:44:33 +0000 From: Sean Christopherson To: Nadav Amit Cc: Reiji Watanabe , Paolo Bonzini , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , KVM , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 46/46] KVM: x86: Preserve guest's CR0.CD/NW on INIT Message-ID: References: <20210713163324.627647-1-seanjc@google.com> <20210713163324.627647-47-seanjc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jul 26, 2021, Nadav Amit wrote: > > > On Jul 19, 2021, at 9:37 PM, Reiji Watanabe wrote: > > > > On Tue, Jul 13, 2021 at 9:35 AM Sean Christopherson wrote: > >> > >> Preserve CR0.CD and CR0.NW on INIT instead of forcing them to '1', as > >> defined by both Intel's SDM and AMD's APM. > >> > >> Note, current versions of Intel's SDM are very poorly written with > >> respect to INIT behavior. Table 9-1. "IA-32 and Intel 64 Processor > >> States Following Power-up, Reset, or INIT" quite clearly lists power-up, > >> RESET, _and_ INIT as setting CR0=60000010H, i.e. CD/NW=1. But the SDM > >> then attempts to qualify CD/NW behavior in a footnote: > >> > >> 2. The CD and NW flags are unchanged, bit 4 is set to 1, all other bits > >> are cleared. > >> > >> Presumably that footnote is only meant for INIT, as the RESET case and > >> especially the power-up case are rather non-sensical. Another footnote > >> all but confirms that: > >> > >> 6. Internal caches are invalid after power-up and RESET, but left > >> unchanged with an INIT. > >> > >> Bare metal testing shows that CD/NW are indeed preserved on INIT (someone > >> else can hack their BIOS to check RESET and power-up :-D). > >> > >> Reported-by: Reiji Watanabe > >> Signed-off-by: Sean Christopherson > > > > Reviewed-by: Reiji Watanabe > > > > Thank you for the fix and checking the CD/NW with the bare metal testing. > > Interesting. > > Is there a kvm-unit-test to reproduce the issue by any chance? No :-/