Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp1040755lqo; Thu, 9 May 2024 03:02:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWHjQdfBgxpfpv7YDOHmT/9BnXp3XXrRyFrVp4keqQxzGEZolwspZoF+lZuRBAHXG3HA/dk8CpmHEFpnNSBY0XP6EBejXPX5WLDw9hqXg== X-Google-Smtp-Source: AGHT+IHl0kfyz1NBtsWe2aA5KImK5fxe6DyIE8CTjJqNttGTn7g8Xkcitqt8alSHKXm4W8PRmFOj X-Received: by 2002:a17:90b:1046:b0:2a7:600e:ce0 with SMTP id 98e67ed59e1d1-2b616bfdb97mr4994128a91.42.1715248964774; Thu, 09 May 2024 03:02:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715248964; cv=pass; d=google.com; s=arc-20160816; b=Do8fMooxslAvEAqVlM7B1JreCzrukB+3FZsoqVhZJ9hCAZ4WK+M9FWz+6WwxCbkP6T Kuk+ez2TPdMg1iEFOcZ86q6Q/EIw6+kWK3DIM2QH+lBrnXjheo9vKO5GfQfCETprwIZK 8FXoaF90PUUOCFAqRNWn+EREtqDueCOyD3kcedaxjfd85h7vFJOLPA/vG/2cXzU3Mpvr ZcyfqORFSHPX1YrWODlMUiNBfPqQmzge51l/xKq4LQ8C5lzkhv6tXXoqtvYibO7BosPb +V8rUDjPj3uwgs8tpMVxECBhyhuQXXtRSotntBy55CkEJprYJ3+WSFXUheBKY7ZurEPm XlfA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :dkim-signature:dkim-signature; bh=fH9mcFMskWdh4UuFUQbCoC6swB7vTaoxR3AzCi/uWRg=; fh=8CHg3akC/4aaCziBK85ouzSIZMnM2be6YSmVzSimnMQ=; b=S0XrCZ9m28NA2pfvX7Ug3JiIe22y/mQ83f1uu9SzEy8ZH24u1dY4LF5o9CdgM4N1Jl f51vswVANh3joV5NTQ7IccjpICRTYJ4PnzDjtjyjcoZD9DNnY09mDVHwbKuIqu8R+BVi 8dSc6fengAlZVFpzYfCyzsu0vbbyn4p+HAvqqKWqBeS8Fs5AAtjbszO3DkWJHHML9Cmf 9TnbPsdxvKvt9qIy4SlCa0AqH1gburmRkfTfb302B0/ErxU/nH+oBvKN6X4Orx/6hh7u im6TDIiuekDo9KT+n2VuV1/CcTkprcssgxL8x7oxrSc9ZxefmnQtTVqQ6UDcFmol9UMk BWLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="yrG/oC93"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kBBKn7Nm; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="yrG/oC93"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kBBKn7Nm; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-174389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b671589d0fsi1172275a91.152.2024.05.09.03.02.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 03:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-174389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="yrG/oC93"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kBBKn7Nm; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="yrG/oC93"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=kBBKn7Nm; arc=pass (i=1 spf=pass spfdomain=suse.de dkim=pass dkdomain=suse.de dkim=pass dkdomain=suse.de dmarc=pass fromdomain=suse.de); spf=pass (google.com: domain of linux-kernel+bounces-174389-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-174389-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id D848C282C37 for ; Thu, 9 May 2024 10:02:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2A82614B08F; Thu, 9 May 2024 10:02:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="yrG/oC93"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="kBBKn7Nm"; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b="yrG/oC93"; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b="kBBKn7Nm" Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) (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 C803514B07E for ; Thu, 9 May 2024 10:02:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=195.135.223.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248934; cv=none; b=lwnsmH1Z0OoB6sn2ZWYkkPMBZ4JiqdZsN5Fc4AsqfEWSMm9f9icU1er5hEXAMb7uwbcMx0xUuX+1CozRmNsRRPAvn76/pV8hcCFTJl/Ds/SK/ij/KNplpNHSvGl0X0sD9DePd0P1qxNooOWnrCJJBSJRW8zOqIvIONF55Q0/1MY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715248934; c=relaxed/simple; bh=EGxnPS0yhiH1vdHZvJ5vJ0VsWmcUYd/h7Lji8/SatuA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MamfGnjZ0B1pe6PonpITjF20jLPviXSDl2Tfr3RcH9KKZPoZcDK8NeswX6QEFPOlhRFsZFwgnrozzYQPFzedkEbG3/pfsLWCRA96q97jqRNWFUH6dulLZ9ri7LxqSXRxsAYwG1qQcnBDjyRyUWClIb+pe6LFlnFWwuKJNHqQNv8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de; spf=pass smtp.mailfrom=suse.de; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=yrG/oC93; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=kBBKn7Nm; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.b=yrG/oC93; dkim=permerror (0-bit key) header.d=suse.de header.i=@suse.de header.b=kBBKn7Nm; arc=none smtp.client-ip=195.135.223.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=suse.de Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [10.150.64.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id DC2345FC50; Thu, 9 May 2024 10:02:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715248930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fH9mcFMskWdh4UuFUQbCoC6swB7vTaoxR3AzCi/uWRg=; b=yrG/oC93h5JV8qQmse+DMDxdJ3XjcpoZ8p9RWPbh8qeIgBEK4uSnqJXtVl+5s5vB3Ir2oP gbL318bcbu5brHByri1fMi3aKj6H6X4TUb1QAgT0iEco9HOk/w8ffwlxdL832dk5VmZDXw BZlAyoxMZz7UEC75NwUYOkgb4qorXMU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715248930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fH9mcFMskWdh4UuFUQbCoC6swB7vTaoxR3AzCi/uWRg=; b=kBBKn7Nmv3J/YzvrHjy1h4S3Y+YMOCrtdI5mhdpzd8xfufJcrmzRkM0Qyvz9ZaUPv/7p9f 8EiDPJlRTErRyMCA== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1715248930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fH9mcFMskWdh4UuFUQbCoC6swB7vTaoxR3AzCi/uWRg=; b=yrG/oC93h5JV8qQmse+DMDxdJ3XjcpoZ8p9RWPbh8qeIgBEK4uSnqJXtVl+5s5vB3Ir2oP gbL318bcbu5brHByri1fMi3aKj6H6X4TUb1QAgT0iEco9HOk/w8ffwlxdL832dk5VmZDXw BZlAyoxMZz7UEC75NwUYOkgb4qorXMU= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1715248930; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fH9mcFMskWdh4UuFUQbCoC6swB7vTaoxR3AzCi/uWRg=; b=kBBKn7Nmv3J/YzvrHjy1h4S3Y+YMOCrtdI5mhdpzd8xfufJcrmzRkM0Qyvz9ZaUPv/7p9f 8EiDPJlRTErRyMCA== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 3C31B13941; Thu, 9 May 2024 10:02:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id WHeLCSKfPGZbOAAAD6G6ig (envelope-from ); Thu, 09 May 2024 10:02:10 +0000 From: Oscar Salvador To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song , Peter Xu , Axel Rasmussen , Liu Shixin , Oscar Salvador Subject: [PATCH 2/2] mm/hugetlb: Add missing VM_FAULT_SET_HINDEX in hugetlb_wp Date: Thu, 9 May 2024 12:01:48 +0200 Message-ID: <20240509100148.22384-3-osalvador@suse.de> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240509100148.22384-1-osalvador@suse.de> References: <20240509100148.22384-1-osalvador@suse.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Level: X-Spamd-Result: default: False [-2.44 / 50.00]; BAYES_HAM(-2.64)[98.42%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_MISSING_CHARSET(0.50)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_SEVEN(0.00)[8]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; ARC_NA(0.00)[]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:helo,imap1.dmz-prg2.suse.org:rdns,suse.de:email]; RCVD_TLS_ALL(0.00)[] X-Spam-Score: -2.44 X-Spam-Flag: NO commit 1cb9dc4b475c ("mm: hwpoison: support recovery from HugePage copy-on-write faults") added support to use the mc variants when coping hugetlb pages on CoW faults. Add the missing VM_FAULT_SET_HINDEX, so the right si_addr_lsb will be passed to userspace to report the extension of the faulty area. Signed-off-by: Oscar Salvador --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 262456daf327..6be78e7d4f6e 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -6067,7 +6067,7 @@ static vm_fault_t hugetlb_wp(struct folio *pagecache_folio, goto out_release_all; if (copy_user_large_folio(new_folio, old_folio, vmf->real_address, vma)) { - ret = VM_FAULT_HWPOISON_LARGE; + ret = VM_FAULT_HWPOISON_LARGE | VM_FAULT_SET_HINDEX(hstate_index(h)); goto out_release_all; } __folio_mark_uptodate(new_folio); -- 2.44.0