From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AEFA27D72 for ; Sat, 3 Sep 2022 04:25:36 +0000 (UTC) Received: from nazgul.tnic (unknown [84.201.196.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id C01E61EC068C; Sat, 3 Sep 2022 06:25:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1662179130; 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:in-reply-to:in-reply-to: references:references; bh=cILi3ulN4h0esV4R0edMz4d5K0tcHaTNQdqgVhyueKM=; b=WXud4SwwHkgdUyiAqC/b9msDoRNUkhsyOUo3N56q5FJ98v5KT631TCoPJkTr3eLY5eh4Up FUv42ZFn1PLxV42bfm+scUQFbWFC0VhZuEvVKUTyBJq/lMlLWJTIMlmJvACBkVLnpMF5W2 RV2UNgUzUubifiPlvLexG1fAzluNPBQ= Date: Sat, 3 Sep 2022 06:25:36 +0200 From: Borislav Petkov To: "Kalra, Ashish" Cc: "x86@kernel.org" , "linux-kernel@vger.kernel.org" , "kvm@vger.kernel.org" , "linux-coco@lists.linux.dev" , "linux-mm@kvack.org" , "linux-crypto@vger.kernel.org" , "tglx@linutronix.de" , "mingo@redhat.com" , "jroedel@suse.de" , "Lendacky, Thomas" , "hpa@zytor.com" , "ardb@kernel.org" , "pbonzini@redhat.com" , "seanjc@google.com" , "vkuznets@redhat.com" , "jmattson@google.com" , "luto@kernel.org" , "dave.hansen@linux.intel.com" , "slp@redhat.com" , "pgonda@google.com" , "peterz@infradead.org" , "srinivas.pandruvada@linux.intel.com" , "rientjes@google.com" , "dovmurik@linux.ibm.com" , "tobin@ibm.com" , "Roth, Michael" , "vbabka@suse.cz" , "kirill@shutemov.name" , "ak@linux.intel.com" , "tony.luck@intel.com" , "marcorr@google.com" , "sathyanarayanan.kuppuswamy@linux.intel.com" , "alpergun@google.com" , "dgilbert@redhat.com" , "jarkko@kernel.org" Subject: Re: [PATCH Part2 v6 09/49] x86/fault: Add support to handle the RMP fault for user address Message-ID: References: <0ecb0a4781be933fcadeb56a85070818ef3566e7.1655761627.git.ashish.kalra@amd.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Fri, Sep 02, 2022 at 03:33:20PM +0000, Kalra, Ashish wrote: > Yes we want to map the faulting address to a RMP entry, but hugepage > entries in RMP table are basically subpage 4K entries. So it is a 4K > entry when the page is a 2M one and also a 4K entry when the page is a > 1G one. Wait, what?! APM v2 section "15.36.11 Large Page Management" and PSMASH are then for what exactly? > That's why the computation to get a 4K page index within a 2M/1G > hugepage mapping is required. What if a guest RMP-faults on a 2M page and there's a corresponding 2M RMP entry? What do you need the 4K entry then for? Hell, __snp_lookup_rmpentry() even tries to return the proper page level... /me looks in disbelief in your direction... Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette