Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp737488rwb; Sat, 3 Sep 2022 01:33:31 -0700 (PDT) X-Google-Smtp-Source: AA6agR7FBwQhHSxDVQS8amLX7E53p99+geZ6Q74+T+Ssxcpa3JRaJP9jHJV2HPJShgRGHbh1KE2V X-Received: by 2002:a05:6402:5002:b0:444:26fd:d341 with SMTP id p2-20020a056402500200b0044426fdd341mr36751261eda.351.1662194011173; Sat, 03 Sep 2022 01:33:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662194011; cv=none; d=google.com; s=arc-20160816; b=oJ/mT2lxMjqQ7CSevk0f6+gDirJOaVP3g816AswQKEvxWqHidp/+NJL0AaboQr/Oyx zg9ym7z+XCPTuwgXqN9GQD4oi/p5ugBcK0oU3RJnNYEDrQ2QIKRkpfDcfYmPIMUvk3IH /DE/qOpLqzB2EelGJjegCNedR9kY7gKDAihJjnaxZaCyi8bIv0XGVNQ8L4ttiw2j6ZZD p03Xn+5l7ezgyU9SD1pRDtf5C2EkZZGQ9MwLoaVU/CTvKK0Z3U0TexKw5QDlLooa1NQo 34gX+YIszJ1t1c/rBvEjpBjrCIsvsaonIX4QqZhUsNpJ/+kSgIMHZmQ5FQAILi2JHpkD c45w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=dHXOkzxgjsBtZM539cRCQ2oOl4G/USWxuxSAXY3DyOs=; b=XmgO6aKNTeVk11XLd17/Y8vf0b1mTsM3vogYqp3PnUQPALlOcyxuSS6cMz9XeH7x7c 6CG9TGBWxD9CIoBrpjldmLaWoeXmMEGpSPeIfw9Z0+5v0S4NttkEd0X3dLq2JUmXf54r MSA8SYkruDgL54TnBnZj9nkUrTdp9xD9tVuUSFaGCv6pwzIlWT/L1XKJ/ovopMgOb6Du cD8BRQAxHlgaG1eirtp3iuHh5eofpNF61mU109mZ97kJ8j9WP6BDrlrclErWyA8BntXz dVYQi/weIfiWgBTSbYPUkXPqmrLRG5XEfUNuWh+IBLyjovczGpWtxPj/rfRM3Memn/Am 6J6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Gs6Qlvxs; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y17-20020a170906471100b0073ddd228877si3142510ejq.156.2022.09.03.01.32.54; Sat, 03 Sep 2022 01:33:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=Gs6Qlvxs; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231834AbiICIbY (ORCPT + 99 others); Sat, 3 Sep 2022 04:31:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229515AbiICIbX (ORCPT ); Sat, 3 Sep 2022 04:31:23 -0400 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7BBE101DD; Sat, 3 Sep 2022 01:31:19 -0700 (PDT) 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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