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 77C30C19F2B for ; Wed, 3 Aug 2022 20:27:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B47788E0002; Wed, 3 Aug 2022 16:27:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF6908E0001; Wed, 3 Aug 2022 16:27:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9E4D38E0002; Wed, 3 Aug 2022 16:27:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 908DD8E0001 for ; Wed, 3 Aug 2022 16:27:11 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 5377916167E for ; Wed, 3 Aug 2022 20:27:11 +0000 (UTC) X-FDA: 79759415862.16.4DA4C17 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by imf26.hostedemail.com (Postfix) with ESMTP id 69A0A140030 for ; Wed, 3 Aug 2022 20:27:03 +0000 (UTC) Received: from zn.tnic (p57969665.dip0.t-ipconnect.de [87.150.150.101]) (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 34EFF1EC00F8; Wed, 3 Aug 2022 22:26:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1659558417; 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=NGAAgwsFZOFiyuIqVIHwUIdtAY8mEvoIbdgSbGrefj4=; b=saUgyTZ9As3E+I3dXZj9mDddkTvaiqPubF7iHBiDAUHv1uqUQRvBQQaJmioU9Y/eeK0SV+ Fx8ZdZfliRxroJcFhwQbrI/BCmhC1w2JRF2SVcalW/Ebwhe6z9BvgQ/IUOs8cALByhrxpk oAoh7W7eorRu7ffIUUqRappMfT1v+d8= Date: Wed, 3 Aug 2022 22:26:51 +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 06/49] x86/sev: Add helper functions for RMPUPDATE and PSMASH instruction Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=saUgyTZ9; spf=temperror (imf26.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=1659558431; a=rsa-sha256; cv=none; b=x6j6BenC1k6AeinG6p6mcUTqbCCy8XoxGrXSJBznE/T6W0e5ujZjRnXWWnFWGmFHCXRFMk QHexXocQEJQell76ijISjKsKAQxink+Q3DUjBcVk4F8tzSe7K4AFYCWk5iiVuYscT3PtVS 1YF3Nrm7ZGI67haFPEVKtWLBgwQvOpk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1659558431; 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: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NGAAgwsFZOFiyuIqVIHwUIdtAY8mEvoIbdgSbGrefj4=; b=vMEJa11erHel4EhW3GQaczf6dZFxzyxqWyhdd7WcazqSIzoqBRg2jeHWMlfZTY4YOqetr3 Dz+a3ZGYr4TrI9NcnL8/j3O5oYcb/TlhdKvj1dPCt8EpZizySVBLjUz/KP7QWS7qeXlAnJ 7vGJPqXuimTeddGWkHPd9dy6IfrzQWU= X-Rspamd-Server: rspam09 X-Rspam-User: Authentication-Results: imf26.hostedemail.com; dkim=temperror ("DNS error when getting key") header.d=alien8.de header.s=dkim header.b=saUgyTZ9; spf=temperror (imf26.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-Stat-Signature: iuy9hja57q5sowiz6psp3omitw9k9n8q X-Rspamd-Queue-Id: 69A0A140030 X-HE-Tag: 1659558423-368163 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 Mon, Aug 01, 2022 at 10:31:26PM +0000, Kalra, Ashish wrote: > The struct rmpentry is the raw layout of the RMP table entry > while struct rmpupdate is the structure expected by the rmpupdate > instruction for programming the RMP table entries. > > Arguably, we can program a struct rmpupdate internally from a struct > rmpentry. > > But we will still need struct rmpupdate for issuing the rmpupdate > instruction, so it is probably cleaner to keep it this way, as it only > has two main callers - rmp_make_private() and rmp_make_shared(). Ok, but then call it struct rmp_state. The APM says in the RMPUPDATE blurb: "The RCX register provides the effective address of a 16-byte data structure which contains the new RMP state." so the function signature should be: static int rmpupdate(u64 pfn, struct rmp_state *new) and this is basically the description of that. It can't get any more user-friendly than this. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette