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 E6BD8C25B79 for ; Wed, 15 May 2024 17:33:48 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E8B886B03AE; Wed, 15 May 2024 13:33:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E39B66B03AF; Wed, 15 May 2024 13:33:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CD9DD6B03B0; Wed, 15 May 2024 13:33:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id B01046B03AE for ; Wed, 15 May 2024 13:33:47 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 5B2FE41579 for ; Wed, 15 May 2024 17:33:47 +0000 (UTC) X-FDA: 82121327694.09.82E4730 Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by imf24.hostedemail.com (Postfix) with ESMTP id 64D7C18000F for ; Wed, 15 May 2024 17:33:45 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0Pb4GErp; spf=pass (imf24.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=axelrasmussen@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1715794425; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=REXKNTAxo862A8ReBddrMUjz3K+lbyLjZMQEflUAct8=; b=w0CRzELeaPzGo8zTH6Id1fFtv1sDrTb/BzpWs/SElncNqgHJNqpcWrvpKgPT87mrPK/GAH yfAMY/1GN5DxUH3+dzA5yBiurO9ItLWun9uAWior/WX75Koqv812nLP8fs0CbQhc+GRYf6 ZI2kXVl9D+3W2IRmfmAV38A76F+nRGQ= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=google.com header.s=20230601 header.b=0Pb4GErp; spf=pass (imf24.hostedemail.com: domain of axelrasmussen@google.com designates 209.85.221.45 as permitted sender) smtp.mailfrom=axelrasmussen@google.com; dmarc=pass (policy=reject) header.from=google.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1715794425; a=rsa-sha256; cv=none; b=FgLakkVVtrts9L/Kz3+sa+8UHoSdD+i4his4+ILCu2O8uqKBBaYulO1JUJv/u3Tvl7IyWZ n1deMTBC0B3Xi1+AoOAnm71osfdVnRPZ551UqQU9yiXnSRPzi2EM17zuCsPcYsxp24M+3c vIURsRnyfk0uuTQHRcfgPrZdSVpAT1s= Received: by mail-wr1-f45.google.com with SMTP id ffacd0b85a97d-34d8f6cfe5bso5561740f8f.3 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=kvack.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=0Pb4GErpwTn9OCiSYmGlGpvamtE/kXrpp6BCQPJ5jKXZ3K/jUKfisbEtDY7k01o7fY OUGUtgnbjXhVqem3jhWYnn1se0Xtrwxg6sbHOGvfsueqAk6BJuXT1CkQ+Ejbr/BJpSqt wS8UBMTRQjI7s4Tr5mVWhdKA2gYGplCJe/4gS69pPgSG2JctAGXdmr79VWlHZUStCMgb ma2IsWwv1dHYkm1DkwV19e7gEQM34VnXW0ZOc8MxOGlWWvYCItGq7A1CdVua2ApK8kfs G0WmSzrk7aUDCZ2KwhQ6sQwtehtzrrZhKpW83SQywasiUHOBrIT2PABplGxACYAGbEHA 2xqA== 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=WQHrz4I9Rd89Z0hFqSTo5fKy0U8ATXJfkH0asudgooSLG9c/GvhzpK89zYmNVgjT5F ewOWdd0TTdveK2YQCAOLCeNKeVwrg/ukL/ZQnUi+1SS0/qsouadq4HRTBwX6TvUGCxoX xl+C81jFzN0CvrwyrJoO6MVC7spSVKSZ1NVaqcSl+paUn6UZgtnRkpFcsnPKDfb3oQPr kleMi5O3zrocHrLLD0dNNMEByLgBGQqF5ju2BE9Ff98yA3cR0LlJEATJA6jotyTAdUhE ma+74w+WZgqTSgWtRrbj0bXefb5umoRlfqZp6+WzXX2ZcrJRk180GF8e4biybv9kCrhQ 70Mw== X-Forwarded-Encrypted: i=1; AJvYcCX3Xl/H7d8b48RmMjJpvrDPMQyCUCdqdmMD8kjKdf0aY7Sy0jkWWrg3q/9C7GSIlg1oaq0APskMIy99yyQJhmUhbMw= X-Gm-Message-State: AOJu0YwU9E3MkWhzXkp4PxoeBzV5YuaGuQwfXJMyzIRVxUdEuMy0DPVN ZUa53UkU+J0NNvGNB+KjvbEUUpk8ViTTrdldhJeUR/H3LHycs/t5kxJVf29/T8OAWCx9mk+p+Hj dgi19YGdqSNcIlc97+MxYB0QNS7IZDq9yp6mu X-Google-Smtp-Source: AGHT+IECmpnR3hqErRAHKi5zZVxQqX+AzRVW0B5FrzgG6JtiQjlGQI3473zUOeMvDrH067XEBa75l4kB51sO6OrPOMs= 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) 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 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 64D7C18000F X-Stat-Signature: njjum3ncao9s4fmahjds4cyjin5zn6am X-Rspam-User: X-HE-Tag: 1715794425-548170 X-HE-Meta: U2FsdGVkX19M0khADnTcKGDxCajmNti2/YsptPcYNj54inyNSyR8s50drF+Mxy5nmE5EAlUvDkqyNFgW/OTRGc3WRK+9Oqs5lRa4x6zlCdS/nbqRN6CJHyfA8Nc0J/2F5AL583YoIysEtjfceaaxzQwGJ8mmurSwR9fbUcU/U2DmUdI+g4X+7FQDyuXZ4Wq1XgbBvRBqdog8MRRNeqCzkcbAOszJC82Jc83q7yXs5MVQKOUKkoyLcs9aGwWMcYB87Wp+vSJyUT2A+y5QCR8bamDIRsB+ncAcZ0tndT0OxdVp+NYpMQzQHfKhHL/AfEKYsZep1bC3eK6GAIsmPnnyXuuP+HwYMJG7RshfYB2lJPE1FRfvf1J6dmlYN1Su7+jocVPXz2sm2WDqSbrO+sq4qUYLmDYGfhhQrJbNSkGMPiSq35HNwhWodaP9TxFPYqzkIZfPIZNkq5T/YnSw0eJEE4AjoFQsDTxPqacov0S37Bxmffyf0P/5lQaiCvyLgrX3aVjG9W4+pM2jIrg7NvwylBVg/wNHtNPDX52tel+KwO1rHN4X2p2r41TKt08cbFqmUI2M/ptoHnVyCfyHcfFJ6VRmUdq3Vt3jdjMaU0XD6btTiZFNvguCaWlC827ctO6VAg6XJcVh0qoQ5SlG9IvEUjsr+t8o2qgD6reGl/QcBiiYyJ+RMppDlupIfOchl+saf2nj754XtqQ+814wDt6Ka2lp6PkcplBMjMyTIW1mvMrpOCxFgU7sZg6YDCW7vI8w2U6Y6mUFcyuGxw/yhG2LV9JGMGNW+zOQ1tBTskWEvd4oj7Ys+Rk+3X7dE59czLP8hx3zZ5k/zktXhracrN4YuTkiAq7aswwIZ4bb7sAUuYv7UlQ6HL3FpKXSJsDVyvQF8ujQXN056+BNQV7RvfWbuw45J2d1e2EHIMBCkcgsSSMJOPD8ykLGoR4cM3Eykt9YEZ3GrrMY3/CC9Sk51oY 1sF366r/ e2qjbBOyd+xakSnOLBlpxPHKxYyz5e6oc7HazGbmWHL4+GDTWFhEoudhti04rCWNsCw4IthATxR4zvz/p/J2jCjUQLo5K4LAfrrsOZ0U2HxXZFdRnMKwQEBPnav1CMCO7FK4ObEn3SmMHYDKe12mx+yjed3ll1xNfj1v6/5dJtgO1w0HgULdovDQ2PYSKKT5fmkztWETDzeCIORpuL6GU1+3CKp2N09VzLc0d 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 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