Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp6724605ybp; Tue, 15 Oct 2019 20:40:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqwcbe96NFxjvK41vSwCzu3yQY6bqG2GG3O1QyI7Ca1cjabi1jvVOTHzdQTqIzVGTu8bk/v+ X-Received: by 2002:a17:906:154a:: with SMTP id c10mr36462069ejd.238.1571197251507; Tue, 15 Oct 2019 20:40:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571197251; cv=none; d=google.com; s=arc-20160816; b=Oin3eKHtrqCCf/zgHMj5mA5+0QTDr1rcxD99RNkh3vlpzeM0IbpbpAwZoBgPFkhd3c 9BDzNfZUmcxbNtJMjzLhtkpbsmV9KGOAt3kJxB7BHXPsptn5l8yPeOE3nk81h48G82s4 iR/L9yAm+/qK/KrZ18rrxTDuhQovB41uegLYq6xaNEkevkbbneEeGubASlNdsX9FcBlG Qp3QVnyohxUkI29/jq97U+9GG3P9IbxZDnlmgwk2YwGEjDHS4xidvm07T6wOH7vs8kfP nQKq+EXK7WPH/BBAz7JD88xQTnDCqiItEEpoyXxibi2hT27Lpn/3cC2oWSiYC2wa7Dvz VifA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=GvhT2QXQ0GgfNEOJ+UXo4IMteX3tSISiPGXC9WqcO04=; b=feUU8abT9OayI/HQJDoSogL3wfSbG2CfDZVpWEgmYThn4ak0RMFB0Mz2PdVu3Y2lcP 5u8MeTXVH+Bd4qp14yytJWtmQIq9EyhSZlZSzBVBNw4pS8pRpOwzcAuETaMVd5BWt9yl 0u6wO5buM2kQCU0qoMmgbIkIN4BynPBPM53mFzDRbfUYotJWwfSLpAhhpKLKco6Ku3Ay SXM6TgWzH15GnE1+IZsZkFakg8ffmPr1gDRRAn20Onu6a8nXJyVD2ST61zpKrZS+BVMU 0AfbVCGJ0Zpc2wMBGuc3MQpDQ6TjOReT0cQQukIUAf63ktG3feMWxTjDgC1M01r0B7pv zEug== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RNSQmhS1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z4si13852619eji.316.2019.10.15.20.40.27; Tue, 15 Oct 2019 20:40:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=RNSQmhS1; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387475AbfJOU0m (ORCPT + 99 others); Tue, 15 Oct 2019 16:26:42 -0400 Received: from mail-qt1-f180.google.com ([209.85.160.180]:37911 "EHLO mail-qt1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726776AbfJOU0l (ORCPT ); Tue, 15 Oct 2019 16:26:41 -0400 Received: by mail-qt1-f180.google.com with SMTP id j31so32579023qta.5 for ; Tue, 15 Oct 2019 13:26:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=GvhT2QXQ0GgfNEOJ+UXo4IMteX3tSISiPGXC9WqcO04=; b=RNSQmhS1SULpv8GZPCiu5asQAlQF6Idx3EhdWxGneLmOdNMY9oR8myuMsapb1DryrK JBD6v8okCUJuTqICjRdcFSYW1axwy9SxM+N0lWTx6tlO6SPJIcCz19WgfLDH/PiXDs88 ozWURoS8goNos1zOqmD9OC2VT8ARi5cisOYuCuWxKln5eFQgkcEkOf0GGWawAijG2ZzB UKBxQ5Xj7mVy4DL0SGFNrROu0T4HRn0ookLg1iEIBE08ArG8ToWHPwViGxIzfVXTNXlo bSRxYFAzZJ/vm0edZXfUtkOSRC0I7tsOTSe+omVg/ruYNOINoAVUx9uPuTQSkFO0XNcd t9UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=GvhT2QXQ0GgfNEOJ+UXo4IMteX3tSISiPGXC9WqcO04=; b=SmfiToQOESlbE/i/Ufs+W6WUv/C5eB3JziJd6ljlBFBPMTdBv5txiY2IhD/XAyydvV JLlBFoYH/e66Z/58icJFtG+Sj+tQnpe3AiasWuhkScqusKBxj/liWFCEgZU7p+DLK3WJ nGIENkUhpZW9tPOi9wsiKQJ61c1VDjnKzgQmeS+XjL6BJCwrkBOtIDqx0iaR5hyEOD61 p7pnImkaSZHDCnhEEe5Z+GFmvUmhpaicuV4e5yYd8bKjS5a+zPbRE6R8y/Gi0WT3dgzF PhzGc7bcSkqKPUXkEOQE0PYyXARfhJj+jXGVY+hJLudw47qbLVU5ZL/lk/imuyajOQ9e iwvQ== X-Gm-Message-State: APjAAAV+zXAc1ogNzvKojxNNBRnDaTrLmj38f5yMtI0H8W6/Gvni+9xK XuGqzaX7hcojz80czia81t0= X-Received: by 2002:ac8:6a06:: with SMTP id t6mr18025686qtr.169.1571171200885; Tue, 15 Oct 2019 13:26:40 -0700 (PDT) Received: from rani ([2001:470:1f07:5f3:9e5c:8eff:fe50:ac29]) by smtp.gmail.com with ESMTPSA id u43sm12322018qte.19.2019.10.15.13.26.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Oct 2019 13:26:40 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Tue, 15 Oct 2019 16:26:38 -0400 To: Nick Desaulniers Cc: Arnd Bergmann , "S, Shirish" , "Wentland, Harry" , "Deucher, Alexander" , "yshuiv7@gmail.com" , "andrew.cooper3@citrix.com" , clang-built-linux , Matthias Kaehlcke , "S, Shirish" , "Zhou, David(ChunMing)" , "Koenig, Christian" , amd-gfx list , LKML Subject: Re: AMDGPU and 16B stack alignment Message-ID: <20191015202636.GA1671072@rani> References: <9e4d6378-5032-8521-13a9-d9d9519d07de@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 15, 2019 at 11:05:56AM -0700, Nick Desaulniers wrote: > Hmmm...I would have liked to remove it outright, as it is an ABI > mismatch that is likely to result in instability and non-fun-to-debug > runtime issues in the future. I suspect my patch does work for GCC > 7.1+. The question is: Do we want to either: > 1. mark AMDGPU broken for GCC < 7.1, or > 2. continue supporting it via stack alignment mismatch? > > 2 is brittle, and may break at any point in the future, but if it's > working for someone it does make me feel bad to outright disable it. > What I'd image 2 looks like is (psuedo code in a Makefile): > > if CC_IS_GCC && GCC_VERSION < 7.1: > set stack alignment to 16B and hope for the best > > So my diff would be amended to keep the stack alignment flags, but > only to support GCC < 7.1. And that assumes my change compiles with > GCC 7.1+. (Looks like it does for me locally with GCC 8.3, but I would > feel even more confident if someone with hardware to test on and GCC > 7.1+ could boot test). > -- > Thanks, > ~Nick Desaulniers If we do keep it, would adding -mstackrealign make it more robust? That's simple and will only add the alignment to functions that require 16-byte alignment (at least on gcc). Alternative is to use __attribute__((force_align_arg_pointer)) on functions that might be called from 8-byte-aligned code. It looks like -mstackrealign should work from gcc 5.3 onwards.