Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2058665pxb; Thu, 28 Oct 2021 15:23:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyhatBfduK8+Ee6tZNhogVM421H/UwYtGRUbB3aCeihOBE2adrZ936zwt++eGPdAkPRyZlT X-Received: by 2002:a17:902:6b0c:b0:13f:aaf4:3df3 with SMTP id o12-20020a1709026b0c00b0013faaf43df3mr6476308plk.75.1635459788176; Thu, 28 Oct 2021 15:23:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635459788; cv=none; d=google.com; s=arc-20160816; b=EB8TA7QgLNUYBD6otURxQpvUAT8N/dPI2ryPIomycnIIObNwbbt8TSIsBOYA8RJTgD ub2yOz5qulZpmORS8VpqAK9PlEot2Bzu35O+BY9D7dZ/j18Ihehnvudix+zCydWiaSQT OSqw11w3KnIHBdRpK+8aAd2/cW3OiNHHJ7V1bCCHPmuQCNycTzA5tjcaHf8yyEfL1D1i liBOZXmoLOXYuqgFyujLBopflhE0Wm4psE7/+whWwGGtaq7D8ZNMhIR4aA3XPppDPGJB QBKWDcW8rm6LKkhG9+wr642fX0SC/ChVf1d31OxsSkEBz2nbzBphlXhPx0pQenA0qivf WWJQ== 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:mime-version:message-id:date :reply-to:dkim-signature; bh=PqjjRvX15zED8OdTh3J1r3VA59T74vznUoYXXlWKQUc=; b=VIL3J7lCIAM5utYKjRYqrBumk+eDGVlb3qEluxr9Yu075wjbiZLTxfSb2uWHRAT1SM eqLMrNVWnZw8old+Zejic/QUUhqzJfSE4uqr5Robgjf93GHJSiNW1yCbnOJdnwBpLE/f f7QyOCuWsvcwFtc7pysPOUd1SvmT4N1DwXbQdyAmucdNvdsnxMUVNCGLGp9c1yhtj7N7 fbq8u6vNHqffPIliRoi086FLgq8pO9izVX7AikCGOJm0oYJH7t10hjULCHlNYqP2kgrq 7tkwcJtfP9WpPEN7Pll5QV5DCGTjQJJxHoyuwHriOSv2gt8havOg5O0Z9gVbJwvbHIdO cSJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=e+hAzVuv; 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 u9si4002465plg.63.2021.10.28.15.22.53; Thu, 28 Oct 2021 15:23:08 -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=20210112 header.b=e+hAzVuv; 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 S231298AbhJ1WY0 (ORCPT + 99 others); Thu, 28 Oct 2021 18:24:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231393AbhJ1WYZ (ORCPT ); Thu, 28 Oct 2021 18:24:25 -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 17809C061570 for ; Thu, 28 Oct 2021 15:21:58 -0700 (PDT) Received: by mail-yb1-xb4a.google.com with SMTP id y18-20020a25a092000000b005bddb39f160so10749859ybh.10 for ; Thu, 28 Oct 2021 15:21:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=reply-to:date:message-id:mime-version:subject:from:to:cc; bh=PqjjRvX15zED8OdTh3J1r3VA59T74vznUoYXXlWKQUc=; b=e+hAzVuvA6pZEdq7ha9j/xZ/wi+tB54o3Cg4uhZp8Vrfl4yCNs96yhs/i/fR6/f7+U M8pGUHDA7w0nSKXzjtwPSgHXl1e4uKsHZw5dXrMqSLxGCVNB8JNbE+auE4zRqRqpS88X I3Vtg1f6Hw3cKHJNXydZ+toZKxwe1Zag1CPyoCJh/V0c3i402VDdoTx9FSLEV+tNM6Uc 0r5t6mv3cYXMd+aHHrNqM3CUYWlFINfbohoBc3XYUGsIqlrk/ZScAUrlPyA4Pe+aeBsB zhJi3oPs9R54W8Y485icAVY8fB8lfn0P49ayeDPuEGU6kRdI8zSzhyP7uz2ocGwItbwl a0JA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:reply-to:date:message-id:mime-version:subject :from:to:cc; bh=PqjjRvX15zED8OdTh3J1r3VA59T74vznUoYXXlWKQUc=; b=IjkUyZFWHQ07g+IJPVqIQGOeO5n+A0GuW2V0FgC9qe9ZAl84HsMWdW2qK3MD4r0b1U k61df99oMnRGGImf5uyGGGhjFXIKJwuhUJYQBZuZ2EKzEdwhGUvC1ACjQFAiT08d6kdc KZy+ptCNuCTrfFyD49M7amFCdXYOoChvkCYGxoPSaBOJgG4f0xDv5tWxnV8JXY6fKhnb 9AOEK+5l+mEGlGb36wJoGG1VRzwavW9aS14PFre/LPFCij6/f1hc4iTUoIdIBkS0BS3d 0DQ31KvKNEDSjQbmU8paXe7WkGT3b5CeoKc5uXUVcyOQoIPZf65fnnl5w7lSoyX0X6up w0Zg== X-Gm-Message-State: AOAM530No2Dq37zwnJG1WrXNYMtUCz1G/QiqiPskJV28Kcxr3CLK2CZZ R5/iHpF13IS4Tq9O5XhJu5k16zoNUZs= X-Received: from seanjc798194.pdx.corp.google.com ([2620:15c:90:200:cbc8:1a0d:eab9:2274]) (user=seanjc job=sendgmr) by 2002:a05:6902:1029:: with SMTP id x9mr8512263ybt.67.1635459717288; Thu, 28 Oct 2021 15:21:57 -0700 (PDT) Reply-To: Sean Christopherson Date: Thu, 28 Oct 2021 15:21:46 -0700 Message-Id: <20211028222148.2924457-1-seanjc@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.33.0.1079.g6e70778dc9-goog Subject: [PATCH 0/2] x86/hyperv: Bug fix and what I hope is an enhancement From: Sean Christopherson To: "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org Cc: "H. Peter Anvin" , linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org, Vitaly Kuznetsov , Sean Christopherson Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Patch 01 is a fix for a NULL pointer deref that I ran into with a bad VMM configuration. Patch 02 effectively makes the required MSRs mandatory for recognizing Hyper-V at all. I'm not confident this is truly desirable, e.g. there might be some features that are still kinda sorta usable, but on the other hand there's a large pile of features that end up being a waste of cycles to worm their way back to the native ops. QEMU 5.1 (and other versions) makes it all too easy to advertise Hyper-V and a slew of features without advertising the Hyper-V HYPERCALL MSR, e.g. forcing QEMU features +hv-ipi,+hv-tlbflush,+hv-vpindex,+hv-reenlightenment advertises a bunch of things, but not the HYPERCALL MSR. That results in the guest identifying Hyper-V and setting a variety of PV ops that then get ignored because hyperv_init() silently disables Hyper-V for all intents and purposes. The VMM (or its controller) is obviously off in the weeds, but ideally the guest kernel would acknowledge the bad setup in some way. Sean Christopherson (2): x86/hyperv: Fix NULL deref in set_hv_tscchange_cb() if Hyper-V setup fails x86/hyperv: Move required MSRs check to initial platform probing arch/x86/hyperv/hv_init.c | 16 +++++++--------- arch/x86/kernel/cpu/mshyperv.c | 20 +++++++++++++++----- 2 files changed, 22 insertions(+), 14 deletions(-) -- 2.33.0.1079.g6e70778dc9-goog