Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp5523314ybp; Tue, 15 Oct 2019 00:30:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzNOap/uASlLmfiuttjNbWEHU8W8E6um+mqVLNBN0ZPBCzo01WFg6RogF8oEB86h1TnUZGI X-Received: by 2002:a05:6402:154e:: with SMTP id p14mr11444690edx.274.1571124640226; Tue, 15 Oct 2019 00:30:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571124640; cv=none; d=google.com; s=arc-20160816; b=OaMBHTFnIu5WzyWHJL4vbWK/Uf4p0QvlJk4bx5+Qn4u/WYAmI6ZH2BpO5PsmpQ6szV nG8skehGoCUbdZVSBl58iMQ6ySzIKiDd6Kb4cFS7i/baLCZw7PEjFGRpfIdAAnhlfJde WoA6i4qAY6AzQGxNdbUCqDTVItUbMikdE00ls3rw+LzvCzffGj5veKFeMoSBOtX7Ne4r LQfSDC+sRINrJn46yGEEtbqndDM8xnylKUjhTuj38belp+j9connGgYSpVXDqJay605k rCcYbtCiBGFmHK5T5EGQfjHllmt1eorkFGnH0cIaOWRsyjn06o1MOhC1XvsGlFQ3h5KA /Ulw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=Qv7Az5tD/2XKPoU73wFDWyAMqFq/42sDZyfm822TJb4=; b=PW1bSFWtiQ2VY4i9i/TirsB2qYxKFt+zdQkPhAduf6Lv6n5EdgwgoNap4YzR8Zt0ra 6dzHg0MTYvYbPdUynyanHpRRM0y3Zhmgq5a35WS1k1O8gtQY3yGZQC2BOeJ5J629rip2 MW+wGBMKTWaq7Ex47VCDekwuhhXqfXF291Lj6V0wV2YT2e6kFl92yWxw8x2QkGpM36+Q rNwApuJ5WDlJr7GIgoCyZIgF6gNYf4f7lhFeh7J7GVvcHiFPQL+bD9I6FMVRHVIBAVCT odBXWZ0wQmJ0NcjssUDKsFusygW0LB7+VDbI3RCPhOKthPoPhweBWiDNyexQ72ZZLO1y 0XMw== ARC-Authentication-Results: i=1; mx.google.com; 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 pv13si12808654ejb.79.2019.10.15.00.30.16; Tue, 15 Oct 2019 00:30:40 -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; 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 S1727237AbfJOHTW (ORCPT + 99 others); Tue, 15 Oct 2019 03:19:22 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38178 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726052AbfJOHTV (ORCPT ); Tue, 15 Oct 2019 03:19:21 -0400 Received: by mail-qt1-f196.google.com with SMTP id j31so29149582qta.5 for ; Tue, 15 Oct 2019 00:19:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Qv7Az5tD/2XKPoU73wFDWyAMqFq/42sDZyfm822TJb4=; b=HSZ7759lULRSm51Y2uVkg96Ys1NfIwYuiEWs3E5iJipT5zJZLR5QTTFGSmN5JAE8QQ BZpe+Swpid3D1qd5hy2fa9NpvapPuLhackONp24jK7OeDOf8v8IO9bi+22brA3Pu6Jjb S7u08fCxAsSGYmhvEthEBQpl0c/v8p5A/YiTnJChyXJBDlHyC0PZMsL1EzAeFb93WgPd UIg83V7frNx+qr3COf3MdKKPiuYZOkGLbhIHE+U9NZd78gEM6NBn8CjZ1B/8jmfTjlXE 3ARgb+QN37tD/bcyqPV7atp/sKV0KCF/m3rYtSndFKUxQR1zU+h6N1ACr8B9afTYPgMt bDqg== X-Gm-Message-State: APjAAAVNrwbH2SmBn4/CBhuSLGE16KBeo2fwWf8YkGH5ffyFvoBY98eO PeN95yz34BDPLxOL5a5jDASbBq9jjBnklAMPdlQ= X-Received: by 2002:a05:6214:1150:: with SMTP id b16mr35117488qvt.197.1571123960489; Tue, 15 Oct 2019 00:19:20 -0700 (PDT) MIME-Version: 1.0 References: <9e4d6378-5032-8521-13a9-d9d9519d07de@amd.com> In-Reply-To: <9e4d6378-5032-8521-13a9-d9d9519d07de@amd.com> From: Arnd Bergmann Date: Tue, 15 Oct 2019 09:19:04 +0200 Message-ID: Subject: Re: AMDGPU and 16B stack alignment To: "S, Shirish" Cc: Nick Desaulniers , "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 Content-Type: text/plain; charset="UTF-8" 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 9:08 AM S, Shirish wrote: > On 10/15/2019 3:52 AM, Nick Desaulniers wrote: > My gcc build fails with below errors: > > dcn_calcs.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12 > > dcn_calc_math.c:1:0: error: -mpreferred-stack-boundary=3 is not between 4 and 12 > > While GPF observed on clang builds seem to be fixed. Ok, so it seems that gcc insists on having at least 2^4 bytes stack alignment when SSE is enabled on x86-64, but does not actually rely on that for correct operation unless it's using sse2. So -msse always has to be paired with -mpreferred-stack-boundary=3. For clang, it sounds like the opposite is true: when passing 16 byte stack alignment and having sse/sse2 enabled, it requires the incoming stack to be 16 byte aligned, but passing 8 byte alignment makes it do the right thing. So, should we just always pass $(call cc-option, -mpreferred-stack-boundary=4) to get the desired outcome on both? Arnd