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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6EF71C25B7C for ; Wed, 22 May 2024 22:03:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D73FA6B0096; Wed, 22 May 2024 18:03:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFDF76B0098; Wed, 22 May 2024 18:03:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9DF86B009B; Wed, 22 May 2024 18:03:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 999AE6B0096 for ; Wed, 22 May 2024 18:03:42 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 5543F1A514D for ; Wed, 22 May 2024 22:03:42 +0000 (UTC) X-FDA: 82147409484.21.5E1EF36 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf17.hostedemail.com (Postfix) with ESMTP id 37F8A4001D for ; Wed, 22 May 2024 22:03:40 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NJLjQj8U; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1716415420; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=B4hXJ6JIsSVK9s0rSIg6c+3f6ReWIevwF2URwvf4CAk=; b=Vv6g4IMaNjrMB4vWUvI0Wsq2jrq7k2FmpbjqcVWTw4JFdY9Y31Gqf8fVukeyCF8+KPs0BF PleZ4nWeM4UFizi3Si8hBlEwUMYy7vnqUEKUNwyH+RCN+HFFxfqFCmWA8v11BpJGSXgLfm pAx4/tIKpZ0p0/n7CDV97rgxzmDpQ/M= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NJLjQj8U; dmarc=pass (policy=none) header.from=redhat.com; spf=pass (imf17.hostedemail.com: domain of peterx@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=peterx@redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1716415420; a=rsa-sha256; cv=none; b=Z4yL5lpuOVeVagxtqDVsvhVT47BhB2XJo5lU3jfxJOBrFbtqBDMPxdShbpkPUCmdLE6+kA schCV7jNTULtD8R+83ButoU4qX1pV032ROu6ARVsrNRnEPd39llJw+INyeVbp+EbrkjuPu sRrSdXHA3aTYrcVYQHsB5jrCh9Gny0I= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1716415419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=B4hXJ6JIsSVK9s0rSIg6c+3f6ReWIevwF2URwvf4CAk=; b=NJLjQj8UVOseY8MJUFA6iW2kPZZZua0hnDbK0VXEiuvCxXYahyKl0wHdu0u7qBaGR+HOin j+0OXOsFWSTL8fVYwDjUX52Y+iA/NqXWh0sRhwgh4tv2xRYIM0IOR2Pw/zLUiwi84btUfV l5Wxxa6fXsc0f725Uvus5uUUIlsstRY= Received: from mail-oo1-f70.google.com (mail-oo1-f70.google.com [209.85.161.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-369-ysbZxmHCNTejCCMhq2SZcQ-1; Wed, 22 May 2024 18:03:36 -0400 X-MC-Unique: ysbZxmHCNTejCCMhq2SZcQ-1 Received: by mail-oo1-f70.google.com with SMTP id 006d021491bc7-5b23e93f5d0so210792eaf.2 for ; Wed, 22 May 2024 15:03:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716415415; x=1717020215; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B4hXJ6JIsSVK9s0rSIg6c+3f6ReWIevwF2URwvf4CAk=; b=wx4ZsGBHhFHaKlLamac7YHQeBBUfLkBgUgtHP//IY5728DPb6GhzJHWm9+qfQBuS05 VPtwQ+Z98H79hIiO8BlEUG2UvCv9pxY2ZPFYXIqdAYRrtcm2kClzR1j7jDBvDk1oMK+y H5gCVTC0iHAFoGI3HuTUQ66+HRE6W6V8Dn4bmUWDbJgT8xsuZKYZ+PIBxdNO8qx4/adA ohPzAD0gIFjwyYLYHdE+x1vlOwii/vz9dgnnngMFpyzg+KzVUh5SSPUgI0rMvitPj4F8 uwoEXDegTrGJhDM1t/dLuwKqaWh2+yQM0Q5Cjjx0Tsek5WYZsQ+ZtTUOSJs3ohfkDK1+ aWPg== X-Forwarded-Encrypted: i=1; AJvYcCXP/nONXAggAiORT/vZJPHUCfYTwv26C1MUB0SYWgeessLSqwF0BcdkIc/9zT2ehmj1Be3c/PyW1CkE8qZwkMGw92U= X-Gm-Message-State: AOJu0YzqFv3CKv2WxvzZA8Yu3qNhDC0f0jmJR4MpYeD6HKoqsI9dJWnJ O/5sSNO2ILt1GSSRcwHWLm3OShh8Du8jDKfHzwhs38u+EtGePhqWHDnJ7phrvZMAkVLCFRRxi3A mb1TE9H0cEXPm3hAZqWsuSC0wFFC9dNdhz4OllfW/PFF3P5pC X-Received: by 2002:a05:6358:998a:b0:190:f30c:3856 with SMTP id e5c5f4694b2df-1979215b528mr285579955d.2.1716415415129; Wed, 22 May 2024 15:03:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHlZSZyKnZdnEG0+pNanazMyIfCqIlp5QZYYe1QG8gY0ave2/OHUyQlsME1+uHDBoxePLQG5g== X-Received: by 2002:a05:6358:998a:b0:190:f30c:3856 with SMTP id e5c5f4694b2df-1979215b528mr285573755d.2.1716415414181; Wed, 22 May 2024 15:03:34 -0700 (PDT) Received: from x1n (pool-99-254-121-117.cpe.net.cable.rogers.com. [99.254.121.117]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6a15f1cd266sm136937796d6.80.2024.05.22.15.03.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 15:03:33 -0700 (PDT) Date: Wed, 22 May 2024 18:03:30 -0400 From: Peter Xu To: Borislav Petkov Cc: Axel Rasmussen , Oscar Salvador , Andrew Morton , Andy Lutomirski , "Aneesh Kumar K.V" , Christophe Leroy , Dave Hansen , David Hildenbrand , "H. Peter Anvin" , Helge Deller , Ingo Molnar , "James E.J. Bottomley" , John Hubbard , Liu Shixin , "Matthew Wilcox (Oracle)" , Michael Ellerman , Muchun Song , "Naveen N. Rao" , Nicholas Piggin , Peter Zijlstra , Suren Baghdasaryan , Thomas Gleixner , linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, x86@kernel.org Subject: Re: [PATCH v2 1/1] arch/fault: don't print logs for pte marker poison errors Message-ID: References: <20240510182926.763131-1-axelrasmussen@google.com> <20240510182926.763131-2-axelrasmussen@google.com> <20240515104142.GBZkSRZsa3cxJ3DKVy@fat_crate.local> <20240515183222.GCZkT_tvEffgYtah4T@fat_crate.local> <20240515201831.GDZkUYlybfejSh79ix@fat_crate.local> MIME-Version: 1.0 In-Reply-To: <20240515201831.GDZkUYlybfejSh79ix@fat_crate.local> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8 Content-Disposition: inline X-Rspamd-Queue-Id: 37F8A4001D X-Stat-Signature: 1d5nsb1k8iyxfx84xggfhjt8zgpi9sfb X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1716415420-653485 X-HE-Meta: U2FsdGVkX18gyTmPE4mgZhf4urMnyIRoxM3I7qe1mH2R2/adcSQN0HEhelVev5196bRpvUX/TvzPKqvKMlBkBkGEDzP8e7IOCGa2fg11oTlKMi36X/wbzZVwrpliYIQmP3cO+wmGwUOzbPxoCx5bkrtb7Oyb82E67AXfNPBw8rxPa15QcFw7z6O/91p6xcYoja4U5nVhngTWDIV6LhLQkuTqQ2O3NXazUrq/qduHdff+C7zW2vvRUKtQASWFbD8BJJ0SKo68h3l2m9IrmRXhL8PFsU2IcCdZPb0jVoEGr13rhXQfEVC1K1o3/R9OksrYBTrvntFf1j3TaVjHXupcmD6eE2+a0KHt9zgLM8rosTLXZv0tPGrKh+CJ2uPy6fjz+2bczopdx8+BzutB44DAwLD6yhfG9iTl+gvlmv58+nD3QUPHwHbD0/Q3na0/zY2AEW8wGi2+0N1ubc7t4So2RNXFgpZpfDrGeqrgcBMaHS5WBWiMmOV3wfOP5ZaQlV5wyGN/TqIL5/mM4lt1F+Jx/m4+fzS+lvY/7U9jCRk8qjMYz5ppLojKp7mjgozBbGmrRkuIbl35zb2D8IFZKwirvAwe7fDaDx2iXHQwpGUlPImn+J2Tsiw82WnGvOYVqF5qUJEZWEBLlA1tFj/FIVgthQiyvGX4s9qkMHi3nfhDbNd/8aITe1TbkLRhj6KsaGia7DoZ02JnEhYprmyHoDJQ0b9tLrJYL6/cPZXiydJgCon4yD+h1lCuAhaCEWG8ovvUHz9As5tVQnafcXvNCS/lpNsgeK8ZjjxPr8NTBLMLrLzUznvFaB/PEPG6Xz+LqnOQJoVUWjYSAtx2swJh0XNwLTJ6Rz8Pfwz7ivsjJlYwO33WP0vYfzuKvJfPxLCF9OAIOmXWIoCsAkUjOmb9OXdLI/TZWCaFHftyYZ/0MKA9TxtMixgsyaiBR6xonh68rG8Wiij2hbgsRuyPgzOAT4q j7p9KKe0 LXIMLP/w4m854EB5B4fDpeDCXHAPcyVMlA/IS0r/j+gCi9DUNh3vfbQ3lT+qiiZuadv5UBvtYcUEjy0oQ98eFpjoqNbizwcnHdLKx0QWU9xt3Ibl7ZQVhra3yCq1Sg1BbuT9DLVZfxlEnkObwIpXJ9ReFNo/zqK0jUqlzHX2rdpHWzxHyIvzYbJxNHBH7rwxNX+1YpP6ybSXwa3V1g6gQ98xEvCMSfw4GQUUm9bjVyF6D6VfD4c1YBcDOfZcSK+OA2TpsjvgcCBphcJr80g5PZzSl16halNojbbzPm7EjEp9m8nNyuDPeJPTXnzWHu9MGSIn0Oe4Po9FxowWGBl4L35mP2ba3/EDSnr3xy+7oZ2gVcFa38jAIfJoBKk+/oa29lXFpJnkkipnTMp/LugBr0SNYDLcOd4vz8TJp X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Wed, May 15, 2024 at 10:18:31PM +0200, Borislav Petkov wrote: > So if I were to design this, I'd do it this way: > > 0. guest gets hw poison injected > > 1. it runs memory_failure() and it kills the processes using the page. > > 2. page is marked poisoned on the host so no other guest gets it. > > That's it. No second accesses whatsoever. At least this is how it works > on baremetal. > > This hw poisoning emulation is just silly and unnecessary. We (QEMU) haven't yet consumed this.. but I think it makes sense to have such emulation, as it's slightly different from a real hwpoison. I think the important bit that's missing in this picture is migration, that the VM can migrate from one host to another, carrying that poisoned PFN. Let's assume we have two hosts: src and dst. Currently VM runs on src host. Before migration, there is a real PFN that is bad, MCE injected. When accesssed by either guest vcpu or host cpu / hypervisor, VM gets killed. This is so far the same to any process that has a bad page. However it's possible a VM got migrated _before_ that bad PFN accessed, in this case the VM is still legal to run, the hypervisor will not migrate that bad PFN data knowing that its data is invalid. What it does is it'll tell dst that "this guest PFN is bad, if guest access it let's crash it". Then what dst host needs is a way to describe "this guest PFN is bad": the easiest way is to describe "this VA of the process is bad", meanwhile there'll be no real page backing that VA anyway, and also no real poisoned pages. We want to poison a VA only. That's why an emulation is needed. Besides that we want to get exactly whatever we'll get for a real hwpoison, e.g. SIGBUS with the address encoded, then KVM work naturally with that just like a real MCE. One other thing we can do is to inject-poison to the VA together with the page backing it, but that'll pollute a PFN on dst host to be a real bad PFN and won't be able to be used by the dst OS anymore, so it's less optimal. Thanks, -- Peter Xu