Received: by 2002:ab2:7a09:0:b0:1f8:46dc:890e with SMTP id k9csp170260lqo; Wed, 15 May 2024 10:38:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVxR88CP3EwNsRH4IGQNU9rDu2e+BUA1MIWGXgscrdc4zY1cGyfafKjFnTh/sm64y33ygzieHz2lV36w7/6ZxFoTnLvSC32G3lV76x12g== X-Google-Smtp-Source: AGHT+IHdDALxXRns8l1ObUCywr8TYvp3GUI6PZwBnj753ohYne0qmnpQDCysBF0F8AW4OzpocFQu X-Received: by 2002:a05:6a00:270f:b0:6f6:7b6c:51f6 with SMTP id d2e1a72fcca58-6f67b6c5295mr978395b3a.24.1715794730902; Wed, 15 May 2024 10:38:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715794730; cv=pass; d=google.com; s=arc-20160816; b=nyHYQ4QIn+oqTMlSp+am6rmTD7yQrI2DbeYE3gwUu4nwDYlDHBLE/tZ+Lk23aiDGYk B4GxiAJmRuNJSNekDpS2aWm+YVLuTA8st46SEEQGYRoYTY1qZnXtGVvXzD6x/IjTf0q+ Vce2IfgvEQDXBiRvsEVgwXk1m5QU016W9hfzHNb+QJHmmLEQA9kJZLgHRAIhggit9oBT 5eVVHi6X6VXJMSjc8TYDMsx7VeaGIa++0pZ52sQhGPI5Ses1kl0D7+j3wozAx5SGDPoO bua/3RhqT1kLdkMbaqvqgohlchvz2ePNhBkDaZpMPbxVCJFhEUCmUtToMITFO9rOHieY xxGA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=REXKNTAxo862A8ReBddrMUjz3K+lbyLjZMQEflUAct8=; fh=6BtQrFiqs1Xo+UxRXIS+YhcSBeGa17x4FDEKnQgb/gg=; b=VIQW+EpaILxl3lvQneLB6RYlrYTPbo265arom8yug+LOetcva/0dcgcs64dVDLNf34 w4dVvPf04On3lhOg9lakEBaN/eVICRPEUmsSolgWgMtjPtCsfGjiy3Id772qunMCPa8R ASriqY1fvQWd8765PnXVrkgBK28l/RoowlfOdJEOrpLLtz9EZ5G7U8Ixt2gkGdGYwdOb bkFK+utJeotZd1fNVHCf4bAhFn5WciCUvuDlo0uDY9U/+EkbSI1m69A6vMaIBblaNoR1 xD8N0vXuOL4MiJEV8aIStDYEo9KPekNTiCUKyGYeWDip9ITbu0DzKbLVms4tzt3F2Ft0 1OoA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=s9HJpiRk; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2a72708si14708910b3a.67.2024.05.15.10.38.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 May 2024 10:38:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=s9HJpiRk; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-180217-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180217-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id EBD14B24ECB for ; Wed, 15 May 2024 17:33:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D5FB0481B1; Wed, 15 May 2024 17:33:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="s9HJpiRk" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 91D3B28680 for ; Wed, 15 May 2024 17:33:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715794427; cv=none; b=ZPB7DJ0RlTquKu3yIRbUmBfXM/BVjzmwaigRi/cZNMHE7j3Lk/aPTkcj+G7UL2mZE0VFxS+1Oud3++Gk34lTBWqcALQU3xAtUMOmFBl5i3rYb/0rihgE01KTHhY93E2raCtPK+rK0iHrIzj6a3aToVn/W0+KI7TVAlqllQQQ+s8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715794427; c=relaxed/simple; bh=BczV/FF4eIzKWVrSkkC8DYFt1QqsMU4CdnShIk6/U3M=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bCcdxwhw9uhcApmNnQRj5NsZcJtJD0ffRij+IeGX24bMAJfiFsEkHew8SErkZoUwDXGck2byiczatIYlo+VvV0zTt3/7dD/tUYXg7Io5cQvwif7z5WwMuCXGdu2UVJRL/GfayhrZUOfPP1BfnrvpQfdnbWV1NAAPbpCz5MmpbbA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=s9HJpiRk; arc=none smtp.client-ip=209.85.221.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-wr1-f52.google.com with SMTP id ffacd0b85a97d-34db6a29998so5551281f8f.0 for ; Wed, 15 May 2024 10:33:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1715794424; x=1716399224; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=REXKNTAxo862A8ReBddrMUjz3K+lbyLjZMQEflUAct8=; b=s9HJpiRkvmLjvVF7EK6rqcWhZkYTfdp2i6sAc9gf8G1joqcuqe2fWvimC+lsmN3Iyd F/cIbxok4h0TDxs92Inlt/2O7VG4Cj+87c3kIDhEPkVtlaA75A2wV+zbyZ28dHNYFFfW /jeTm02s5ZuxCBjiLa1zQGr0Bw/smD0d1UnSLujEVLuVuJqK5b+69a0I9Tf81n3wVNdC qhhieCMWqWhp8PCF9wYIQmHJnuq47Gk7fK0NsKMua0j/90CLBIpTpGhG++B7aKI/4AzA vOydfcGb1+1O9u6VAR213zUoSTE2hjdn0Yg8JN7KyVjWX98U2tJ6uee3uH3TrK0r3ffv ChDA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715794424; x=1716399224; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=REXKNTAxo862A8ReBddrMUjz3K+lbyLjZMQEflUAct8=; b=vHcRvFv0BLER0gWQrsygUUvVcagI5K4a94DIphR8C6EMcCSdthu3YS1OyZnepHKESx w9qUQYJo/NgXTj2DDfw927ZAVCN0qInwDZOKNzUsut+fqt1l/SiJfE4uOdMl8yruOau0 z+DCJtn66ddTsx/88gmW0HCviOT5wbIEpBbUSiW2TRyK2OAtIHGaCYetkGt3IMLz+5Ld WnhIlc9WJKEf3PWHCDqrWuP9rs5WPTQE0qsc9gW3SYjPVxjQfc+Zvm2U497VsNYq5CCF 1ez9LdnNCKusivdEc5NFmoQOWFUutTVfP5Q3A4wki0zKvrAqIov+NAn/TaRFLrHXBgqk wSIQ== X-Forwarded-Encrypted: i=1; AJvYcCWvtzdhLFIVg7ui4WCiqzHLHvVSJSNXlQulNfrTLwJW0mgoPxRu13SkN29IwijYPTYn9tkVAbqFwogDE4SdBJQT4Ke8C8LSrKu2ILKx X-Gm-Message-State: AOJu0YzqfDEX42nR3RVNA6disxGeugOIcg0sbdauJ+nrvx8/lniendPN lky4TIN/3cc4E3J6WDvuYgvShuqNiQ2a/6ZzMAQW1kcI/iZEdSbP0uuxyZRR2sqK7gqBfO22AHr Qj94mQjdfX8zhZSjSHArMzujjLZmoU3dFgZyb X-Received: by 2002:a5d:5351:0:b0:343:e02f:1a46 with SMTP id ffacd0b85a97d-3504a62fb12mr13056195f8f.2.1715794423681; Wed, 15 May 2024 10:33:43 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240510182926.763131-1-axelrasmussen@google.com> <20240510182926.763131-2-axelrasmussen@google.com> <20240515104142.GBZkSRZsa3cxJ3DKVy@fat_crate.local> In-Reply-To: From: Axel Rasmussen Date: Wed, 15 May 2024 10:33:03 -0700 Message-ID: Subject: Re: [PATCH v2 1/1] arch/fault: don't print logs for pte marker poison errors To: Oscar Salvador Cc: Borislav Petkov , 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 Xu , 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 15, 2024 at 3:54=E2=80=AFAM Oscar Salvador = wrote: > > On Wed, May 15, 2024 at 12:41:42PM +0200, Borislav Petkov wrote: > > On Fri, May 10, 2024 at 11:29:26AM -0700, Axel Rasmussen wrote: > > > @@ -3938,7 +3938,7 @@ static vm_fault_t handle_pte_marker(struct vm_f= ault *vmf) > > > > > > /* Higher priority than uffd-wp when data corrupted */ > > > if (marker & PTE_MARKER_POISONED) > > > - return VM_FAULT_HWPOISON; > > > + return VM_FAULT_HWPOISON | VM_FAULT_HWPOISON_SILENT; > > > > If you know here that this poisoning should be silent, why do you have > > to make it all complicated and propagate it into arch code, waste > > a separate VM_FAULT flag just for that instead of simply returning here > > a VM_FAULT_COMPLETED or some other innocuous value which would stop > > processing the fault? > > AFAIK, He only wants it to be silent wrt. the arch fault handler not scre= aming, > but he still wants to be able to trigger force_sig_mceerr(). Right, the goal is to still have the process get a SIGBUS, but to avoid the "MCE error" log message. The basic issue is, unprivileged users can set these markers up, and thereby completely spam up the log. Also since this is a process-specific thing, and it's not a real hardware poison event, it's unclear system admins care at all at a global level (this is why we didn't want to switch to just printk_ratelimited for example). Better to let the process handle the SIGBUS however it likes for its use case (logging a message elsewhere, etc.). That said, one thing I'm not sure about is whether or not VM_FAULT_SIGBUS is a viable alternative (returned for a new PTE marker type specific to simulated poison). The goal of the simulated poison feature is to "closely simulate" a real hardware poison event. If you live migrate a VM from a host with real poisoned memory, to a new host: you'd want to keep the same behavior if the guest accessed those addresses again, so as not to confuse the guest about why it suddenly became "un-poisoned". At a basic level I think VM_FAULT_SIGBUS gives us what we want (send SIGBUS to the process, don't log about MCEs), but I'm not confident I know all the differences vs. VM_FAULT_HWPOISON on all the arches. > > > -- > Oscar Salvador > SUSE Labs