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=-15.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FSL_HELO_FAKE, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_IN_DEF_DKIM_WL 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 0BA8EC4338F for ; Wed, 28 Jul 2021 20:44:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAE9B6103A for ; Wed, 28 Jul 2021 20:44:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231673AbhG1Uom (ORCPT ); Wed, 28 Jul 2021 16:44:42 -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-Google-Smtp-Source: ABdhPJwDNqv6/oCIErCVMa6h8MNsSlG+xcG3LueWac7TWFNwnvzRDteRSi0D00QGsumG2dN8bfz86Q== 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 :-/