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 lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47272C433EF for ; Wed, 15 Dec 2021 18:26:03 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.247539.426848 (Exim 4.92) (envelope-from ) id 1mxYyE-0007c2-MW; Wed, 15 Dec 2021 18:25:42 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 247539.426848; Wed, 15 Dec 2021 18:25:42 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mxYyE-0007bv-Ja; Wed, 15 Dec 2021 18:25:42 +0000 Received: by outflank-mailman (input) for mailman id 247539; Wed, 15 Dec 2021 18:25:41 +0000 Received: from mail.xenproject.org ([104.130.215.37]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mxYyD-0007bp-AF for xen-devel@lists.xenproject.org; Wed, 15 Dec 2021 18:25:41 +0000 Received: from xenbits.xenproject.org ([104.239.192.120]) by mail.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mxYyA-0001X8-NS; Wed, 15 Dec 2021 18:25:38 +0000 Received: from [54.239.6.190] (helo=[10.85.97.145]) by xenbits.xenproject.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxYyA-0003HU-H6; Wed, 15 Dec 2021 18:25:38 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=xen.org; s=20200302mail; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:Cc:To:Subject:MIME-Version:Date:Message-ID; bh=S5tQfAIKkuATzyaKtKEK1++P0nF1HSnJSfdCOM/Va7k=; b=KVhS9/l//JSXxFIcHZM0JwV+IS D0CoaB/9ULEd+MsrsYdyRhAu4u2D0jqS+kRGZgTLrLLD20sn0mTNuPSF7Ea6EBfWXFIWBw62JHDZ6 wnHHOtHlxHrrlL84Z3tiEWnkgaibQTsUDE9VVazVBt0mP198OYb31kHItRhczHBY9RWQ=; Message-ID: <4b6c1865-5ded-fe6d-aead-bcd2e5cd4125@xen.org> Date: Wed, 15 Dec 2021 18:25:36 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Subject: Re: [PATCH] xen/arm64: Zero the top 32 bits of gp registers on entry... To: Michal Orzel , Jan Beulich Cc: Stefano Stabellini , Volodymyr Babchuk , Bertrand Marquis , xen-devel@lists.xenproject.org References: <20211206142032.27536-1-michal.orzel@arm.com> <6ab797ce-86dc-2c32-1cd0-417fab7516c7@suse.com> <73913bdf-7449-34fb-b86b-662774cb3e62@xen.org> <865fb3a7-76fc-24da-e07d-c6e59e3e1abe@arm.com> <3aae0020-938e-d5fe-7d7f-d5d1c8335a24@xen.org> <447b6c54-7d0c-132f-6202-c1ae7fb16e5d@arm.com> <871bda7e-3f94-a5bd-3caa-16b0c8f6d693@suse.com> <87080c9d-803d-608a-1c5a-2102f014d2bc@xen.org> <1fcc18d4-70ce-12d1-6d54-ae82e511a4d7@xen.org> <040a1871-08ee-00e9-b46f-ca4854e8a541@arm.com> <82557218-539b-204a-a1a7-7c796a2baa8a@suse.com> <9dc003f8-4dd0-282f-61ce-6ca74c543f20@arm.com> <6e54f971-84c3-3635-12c8-643b619b2b53@suse.com> <219d27fe-4e77-59f5-b559-4bc70c2a0399@arm.com> From: Julien Grall In-Reply-To: <219d27fe-4e77-59f5-b559-4bc70c2a0399@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Michal, On 15/12/2021 10:40, Michal Orzel wrote: > On 15.12.2021 11:32, Jan Beulich wrote: >> (Re-sending an abridged version, as apparently spam filters didn't like >> the original message with more retained context; I'll have to see whether >> this one also isn't liked. Sorry.) >> >> On 15.12.2021 10:48, Michal Orzel wrote: >>> This patch and the problem it solves is about clearing top 32bits of all gp registers so not only x0,x1. >> >> That's well understood. Yet for everything still in registers simply >> using mov ahead of the respective push (as you had it) is still >> preferable imo. >> >> Jan >> > > In that case let's wait for Julien's opinion to decide whether I should get back to the previous > solution with mov or to the stack solution. IIUC, your proposal is to: 1) Push all the 64-bit registers 2) Zero the top 32-bit Jan's suggestion is to: 1) clobber the top 32-bit using mov wX, wX 2) Push all the registers My preference is for the latter because there will be less memory/cache access. So, this would be your original patch + a compile time check to ensure save_x0_x1 is 0 when compat=1. Cheers, -- Julien Grall