Received: by 2002:ab2:1347:0:b0:1f4:ac9d:b246 with SMTP id g7csp280799lqg; Thu, 11 Apr 2024 02:40:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWetc7khQ7fLVl0N3fJ/c2DlzJDqGUtMl13cqC6o1YsBJq8rlrcnnuyGENeeEfSfDFLANVNKV+E5PQQHLTOCq7ocNBcqoPFjtD9CYAuMA== X-Google-Smtp-Source: AGHT+IGNJQPMEDLTQeJtt6Sk9aTka+m68mtSZmaUGOsnWaX99gXKtcI3b9p8LwSW0+PQNhn2qc+6 X-Received: by 2002:a05:620a:84c:b0:78d:6ac6:51d7 with SMTP id u12-20020a05620a084c00b0078d6ac651d7mr4910271qku.69.1712828440784; Thu, 11 Apr 2024 02:40:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712828440; cv=pass; d=google.com; s=arc-20160816; b=tJbPy6/xKrKqiUn/WHFRzI7ER4zjiIdOUo7Lns4V4EVh+ehufmb4JOzTjpIjfwS2aA acsTfjWmvScRaxN4oSZIfzNvaMnKxubUClGVWp9K0bNJljSzT2abcaGLhTUAXJBVmCwF 5ZW7gUVQlVMa346Ifb7AXajY7/rai5yVYkf7cDku1TspmqOxzka/NzRMP227KVk9NXwt CdBa6HUWD64n6wiewabkxYKVxjSG6pGpLxguQK984ZpbGXqYXNQ1ehWgC9QiVSi0txgH TUblthsSsUWUZ9Y5aZJhns+OL245o3Mo0xT0nckAC7R4cHAIbBLYIwxgUmpphb1vkHfh EOBQ== 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=XtVgoBqvi7tRd0O01cuQB9/hEhPrLIGhPVaipVmqYoo=; fh=YLWj+IcloBCznZZHoTpu4vfHt+TOEObUisNcekD2WmI=; b=nNRxL8zytC049gDH3JNpDiDuXA2+6YNuSqNbdULK+mTjeuZsNwnwMcwHImWTtxIw7T PNMMW2fsHoN6Z0LIKUBppfh6tQIByEbrEvYiEBq00fzV62UcPjqGTzzUeDWv7IVl0XOh UOQunkP+Gi9MQlMQSQPFSdHqIr4dU8MPcgp49I+O88N68C953Z3KPAyFnxrQ4a/DWNJz JhNZqt0QSUseCaIF8/0mvYyT0f7VTfvKSiaucMEOUP057v4I8EVyW5v1MJmiVRP46t+h E1GrD0g7TFkH5cTMMGwyrv1tYHEs+bPXZGV5Y0yWajwgz9eGxtfr1dZVgQdaqzkt8umn L/UQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=a+CngiCa; 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-140191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140191-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=citrix.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id c4-20020a05620a134400b0078d6681668csi1141590qkl.217.2024.04.11.02.40.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 02:40:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-140191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@citrix.com header.s=google header.b=a+CngiCa; 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-140191-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-140191-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 72B351C214BE for ; Thu, 11 Apr 2024 09:40:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 457DA14535A; Thu, 11 Apr 2024 09:40:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=citrix.com header.i=@citrix.com header.b="a+CngiCa" Received: from mail-qv1-f54.google.com (mail-qv1-f54.google.com [209.85.219.54]) (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 AEC801448EF for ; Thu, 11 Apr 2024 09:40:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712828430; cv=none; b=X5bclCxm0R9HpTJ1R1cUbJBUTVpSj8rAniNHzbITqLckx5hDwqQ8kbp0RCeQld0Z6RVufx7PydyQNh12aASjZQVkF3rtbTV1mbHZqrzutffeEo551zQyAvweBEbiJ20ALxQebdBN5g0taKRAZlYBAim7mtyW0JeFAGGfxfguNC8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712828430; c=relaxed/simple; bh=XtVgoBqvi7tRd0O01cuQB9/hEhPrLIGhPVaipVmqYoo=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mHBIMWJkjEBD1GH07C4Urn4gwqCIGnD1FNfrzWP9hUUvHC/m2QN/SenLtxaTkIYj+EF5Y6wx/EYUMhs/InM+hu/1ljtRlCV5DoqTXnPuAvw+s1QEteoTsPKwm7F7L23zs0HDnX0zoQis4rkgcVAeihvxdx6snJJtDtxRMHTykPQ= 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=a+CngiCa; arc=none smtp.client-ip=209.85.219.54 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-qv1-f54.google.com with SMTP id 6a1803df08f44-69b137d09e3so25566906d6.1 for ; Thu, 11 Apr 2024 02:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=citrix.com; s=google; t=1712828427; x=1713433227; 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=XtVgoBqvi7tRd0O01cuQB9/hEhPrLIGhPVaipVmqYoo=; b=a+CngiCalZv7jS16aPdOv6VSmchBwbM+3E9/SMGnee6kXQMx/s1QrvSNp6eu6BH4zp kkP82Ccnxc75Ed0fPWCEjrylJoYr6Isu2C8WNdAGcMi9qYUt8xQQ008Hxu5k4W5g1MRn AdQ0sD7d1FNIMjts0r1vI63ux4OQ7GdjYIgtQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712828427; x=1713433227; 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=XtVgoBqvi7tRd0O01cuQB9/hEhPrLIGhPVaipVmqYoo=; b=RKzSJ0jIOy74x9cNuOanlbj3sbIwWmIpnSB8lZlrB9ZTmShv6wsgk9riKYxRaYEKSh FbAcnJmZn3rs5UyNZd62xVJc+JoeqO+3ssZa3FmtQxDkUUhwwWmZ3tkcM2y6R2UQFBQq 3MxLwYome6ioc+ZHEVCVDpX+7VnuhWZPfFrtDs+EFhrqblTvmDGwCmsBLxWE1ocaWegt Gd9h7plbUBkroFXg8fGsExTRk9DHCNaN2d6s+fh2mQJRhNYh9PB9dkmnxOisN0lx4T0d kEcZRGbNySpceKWamRZJbKJ3ksHRiK+QtHWLbciWgfKfeUsUdwuZEsAw0o++tKluDE9+ cqAw== X-Forwarded-Encrypted: i=1; AJvYcCXyOC3TAMXZ9Efn6did/NmxWcmFo9pJ1FwlCxdJkjYDRzXk7aFZ6Vyo3aCFVyiejImOcRb8j6BM8eO48Y9hFoFNlIVO1voPHTU1iAv2 X-Gm-Message-State: AOJu0Yz9MV9u72hwurWWmf3ktO2bQQkWW8D1E5nP6eaPICS6uU05FUcD NBASyOoxus/TUPZExVegFQyAwoRHQZ4Z4QhWZ9w/swamrP77rYoNpq/vweO4Jd8= X-Received: by 2002:a05:6214:5096:b0:69b:9f0:aee3 with SMTP id kk22-20020a056214509600b0069b09f0aee3mr6047454qvb.2.1712828427598; Thu, 11 Apr 2024 02:40:27 -0700 (PDT) Received: from [10.80.67.140] (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id d7-20020ad450a7000000b0069b26d7f061sm719821qvq.99.2024.04.11.02.40.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 11 Apr 2024 02:40:27 -0700 (PDT) Message-ID: <8a8845ca-1ac7-4768-a2ea-2a4f9fc5acef@citrix.com> Date: Thu, 11 Apr 2024 10:40:24 +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: Xi Ruoyao , Sean Christopherson , Michael Kelley Cc: Dave Hansen , 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> <8e12f79a8275ffa40858763acade4d54b3e96212.camel@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 cGVyIDxhbmRyZXcuY29vcGVyM0BjaXRyaXguY29tPsLBegQTAQgA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nf3Bbzx81wZK14JdDDHUX2Rs 6+ahAA== In-Reply-To: <8e12f79a8275ffa40858763acade4d54b3e96212.camel@xry111.site> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 11/04/2024 6:38 am, Xi Ruoyao wrote: > On Tue, 2024-04-09 at 08:56 +0100, Andrew Cooper wrote: >> On 09/04/2024 2:43 am, Sean Christopherson wrote: >>> On Mon, Apr 08, 2024, Michael Kelley wrote: >>>> From: Dave Hansen Sent: Thursday, April 4, 2024 11:09 AM >>>>> On 4/4/24 10:48, Michael Kelley wrote: >>>>>> I agree one could argue that it is a hypervisor bug to present PCID to the guest >>>>>> in this situation. It's a lot cleaner to not have a guest be checking FMS and >>>>>> microcode versions. But whether that's practical in the real world, at least >>>>>> for Hyper-V, I don't know. What's the real impact of running with PCID while >>>>>> the flaw is still present? I don’t know the history here ... >>>>> There's a chance that INVLPG will appear ineffective. >>>>> >>>>> The bad sequence would go something like this: The kernel does the >>>>> INVLPG on a global mapping.  Later, when switching PCIDs, the TLB entry >>>>> mysteriously reappears.  No PCIDs switching means no mysterious >>>>> reappearance. >>>> Xi Ruoyao's patch identifies these errata:  RPL042 and ADL063.  In the links >>>> to the documents Xi provided, both of these errata have the following >>>> statement in the Errata Details section: >>>> >>>>     This erratum does not apply in VMX non-root operation.  It applies only >>>>     when PCIDs are enabled and either in VMX root operation or outside >>>>     VMX operation. >>>> >>>> I don't have deep expertise on the terminology here, but this sounds >>>> like it is saying the erratum doesn’t apply in a guest VM.  Or am I >>>> misunderstanding? >>> Huh.  My read of that is the same as yours.  If that's the case, then it probably >>> makes sense to have KVM advertise support if PCID is available in hardware, even >>> if PCID is disabled by the host kernel. >> My reading is the same also.  Seems like VMs are fine. > So... Should I sent a v6 with the hypervisor checking reverted [ i.e. > always enable PCID if boot_cpu_has(X86_FEATURE_HYPERVISOR) ]? If Linux can see a hypervisor, then yes it should be safe to use PCID. ~Andrew