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 041CCC6FA82 for ; Sat, 3 Sep 2022 08:31:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F0CD180157; Sat, 3 Sep 2022 04:31:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EBC7C80120; Sat, 3 Sep 2022 04:31:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D83F980157; Sat, 3 Sep 2022 04:31:29 -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 C763480120 for ; Sat, 3 Sep 2022 04:31:29 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 949DC4020D for ; Sat, 3 Sep 2022 08:31:29 +0000 (UTC) X-FDA: 79870105098.03.E088C80 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf07.hostedemail.com (Postfix) with ESMTP id 479A24000D for ; Sat, 3 Sep 2022 08:31:23 +0000 (UTC) Received: from [127.0.0.1] (dynamic-002-247-242-004.2.247.pool.telefonica.de [2.247.242.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 09E311EC06EE; Sat, 3 Sep 2022 10:31:14 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1662193874; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dHXOkzxgjsBtZM539cRCQ2oOl4G/USWxuxSAXY3DyOs=; b=Gs6Qlvxs8gNpEUHeMBASMK9yQo6Y7FspgcI4jU/TDL4PyDkxNsQfAH1Paj6VGlvA4fTxXc rP1bxXy5M8rQhgmB6LUcaejLkEo6203LQUbYX892e1hz0XVqmaDIgGDePeuwjxC+1N/d/j TivrvEgG+eKbx+fbHeDorEmyY6hdGcU= Date: Sat, 03 Sep 2022 08:31:09 +0000 From: Boris Petkov To: "Kalra, Ashish" CC: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "rientjes@google.com" , "linux-mm@kvack.org" , "linux-coco@lists.linux.dev" , "tglx@linutronix.de" , "slp@redhat.com" , "peterz@infradead.org" , "linux-crypto@vger.kernel.org" , "mingo@redhat.com" , "hpa@zytor.com" , "ak@linux.intel.com" , "Lendacky, Thomas" , "alpergun@google.com" , "jroedel@suse.de" , "dave.hansen@linux.intel.com" , "seanjc@google.com" , "pgonda@google.com" , "pbonzini@redhat.com" , "srinivas.pandruvada@linux.intel.com" , "ardb@kernel.org" , "dovmurik@linux.ibm.com" , "tobin@ibm.com" , "Roth, Michael" , "jmattson@google.com" , "kirill@shutemov.name" , "vkuznets@redhat.com" , "tony.luck@intel.com" , "vbabka@suse.cz" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "luto@kernel.org" , "dgilbert@redhat.com" , "marcorr@google.com" , "jarkko@kernel.org" Subject: =?US-ASCII?Q?RE=3A_=5BPATCH_Part2_v6_09/49=5D_x86/fault=3A_Add_sup?= =?US-ASCII?Q?port_to_handle_the_RMP_fault_for_user_address?= In-Reply-To: References: <0ecb0a4781be933fcadeb56a85070818ef3566e7.1655761627.git.ashish.kalra@amd.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1662193887; 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=dHXOkzxgjsBtZM539cRCQ2oOl4G/USWxuxSAXY3DyOs=; b=lsTtWrZ+H2F2OlC+RxgZM5uEphQKunFCQKqEThhIHWyXonBsWltVprCoZ1frmHUwJN0ol8 u1NWIrqDrbyHZ4TJYcP5A438pd6UitSUCmN+J9+6kokg7T+9TdI1ixuAmqWoyByjYKr7+a LoVHBbFh7YQKeBkKEXEWWGvFIFcBuDw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=Gs6Qlvxs; spf=temperror (imf07.hostedemail.com: error in processing during lookup of bp@alien8.de: DNS error) smtp.mailfrom=bp@alien8.de; dmarc=temperror reason="server fail" header.from=alien8.de (policy=temperror) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1662193887; a=rsa-sha256; cv=none; b=LYRNaS5pbK6tADGA1DY+4EX+UDq21X1gtVh1pAV87tRkZVW1LygkEWNyRzljrTrPwpE7pn 3wOJW8zR0hJnQpI8hfXK9eZFeMBmuKy6ZXuCjSTHixexStZnQmuswosGgmde8HKK6+Gfmu kK6iOQrD9I7KM06Wuw1s5FNO9IL0K8c= X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=Gs6Qlvxs; spf=temperror (imf07.hostedemail.com: error in processing during lookup of bp@alien8.de: DNS error) smtp.mailfrom=bp@alien8.de; dmarc=temperror reason="server fail" header.from=alien8.de (policy=temperror) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 479A24000D X-Stat-Signature: 4gj5px1z59tjdbwtez5okzz1ph4bk8ra X-HE-Tag: 1662193883-313033 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: On September 3, 2022 6:57:51 AM UTC, "Kalra, Ashish" wrote: >[AMD Official Use Only - General] > >So essentially we want to map the faulting address to a RMP entry, consid= ering the fact that a 2M host hugepage can be mapped as=20 >4K RMP table entries and 1G host hugepage can be mapped as 2M RMP table e= ntries=2E So something's seriously confusing or missing here because if you fault on= a 2M host page and the underlying RMP entries are 4K then you can use pte_= index()=2E If the host page is 1G and the underlying RMP entries are 2M, pmd_index() = should work here too=2E But this piecemeal back'n'forth doesn't seem to resolve this so I'd like t= o ask you pls to sit down, take your time and give a detailed example of th= e two possible cases and what the difference is between pte_/pmd_index and = your way=2E Feel free to add actual debug output and paste it here=2E Thanks=2E --=20 Sent from a small device: formatting sux and brevity is inevitable=2E