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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 92E07C4363A for ; Tue, 20 Oct 2020 15:48:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3590D22244 for ; Tue, 20 Oct 2020 15:48:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731783AbgJTPsQ (ORCPT ); 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