Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4931987pxu; Wed, 21 Oct 2020 08:47:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxcSjkZ+98+lUBJ2FIOEyvoiXpNiihbcEj1+9OTInbea4sdQmtS51deFDQEs3HPCvJ4GrUN X-Received: by 2002:a17:906:2894:: with SMTP id o20mr4054227ejd.221.1603295268311; Wed, 21 Oct 2020 08:47:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603295268; cv=none; d=google.com; s=arc-20160816; b=Lrysza4Zn5EAvOnzYRe0gEBpphOeoJbuI2NKgYaafg8bSuzwXtYBzHxgyw3X8I9hr8 9uJhHvOQfKJh9zVxnuNKjVLdZkaOHMIujwgz5L1pnQyk7e4OebYdKxQq6M/1f33ocPgD rKwc5U4GwFG91gWoCRqj+2fqh+FEhqo+o+G43XIRkdYqD0DY0RwE2J4gurdTGtC0thkg OaMXPjV9yrmjvKmakmcI4QPj7VGEvn06PeHRtA1bwENKroet+gskqnHVFdWg4nYCGU2x 9JiucZ5dBNAtLfFaGIeODQaUFPBkFMsgg/aM61/9Cmd1hs0oD0djKSItMoxV06LLcYfa eNMg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=sJ1TVSiJimWUj9ZRsEEXleMw3MgP26IcmouMrVOxFCA=; b=nokyYDjNBW8zPOJB0XVm0J3ojSIB/ujFH03uzDFtmLnfiinqQKwctoKqY1iTotNiqo qrvFzJ/zzlO4tjH+xFTd/KwvXbn4CEzKXaD2M2HfUH1BiKj2Mbxro9TKmS0n4B2RRQka eCVSWzSUq1XzVbVigkNMQugfoftpO65YhtDt4X3PsouhVnrtye7HK5pXNEW3JmxS2YI8 u9cUPgZNHGI79uLYGIwp2FXiENq4sekX0RBZlwhTxGuexiDD4jZ8oAcfTKhKysoBiihB JtRtBUwXDoglgt+282UzjszqiBPTK0VCtvXM1Px0/CEcGXl186uLTs0wpTrRGxUjhxxt 7zfw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k7si1449977ejp.590.2020.10.21.08.47.09; Wed, 21 Oct 2020 08:47:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731691AbgJTPsQ (ORCPT + 99 others); Tue, 20 Oct 2020 11:48:16 -0400 Received: from mx2.suse.de ([195.135.220.15]:48394 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731458AbgJTPsP (ORCPT ); Tue, 20 Oct 2020 11:48:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BF63CACD5; Tue, 20 Oct 2020 15:48:14 +0000 (UTC) Date: Tue, 20 Oct 2020 17:48:12 +0200 From: Joerg Roedel To: Arvind Sankar Cc: Joerg Roedel , x86@kernel.org, Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Kees Cook , Martin Radev , Tom Lendacky , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/5] x86/boot/compressed/64: Check SEV encryption in 64-bit boot-path Message-ID: <20201020154812.GB22179@suse.de> References: <20201020121856.19427-1-joro@8bytes.org> <20201020121856.19427-4-joro@8bytes.org> <20201020141259.GC2996696@rani.riverdale.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201020141259.GC2996696@rani.riverdale.lan> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 10:12:59AM -0400, Arvind Sankar wrote: > On Tue, Oct 20, 2020 at 02:18:54PM +0200, Joerg Roedel wrote: > Why use r10-r12 rather than the caller-save registers? Even for the head > code where you need to perserve the cr3 value you can just return it in > rax? It can surely be optimized, but it makes the code less robust. This function is only called from assembly so the standard x86-64 calling conventions might not be followed strictly. I think its better to make as few assumptions as possible about the calling code to avoid regressions. Changes to the head code are not necessarily tested with SEV/SEV-ES guests by developers. Regards, Joerg