Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1912127ybb; Thu, 9 Apr 2020 11:18:37 -0700 (PDT) X-Google-Smtp-Source: APiQypKNCmOzbq/TNl1N9yA24VVm1IMEWB1HgSCXZS57YwvuQeXjjjtG8jRXbWOztb6/qvuf0mB6 X-Received: by 2002:ac8:5384:: with SMTP id x4mr635073qtp.135.1586456317163; Thu, 09 Apr 2020 11:18:37 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1586456317; cv=pass; d=google.com; s=arc-20160816; b=gBxVGddw9bhTAKteoYuTCXPGM8g4BM6daQqaS9qGTc3LG+sTaWVugCJuzVYlIwFwUS fqZ61WlIswG62nkiC/bNMKtQlgBTJkfWzI8v6+Qwy2YR4cNxGYpSkPOxju5kg0KLLC1X Ud0w2Dq3V53t7ZrQn5aYuE/AfuF+h2+4k100AHsDjqNfw+9/yhc1yUSJQkvx8KJm1XFw KqgwMuNesQZ71R/+D7ICH2pJe4Maq7ZjqvJuOOb2W/wJPjW+z9pkEyPUNDBvE4CZEokd hL+fZKFDCYPR3CSD6Th1RjAcm6otcB04R4wShCYqIeC7Pb3VjerLfkR+P8woeeCYMFyB DC4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=XC608SPjh/qCs2rVchcDTLKP2krF6sZZARVRRszhzMU=; b=mGb9F+mQ0IZuWVWVgs4vxCghWVXGexMmK2IwGAZNFxdLTqKTb1Sbfa2geUAbMJWUO1 vj2Mw5V6w0ETaFUTAIkEeVR0qTlvU55SbWm/kvS34Pe2FHLOJioe2/nvTflFtT3Psiab Cfbi3FvLDJ2j1zFxppiPPmhyQ+TWxLdtYoQ/7v8xQXax+u+u3nkox/Q7L9Zr06pIUDM2 xdvdCqxkexCnKJwubeXtKAW2Cew/VdAUnZifRVydL64Yt90bemtJgixnH2ezSstmd1BI WP6gafUIZthOPX+ZbXSwlgiwPf2SREZoZZ3o0Wht25LVb8VH0a8pKubCrKAJ9R1jsRKf wrBA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b="jV/bfpvv"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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 s17si6136669qts.207.2020.04.09.11.18.20; Thu, 09 Apr 2020 11:18:37 -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=pass header.i=@amdcloud.onmicrosoft.com header.s=selector2-amdcloud-onmicrosoft-com header.b="jV/bfpvv"; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.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 S1726681AbgDISQL (ORCPT + 99 others); Thu, 9 Apr 2020 14:16:11 -0400 Received: from mail-dm6nam12on2089.outbound.protection.outlook.com ([40.107.243.89]:6233 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725970AbgDISQK (ORCPT ); Thu, 9 Apr 2020 14:16:10 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eNM75pZyCUwQ6N1uS+iHRjsRNmjfewWlqIaiehou1rTsmnwy8liFuGVdwk0VzP+Kl38Gn/rOEx4ndld/LcIDDw2r+g7ZDpfWiwn9MiqnifiDHCgU/EhSS5Ei9MiUracNSQCZz6kKReDEl3PbaRurg/0wemKbYm2nwuURwbsH7/WQDsosv6h0IoeIsAUPUc7NR04QzkhMNTzfHrCdygoY51kBTFYjM8+I2qnhFUFMaeYmTw4R7WhR0OavfwmOfwG8PckXoWlHat9JviRbr5C0756OdLcLYOSfgjsElLI2RFazn+PZYXF4q6DGr40NzRG9m3AjbJfIgte1dEg1hDLG3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XC608SPjh/qCs2rVchcDTLKP2krF6sZZARVRRszhzMU=; b=LxiLeBlfUBNaB2jwd/hDh06yX4gWwrz41RZKeIEvlDOah95I4px1PW+cLVJD/OYwQt/8ku4Apj/Io8U0xkgQXQM6rJu207wR6kq23hc/1uxiv44bpXmPBKVwvjezSk/LulNPtgaHB0i9ajv8gg3iIjvWcWHg+D40L+Nv01GSybQCFSIXXQ4c/8y9gYhHeal4loPqJ4wV/lmCu2NWjP2vlCvoSzfJo56FOcA1qLT0ObTw99xD+jPNcxXeuMGhLuPCSUDrf2qTHs2NxT4tt+HoMLdSKRE6Fd8WiXWDprqRNOUnWlOjrULkphTnFGVdaJ/qavEtfkxdCaKvBDq3pxX73g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector2-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XC608SPjh/qCs2rVchcDTLKP2krF6sZZARVRRszhzMU=; b=jV/bfpvv8FyPmIkcFdYKUZptsyM+SvxOQLRjLcpDsKrTphJi6zyh6tjLnuut4Vq7uqSnBzL2PcjwWDvn4/9dKZD/QUpiiM7THgiXdAFeIR9tIFQzlRRtFw/JYx14xTCxr/ToTfKzsqr3MiHhUYCNWZ1QNICXl4FuK1MdJ5Sz55w= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Christian.Koenig@amd.com; Received: from DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) by DM6PR12MB4466.namprd12.prod.outlook.com (2603:10b6:5:2ae::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2878.15; Thu, 9 Apr 2020 18:16:07 +0000 Received: from DM6PR12MB4401.namprd12.prod.outlook.com ([fe80::f164:85c4:1b51:14d2]) by DM6PR12MB4401.namprd12.prod.outlook.com ([fe80::f164:85c4:1b51:14d2%4]) with mapi id 15.20.2878.022; Thu, 9 Apr 2020 18:16:07 +0000 Subject: Re: AMD DC graphics display code enables -mhard-float, -msse, -msse2 without any visible FPU state protection To: Peter Zijlstra Cc: Jann Horn , Harry Wentland , Leo Li , amd-gfx@lists.freedesktop.org, Alex Deucher , "David (ChunMing) Zhou" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , the arch/x86 maintainers , kernel list , Josh Poimboeuf , Andy Lutomirski , Arnaldo Carvalho de Melo , mhiramat@kernel.org References: <4c5fe55d-9db9-2f61-59b2-1fb2e1b45ed0@amd.com> <20200402141308.GB20730@hirez.programming.kicks-ass.net> <20200409155956.GQ20760@hirez.programming.kicks-ass.net> <20200409170916.GR20760@hirez.programming.kicks-ass.net> From: =?UTF-8?Q?Christian_K=c3=b6nig?= Message-ID: <87a2f2fc-972d-ab9b-a29d-72f02d94e60e@amd.com> Date: Thu, 9 Apr 2020 20:15:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 In-Reply-To: <20200409170916.GR20760@hirez.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-ClientProxiedBy: AM0PR06CA0099.eurprd06.prod.outlook.com (2603:10a6:208:fa::40) To DM6PR12MB4401.namprd12.prod.outlook.com (2603:10b6:5:2a9::15) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [IPv6:2a02:908:1252:fb60:be8a:bd56:1f94:86e7] (2a02:908:1252:fb60:be8a:bd56:1f94:86e7) by AM0PR06CA0099.eurprd06.prod.outlook.com (2603:10a6:208:fa::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2900.16 via Frontend Transport; Thu, 9 Apr 2020 18:16:02 +0000 X-Originating-IP: [2a02:908:1252:fb60:be8a:bd56:1f94:86e7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: 5f32cc5a-6d09-446a-4573-08d7dcb212a6 X-MS-TrafficTypeDiagnostic: DM6PR12MB4466:|DM6PR12MB4466: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-Forefront-PRVS: 0368E78B5B X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4401.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFTY:;SFS:(10009020)(4636009)(396003)(39860400002)(346002)(376002)(136003)(366004)(52116002)(8676002)(478600001)(86362001)(6916009)(66946007)(16526019)(5660300002)(66476007)(7416002)(186003)(66556008)(31686004)(316002)(6486002)(31696002)(54906003)(2616005)(36756003)(8936002)(4326008)(81166007)(81156014)(2906002)(6666004);DIR:OUT;SFP:1101; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rdkpDusV0g2HgNlvnNOtZ4cKM9xx8+3RMjZKZcI0dp+BMKmXComMNN3ttWzfuA/zbktA8U0Q/uEPb+VqYZxnLd2jIDxQQ1GNoyIlUClJh05z/vU5ESA11o6ml5XiWwj7nShT8VqQUX3qfbRZVAo1ooFlir0ZsT05BBz6PRFclJbDZob+y3FbgNOqzwDF8fQay4n2hsECxNn48c3oeAQNxg8sRCDQO9G4GsxUDiDSoDaKWMYd7DQkU/UJWkO6Jauid2ra2Eiuqs5ZUMnkAcHQonfOtuG0+Kg0HH6YhhfNaevd5klS76Uf1ZZq4m7u+Y9z7zt2OzSAvqJ32NZOgsVD/eHscP5c3TRMBml5X+rgVFcL/QBvlwyau+9v2lJ4Tg+AeCdKZLIYsc3KeqYM1yOCdQeC60qex1Bi832hUEbfS3qMG6Cp9uBdFs5UaNbwRZvp X-MS-Exchange-AntiSpam-MessageData: bppcPA3BWUMMMlgAKgkLhMygxHe6i/AZRoiacTJh/YYSgc7mlbpXcSrdJ25FIGuL+jwM2zjJjdmGZ6+0KXnyNgzEYciU8nDVGiM3yA2JHr8gTK3aKg35sh+YdAvWh+PrRILLhU1eiXDo39U/1JsZ3hVDnmaR18VO925H3EjkBjLDuHEGwCWAJMfcK1ulBVm2AD0wo3uPlX/MlQEVU+aDEg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5f32cc5a-6d09-446a-4573-08d7dcb212a6 X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Apr 2020 18:16:07.4208 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: KHwy+qQltxj+HPyf886R2deNEQbSkpO7cz/WuL/QnopNoTS3RV93GDXL5v21BTdh X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4466 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 09.04.20 um 19:09 schrieb Peter Zijlstra: > On Thu, Apr 09, 2020 at 05:59:56PM +0200, Peter Zijlstra wrote: > [SNIP] >> I'll need another approach, let me consider. > Christian; it says these files are generated, does that generator know > which functions are wholly in FPU context and which are not? Well that "generator" is still a human being :) It's just that the formulae for the calculation come from the hardware team and we are not able to easily transcript them to fixed point calculations. > My current thinking is that if I annotate all functions that are wholly > inside kernel_fpu_start() with an __fpu function attribute, then I can > verify that any call from regular text to fpu text only happens inside > kernel_fpu_begin()/end(). And I can ensure that all !__fpu annotation > fuctions only contain !fpu instructions. Yeah, that sounds like a good idea to me and should be easily doable. > Can that generator add the __fpu function attribute or is that something > that would need to be done manually (which seems like it would be > painful, since it is quite a bit of code) ? We are currently in the process of moving all the stuff which requires floating point into a single C file(s) and then make sure that we only call those within kernel_fpu_begin()/end() blocks. Annotating those function with __fpu or even saying to gcc that all code of those files should go into a special text.fpu segment shouldn't be much of a problem. Regards, Christian.