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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03C97C433F5 for ; Fri, 20 May 2022 15:22:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349552AbiETPW4 (ORCPT ); Fri, 20 May 2022 11:22:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58956 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229864AbiETPWy (ORCPT ); Fri, 20 May 2022 11:22:54 -0400 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4AC0E90CF6 for ; Fri, 20 May 2022 08:22:51 -0700 (PDT) Received: by mail-pl1-x634.google.com with SMTP id i1so7632189plg.7 for ; Fri, 20 May 2022 08:22:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=X3IHiwJ5wNPFuRIjw/VX2fzWcO2GqNMg+EtMwnbtcCE=; b=Lw9XBrUO4xElFv3poICpOcWJu7FGnbiIqec8UL03MtLFgaxCtXdELyyU01GqXohLhG ShwFlWiXPeW6W8Q56lO3LDtvidFAo2yugJk9HsvO51es/ka1Jey05DtwFXvURpcBxfpc mDSYYNXPRkjUoUy0fmdipEdgQibnoNIEXsNzqeWm4OT9DxLKxxZJmaocxd7wQoW4VaNC 96wPbMsKKeZmGgU3mKOKYQuiRCUHxBzf9VPs6ANwTfUo3tbyKcJUnmCYm4noTepL5bgG LJ/QLgGZnJoYH3RmYJTNOHkbissXm6C6k/G4lUOr467x5nxIzo2SMtkpg+mRdtjxEEKg 9gOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=X3IHiwJ5wNPFuRIjw/VX2fzWcO2GqNMg+EtMwnbtcCE=; b=N3kMqWzSV8Gk6Xm88dXiwYy3a+mfl8NaCTFiNTPLizNckN1tB2WJWzM5INK6gCKC36 b6tYxb5fiY3HeYdceGSNT2AXplk4M3K17Ai/TTnbAmmjMAvkmdSsOWF3/Ajf0IFnQHZb Q4NU/xjZkZWtlGt425aLQgL4qS8KGnZZDy7MGK8GKQoyIwuwrSs5GVW9zaNXg4KWc1zd 7ujhP2XpZD0c7MadJN2SlDrv+EKFn3LF9NSMnpkH+wuJu5/2scYp3YO0Vo5MpN5EyvCk HVwSoc+aEuLMOwJw9XDqGMGqm5tVrlNvBoZpEMnEYq4ujlc+SjATzFPRNA4mJRbSWb+e /jBg== X-Gm-Message-State: AOAM533uQuT/13IYcur3juGpuuxYbYJxjhV3hQ4bJ4kCe8Nf0TM1E4vL Skh+vlRe2QtkvNInrUMeem0XIQ== X-Google-Smtp-Source: ABdhPJwuvq1qttPnmoP+Ns3E7RUaVZkJpXBX26PbcqkQaKLv3r2ql2j3lVmm8sCHrFVsSaZoHLYVrQ== X-Received: by 2002:a17:903:244d:b0:161:ac9e:60ce with SMTP id l13-20020a170903244d00b00161ac9e60cemr10626530pls.160.1653060170586; Fri, 20 May 2022 08:22:50 -0700 (PDT) Received: from google.com (157.214.185.35.bc.googleusercontent.com. [35.185.214.157]) by smtp.gmail.com with ESMTPSA id x21-20020a62fb15000000b0050dc76281b8sm1990007pfm.146.2022.05.20.08.22.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 May 2022 08:22:50 -0700 (PDT) Date: Fri, 20 May 2022 15:22:46 +0000 From: Sean Christopherson To: Brian Cowan Cc: "kvm@vger.kernel.org" Subject: Re: A really weird guest crash, that ONLY happens on KVM, and ONLY on 6th gen+ Intel Core CPU's Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On Fri, May 20, 2022, Brian Cowan wrote: > Disabling smap seems to fix the problem... Mwhahaha, I should have found someone to bet me real money :-) > Now for the hard question: WHY? The most likely scenario it that there's a SMAP violation (#PF due to a kernel access to user data without an override to tell the CPU that the access is intentional) somewhere in the guest that crashes/panics the guest kernel. Assuming that's the case, there are three-ish possibilities: 1. There's a bug your company's custom kernel driver. 2. There's a SMAP violation somewhere else in RHEL 7.8, which is an 8+ year old frankenkernel... 3. There's a bug in your version of KVM related to SMAP virtualization #3 begs the question, does this fail on bare metal that supports SMAP? If so, then that rules out #3. If the crash occurs only when doing stuff related to your custom driver, #1 is most likely the culprit. One way to try and debug further would be to disable EPT in KVM (load kvm_intel with ept=0) and then use KVM tracepoints to see when the guest dies. If it's a SMAP violation, there should be an injected SMAP #PF shortly before the guest dies.