Received: by 2002:ab2:7a55:0:b0:1f4:4a7d:290d with SMTP id u21csp388345lqp; Thu, 4 Apr 2024 17:12:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXa0tKA8EGf9EhYrRFJ8bSbTsNGachQyfM8AQhMnuSgcJPi2PXzSDMr01NVf/YsubkcS/jYzRu3hyVeyj86Nt/0FE4kKQxQvj6wX+XbUw== X-Google-Smtp-Source: AGHT+IHiDbmUr/ouSbNudVWxAfg/dZihYcVja9ap6WpB4a6B0881ZkJ9nCeoEhHs48nTNV6QHgIj X-Received: by 2002:a17:906:1397:b0:a4e:37ac:79c8 with SMTP id f23-20020a170906139700b00a4e37ac79c8mr597642ejc.5.1712275942138; Thu, 04 Apr 2024 17:12:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712275942; cv=pass; d=google.com; s=arc-20160816; b=MWiG/fu6FlJILbNt4la1cvdPM/6qzLO6YvXDTDQsysJP77S+KY3txh+Mi44sph3+Uj q67o6H92GFdmaXHUGPXX5DI6zmqaOZJelQ0d6x4VtXBaO7O1bVIDM8PVYRFko3OyGlQw Q8evR9qMCfhdajgUEcyCNtEZRJ2RddQbO694IDQfGAjkJO+4U3O1gZQlkXsqPtLd9B9l 624YiWR3dVDl0ZbxMeCdq6d6Hvf2YuOS8QJnl1vBIdv1StVod4qgUHUEndlA4oRnvNZI JlHX+jVc9+P5RS+Ow7iD8gX7We3oui3/vRZAwb528FFncfP7wGx37jziQIMmdIN6vut/ Breg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=v32aIy9nV1F7KP1TrMOQYVetbDspxaKLvELe397BNqc=; fh=8SYmSh/nACTru9iVLBtD0wbfoz5ao52wTdtuYjQS66E=; b=Bg15R2rvckk9yX1wszMKn5TUZJKl9qt8eF9ZBNeJlz6g4fW1sKVKGmg8Nvod6sVj2s l/Lhxk8TkFCrVrcBvp9W0gbvHmPGIJXW9XJwjvGLXB8xvi5AKFc4sSPh3T2fLuM9e4z6 VKfkgVpZbudV7MQFBWZQrGP4uO18o05IjPBkpplXDTUskEuSo1owoUUcHMaVPvcPNih6 ciVsImwmZHuG9P51x5MjIc3jDRH3UvBQqe0aNt1bPqEeEeOuq3N5X3YQwWa2QwKohu7Z 4nVzdcUBkXzqM8uToSpSLfSDM2T8SMDaMffp6dgOmY3oB+0yOdYyQC5p3EXsdzZ75kMG qvKQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=mEqoB2Os; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-132278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id t12-20020a1709063e4c00b00a4e345aab05si152407eji.186.2024.04.04.17.12.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Apr 2024 17:12:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-132278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=mEqoB2Os; arc=pass (i=1 spf=pass spfdomain=cloud.com dkim=pass dkdomain=citrix.com dmarc=pass fromdomain=citrix.com); spf=pass (google.com: domain of linux-kernel+bounces-132278-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-132278-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 85C031F2844E for ; Fri, 5 Apr 2024 00:02:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1CB954A1A; Fri, 5 Apr 2024 00:02:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="mEqoB2Os" Received: from mail-qk1-f173.google.com (mail-qk1-f173.google.com [209.85.222.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 798CF17F8 for ; Fri, 5 Apr 2024 00:02:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.222.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712275332; cv=none; b=Pb8PAmcv2RPuuIE9cYgx2L0SBXi7ekR5hUsNYMnEJ4Za/ZhV4INu69HxC00X4I62ZJvLUFhQX9joIODRAImqbNnj/vI8jqbZQwLvQaq8MxBxdrvRVsCZ/ciQiDk+rYRrh/u8ztfkCMygfp+Bckpdpd7j6Kq9umKrnhTgqRB6y44= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712275332; c=relaxed/simple; bh=v4LlNHfWy/P+pB9J/W/vupzaAjt0ATCjweEvEbJ9Xlo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=TIOYNeEPoFZWwkAj73NkDVJOWA77LnQaJVeed96Ilum3rDgd7lUXjRhOmctjiie18f+vCyREo0nz30vs0775B13b3Ydn4nX5aW1tyOlFaFlXHLpsCL/Kz3ij04XE7hQ6+QM25KM+/XaW2XNoV3pINm6ej05ah9eklta4kDdmZ9A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com; spf=pass smtp.mailfrom=cloud.com; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b=mEqoB2Os; arc=none smtp.client-ip=209.85.222.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=citrix.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cloud.com Received: by mail-qk1-f173.google.com with SMTP id af79cd13be357-789f00aba19so104407885a.0 for ; Thu, 04 Apr 2024 17:02:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1712275329; x=1712880129; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=v32aIy9nV1F7KP1TrMOQYVetbDspxaKLvELe397BNqc=; b=mEqoB2Osa5IT1Vf77iudDK0fNrZ812Y3Sf2+eI8VVq6WAzPBMo2bA/adaIFUvacbRv Rbi9meRIcBToTGZ6XPqdwWB7+aqV3SyeesriRcE9Iq4/st5RCzbwROemy/8NkiZVuT9u tYfpQBUareSs14HXFYXulYQjnfq8K95+DJPak= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712275329; x=1712880129; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=v32aIy9nV1F7KP1TrMOQYVetbDspxaKLvELe397BNqc=; b=kfyshveGWtnIf3WRUs/QE8Z/H5eispapsOPdCqd9J/qTMd59CMrnpOAdjm0j670IGD FlVP6bKPjHHvw9G8HbAqKgjqGuoz7dcXJlM1pXwZcWrqrICEizABeh1rJ0YmZkyRMQCu xppvJrUDziVBjqlfgtXd2W1iYCxaBkwxLewXGRUns1NykIImVq4oFvVGd6ZAxfJHHft/ blOlb9+4oLDnwuYQZWkL0UoJeOsDGiRAR5D0O2Mo/aGG+6t4hV0bSnXPggCCcTuSbNE8 C6D0Mpgr93HZ1kYEc15bb7pB+e7HIeTSJExnwHE5b4o7RK8wOGQUQ4bfTUnE3w6cgiA4 D0ew== X-Forwarded-Encrypted: i=1; AJvYcCURVfxWT7DGfgz3safLflMn05QYLGT4w6SwcI/fXZgzNtu2Q3S/TnBgeE/3TD1cqx2nLffYSte5kdhbmtPNOhoGO+86ih38nJUSNQRo X-Gm-Message-State: AOJu0YzmUViAfoi2X2cTRMSHfo4fQdDEoZzYV1jV7F/0bSvomNZ290lN OqKjKWRNeo8LuXj0g/KOtug+/mSvJQ6Q6XT0s08f0uLyJKDKRQdBioR81YWo+qs= X-Received: by 2002:a05:620a:b0c:b0:78d:4851:e34c with SMTP id t12-20020a05620a0b0c00b0078d4851e34cmr612735qkg.11.1712275329314; Thu, 04 Apr 2024 17:02:09 -0700 (PDT) Received: from [192.168.1.10] (host-92-3-248-192.as13285.net. [92.3.248.192]) by smtp.gmail.com with ESMTPSA id x9-20020a05620a14a900b0078a47c3a3f0sm194907qkj.38.2024.04.04.17.02.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 04 Apr 2024 17:02:08 -0700 (PDT) Message-ID: <0e3b8b42-4567-4db8-9f82-659d0ea10597@citrix.com> Date: Fri, 5 Apr 2024 01:02:06 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2] x86/mm: Don't disable INVLPG if "incomplete Global INVLPG flushes" is fixed by microcode To: Sean Christopherson Cc: Michael Kelley , Xi Ruoyao , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" , Dexuan Cui References: <20240324190503.116160-1-xry111@xry111.site> Content-Language: en-GB From: Andrew Cooper Autocrypt: addr=andrew.cooper3@citrix.com; keydata= xsFNBFLhNn8BEADVhE+Hb8i0GV6mihnnr/uiQQdPF8kUoFzCOPXkf7jQ5sLYeJa0cQi6Penp VtiFYznTairnVsN5J+ujSTIb+OlMSJUWV4opS7WVNnxHbFTPYZVQ3erv7NKc2iVizCRZ2Kxn srM1oPXWRic8BIAdYOKOloF2300SL/bIpeD+x7h3w9B/qez7nOin5NzkxgFoaUeIal12pXSR Q354FKFoy6Vh96gc4VRqte3jw8mPuJQpfws+Pb+swvSf/i1q1+1I4jsRQQh2m6OTADHIqg2E ofTYAEh7R5HfPx0EXoEDMdRjOeKn8+vvkAwhviWXTHlG3R1QkbE5M/oywnZ83udJmi+lxjJ5 YhQ5IzomvJ16H0Bq+TLyVLO/VRksp1VR9HxCzItLNCS8PdpYYz5TC204ViycobYU65WMpzWe LFAGn8jSS25XIpqv0Y9k87dLbctKKA14Ifw2kq5OIVu2FuX+3i446JOa2vpCI9GcjCzi3oHV e00bzYiHMIl0FICrNJU0Kjho8pdo0m2uxkn6SYEpogAy9pnatUlO+erL4LqFUO7GXSdBRbw5 gNt25XTLdSFuZtMxkY3tq8MFss5QnjhehCVPEpE6y9ZjI4XB8ad1G4oBHVGK5LMsvg22PfMJ ISWFSHoF/B5+lHkCKWkFxZ0gZn33ju5n6/FOdEx4B8cMJt+cWwARAQABzSlBbmRyZXcgQ29v cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgAJAIbAwULCQgHAwUVCgkI CwUWAgMBAAIeAQI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Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 04/04/2024 6:28 pm, Sean Christopherson wrote: > On Thu, Apr 04, 2024, Andrew Cooper wrote: >> A related example.  I wrote the patch to hide XSAVES to work around an >> AMD erratum where XSAVEC sufficed, and the consequences were so dire for >> some versions of Windows that there was a suggestion to simply revert >> the workaround to make VMs run again.  Windows intentionally asserts >> sanity (== expectations) in what it can see; I have no idea whether it >> would object in this case but hiding PCID is definitely playing with fire. > Yeah, KVM users got burned by that too. d52734d00b8e ("KVM: x86: Give a hint when > Win2016 might fail to boot due to XSAVES erratum"). Yeah what I meant was that I wrote the Linux patch, and KVM got burnt while Xen cared not... :) > Hmm, one crazy idea would be to carve out a hypervisor CPUID range for enumerating > (potentially) broken features. Dealing with the Intel/AMD (and Centaur, LOL), > 0 / 0x8000_0000 split would be annoying, but not hard. E.g. use 0x4{0,8,C}01_xxxx No transmeta love then?  Or perhaps we declare it their fault for choosing 0x8086 which is too awkward to fit into that scheme. > to enumerate broken features, and then the guest could do: > > support = CPUID(leaf).reg & ~CPUID(to_pv_broken(leaf)).reg; > > It'd require a decent amount of churn for the initial support, but it would give > hypervisors a way to inform guests that _any_ CPUID-based feature is broken, > without requiring guest changes (after the initial code is merged) or explicit > action from hardware vendors. > > And if we got Windows/Hyper-V in on the game, it would allow them to keep their > sanity checks while (hopefully) degrading gracefully if a feature is enumerated > as broken. Crazy indeed, but I am curious to see if this has legs.  The exact indices may need tweaking, because 0x4x01_xxxx might be a little too close for comfort, but at first glance it does look like a surprisingly neat solution to the problem. Perhaps worth a slot at plumbers? ~Andrew