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=-2.3 required=3.0 tests=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 CA6C8C47404 for ; Thu, 10 Oct 2019 00:21:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A760221848 for ; Thu, 10 Oct 2019 00:21:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731589AbfJJAVR (ORCPT ); Wed, 9 Oct 2019 20:21:17 -0400 Received: from mga01.intel.com ([192.55.52.88]:53359 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731230AbfJJAVR (ORCPT ); Wed, 9 Oct 2019 20:21:17 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Oct 2019 17:21:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,278,1566889200"; d="scan'208";a="393858404" Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.41]) by fmsmga005.fm.intel.com with ESMTP; 09 Oct 2019 17:21:16 -0700 Date: Wed, 9 Oct 2019 17:21:16 -0700 From: Sean Christopherson To: "Xing, Cedric" Cc: Jarkko Sakkinen , linux-sgx@vger.kernel.org Subject: Re: [PATCH for_v23 16/16] x86/vdso: sgx: Rework __vdso_sgx_enter_enclave() to prefer "no callback" Message-ID: <20191010002116.GB12533@linux.intel.com> References: <20191008044613.12350-1-sean.j.christopherson@intel.com> <20191008044613.12350-17-sean.j.christopherson@intel.com> <15c03e7e-cd98-5ea2-82a1-a11bec4abe2a@intel.com> <20191009191003.GD19952@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191009191003.GD19952@linux.intel.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-sgx-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sgx@vger.kernel.org On Wed, Oct 09, 2019 at 12:10:03PM -0700, Sean Christopherson wrote: > > >+ > > >+ /* Clear RFLAGS.DF per x86_64 ABI */ > > >+ cld > > >+ > > >+ /* Load the callback pointer to %rax and invoke it via retpoline. */ > > >+ mov 0x20(%rbp), %rax > > > > Per X86_64 ABI, %rsp shall be 16 bytes aligned before "call". But %rsp here > > doesn't look aligned properly. > > Argh, I probably botched it back in patch 02/16 too. I'll see if I can > add a check to verify %rsp alignment in the selftest, verifying via code > inspection is bound to be error prone. Added a selftest, stack is indeed not properly aligned.