Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1288431lqh; Mon, 6 May 2024 03:09:42 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXzOcrf8MzA8XFMIfCOkF5JEY4Uww00TsfhEfYS9oW6fqcP77hKsFGBdzOSTzSzgpWHA/6WA6Yp6Bt+gNW1v5wDTWYHWM83PUtYkRnK+A== X-Google-Smtp-Source: AGHT+IGyAc5WcE/qUoQadZkpbohLyhRmjNm72G1G9z5gsV3OkZlqdVc4coSbKH6cr/IES60RpJSd X-Received: by 2002:a17:906:5fd5:b0:a59:ccbb:595b with SMTP id k21-20020a1709065fd500b00a59ccbb595bmr2156614ejv.25.1714990181794; Mon, 06 May 2024 03:09:41 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714990181; cv=pass; d=google.com; s=arc-20160816; b=MkK5+GKf7fnAdkTN/j9nSmmuXpMYfiGzZOhQBl6nLk3MncJSJOU9sN0CXJG8BMcH4Z FDm1jFg9z/ArNDWQvMMhzCLQvaqkc3qEYN7/cP5wz18rcU+wkWIXVO6G59Vi2KTAKail 4swHaWRtXSxoJhWcWcpGhJiCD6ATQpkhv0eE6qF2CEEdvFCJkeS4XTEknBF9jhHDx2rr HIoTAIdAJPrxBk9RePsHNu/tYIRmwOIrMa97n548YprjmH8E+SrwWfm1jzD+i+Pc7VwC SOqGwORJoDWspOcLLKYCqsrHgenkufCmIAMTBkQH+zS7/zIodnAQwpvAUevwruQ5idNS WgRg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=yDr1d+Rpi28/rr/NTeMKaEESBQG5/hCp8YbpHq/FNGo=; fh=yOXSm0E/8tOfmRnhk0JfE6MKLQieMwDr2DHng9Fw+Y4=; b=lgh8lgNzpar88s3xNXf8fuis/+Y8FKalw8YfHddSa97IYdewNIGJuaOJVlpepVlUGG yzC41zdEljgt9nzJhhOBnzOabTLz3f5SDFxaQo/MymEdeKzao1BK33xchfwBgVNSbPbD 2q6bDxAqPk6rJ34Ow5Krc8fhtXZXvpsRkkP6KPtIsI6oo93w985yXWcuyioqk/9odJ3A 4RDySuLhJ8oKM+JRjS40oUk17x49jqLY1BUUiFS3i/Hkc4JujrebqxrMmOFAlVQdg3gV CVNNqgBLCn2yrwnpUczP5tCeifOXFjqL4+ttDEyPGsksi72ZjfIhmB7U0FZ6OKbG7Eww +cmw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=fxhWNI7x; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-169644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169644-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id jg28-20020a170907971c00b00a59a8ee2b2esi2673205ejc.565.2024.05.06.03.09.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 03:09:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=fxhWNI7x; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-169644-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169644-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 868BB1F2357F for ; Mon, 6 May 2024 10:09:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED6F614290A; Mon, 6 May 2024 10:09:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="fxhWNI7x" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (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 4002C1428EA for ; Mon, 6 May 2024 10:09:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714990174; cv=none; b=f6D+B/kAxXx7j+7xMbEi9qGr3fU95T7k2fUSfsSaX7IYWRie3ePDlfl7vTNiaOqjY5uZtIdFug0WOXSbP+KlAPGpgbWbbOSrjnE4OHt0avZuFmILYvswcRhgm9aPGdQVlFE4QEFzrpy+k31Yq2GRQaPT/DodAa6+9aQgmc02UjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714990174; c=relaxed/simple; bh=c0xjj+ANGz4MxBBiLBwLKEfespYcrDozzderIyQtxCE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tA5K6lcIk0jgfNDjhSWpYiGQX/t1L8kchUfs3d3SHO7nikOSQWq6Xn/IawSQqfLKkTz8vmjHAT5m+1NwTxvgADTzOti43ZOld+2kwFQ1edPuh3kZ+3uZbgXd3YoqNzhXTGGXvY3TzmFCKUOSDqmUpr+NT7ws5FQdduMmxxSuCTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=fxhWNI7x; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id 8261040E0244; Mon, 6 May 2024 10:09:27 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id y3q0j_RtuwX7; Mon, 6 May 2024 10:09:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1714990164; bh=yDr1d+Rpi28/rr/NTeMKaEESBQG5/hCp8YbpHq/FNGo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=fxhWNI7xGUuq0TG29EfWKa5XsWgrwrDf2hRgnywI43wzMluTYjWUhLK5ZxvxRioSg n7H3ltxQAeorYssA1r1X2pSBy+frVvUUNI1WbivXZTbsHSotS/Coyw1yQBJzPzQ81K PIceAxUp03s4B31aKNKOS1h4sZWFk4O/rr4CXtFetht3Uz1FzNlSaFgOvAY66S7sIf glW3SIh/ArL5JI0cksjKl10wv/tO8Ex5uk5ALqRXdSXxymFykLCo2+cWcY6qkomyDg aSxI/jHkB+R31dXBir8T4sZfAupVHAMk5P6hcZiiDsJurW00ReYO6aFWx0LIdHFGHf pOtp86zOzXxbrn1VUeglMRPAw3zwufJi7nxNmozsO87CzLcgsz7OpugYjUYcWu3HgV acKjH5VcCci/ltJLmIe20OIY3Z4HmHRcW8QbLuDIcYNqvSbbn6U+/z3SCc7yzRecqf UslWq7pgPFWzqVfYbkjxuBqVIkCcOAZZz2ZqB6/1G19g3o/copT54byFAmjy4rr3QX DhVNKV2AjqMoEkWelMJxSuf3o6sLo6BTcCZjDkar05YAcGYgldbdvjirC3NbDrRHU0 olZtmUhC/f89T1ARPEPyCPf8b29nnqeZ/Kya3rAuUkcX2kVPmajVL72haNoSGRVZel xemUn1/hlC8sVdWKVXj2xYC4= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id E38A340E01A1; Mon, 6 May 2024 10:09:09 +0000 (UTC) Date: Mon, 6 May 2024 12:09:05 +0200 From: Borislav Petkov To: Tom Lendacky Cc: linux-kernel@vger.kernel.org, x86@kernel.org, linux-coco@lists.linux.dev, svsm-devel@coconut-svsm.dev, Thomas Gleixner , Ingo Molnar , Dave Hansen , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Dan Williams , Michael Roth , Ashish Kalra Subject: Re: [PATCH v4 05/15] x86/sev: Use kernel provided SVSM Calling Areas Message-ID: <20240506100905.GFZjisQTQwbkv2eKsh@fat_crate.local> References: <07266b47e749267ef9a9ccbc9e8e9df78ed54857.1713974291.git.thomas.lendacky@amd.com> <20240503103407.GSZjS9n-XMMKi5ZOek@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20240503103407.GSZjS9n-XMMKi5ZOek@fat_crate.local> Ok, I think this is very readable and clear what's going on: static __always_inline void issue_svsm_call(struct svsm_call *call, u8 *pending) { register unsigned long rax asm("rax") = call->rax; register unsigned long rcx asm("rcx") = call->rcx; register unsigned long rdx asm("rdx") = call->rdx; register unsigned long r8 asm("r8") = call->r8; register unsigned long r9 asm("r9") = call->r9; call->caa->call_pending = 1; asm volatile("rep; vmmcall\n\t" : "+r" (rax), "+r" (rcx), "+r" (rdx), "+r" (r8), "+r" (r9)); xchg(pending, 1); call->rax_out = rax; call->rcx_out = rcx; call->rdx_out = rdx; call->r8_out = r8; call->r9_out = r9; } and the asm looks ok but the devil's in the detail. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette