From patchwork Thu Oct 10 18:54:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 11184107 X-Patchwork-Delegate: paulburton@kernel.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5EF813BD for ; Thu, 10 Oct 2019 18:54:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFD5C218AC for ; Thu, 10 Oct 2019 18:54:46 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=wavecomp.com header.i=@wavecomp.com header.b="WexqWdJ6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726793AbfJJSyq (ORCPT ); Thu, 10 Oct 2019 14:54:46 -0400 Received: from mail-eopbgr820099.outbound.protection.outlook.com ([40.107.82.99]:35770 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726007AbfJJSyq (ORCPT ); Thu, 10 Oct 2019 14:54:46 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HbixM2Sz+XAibzqkHNeoDp2jPIbSTwoMAPoGa4U6G7fDRzeCzEZUw9wKCBob6WvTksL8T7tFJNnnV9Mmvfd2wUHiPqoUBHhMGYMKgkN6hH214AKS7adCrAUQO+XTSWxQQhruj7jwt6VbMHIx8W4xiFhaeMeFgPouvQxND18H+W8KcZnQx5kXiVSjhnEep+tScH/1yVhwsXESeJ7amlOiWLNG00pOUfi1tM2PnWjJh9X2z0t4r+dfl504STEy/QNgYscLmYBsNJbm4bqlauCuZnmdLestsq2KD+I1TKlIqb4Q/v6jLoiFVgK0IEzlItPYKE4+JyeQWs/f3FmBp+m6zA== 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=x+zRRoOihCScYNAIeakXbn3H+4ZnILFawPE4L8qPneQ=; b=EhW2OCULXKIkc0EK4HrYmVnTifWNwJ9uU6M2qAHGkX15egmjlb9uM/ClfFcaCAeMEAOVXe7udeUgz3m+OT3ShPx8BNVkwBvkPoLiovlmpdaJY7c60QUvByZseqsWJFXQ9F7CcDPCumjqJvBuilvFQCSa+hrpDZbrHSYbweo5Ds7wjIh95KfIGJTkVxmIdWfEidfwfF8nrUOD/alGbig0uICuYJj06g5/FmhhlDAQrZLpvf+kGvwij2YCxkNPz4RwbEY/7L+l004HNDLK2/rQQHB0zfBFDm03FeyV8izO+XJhXM/eb9OkR4vFDh35E3PhnGGQh+UWASY5urkWpEde2w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=wavecomp.com; dmarc=pass action=none header.from=mips.com; dkim=pass header.d=mips.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavecomp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=x+zRRoOihCScYNAIeakXbn3H+4ZnILFawPE4L8qPneQ=; b=WexqWdJ6jdmvw91Im7Iw3ZJM/RhgsC5mczyPLLDlV7U/M0uU1DYkmrWIiK2PQOO8PLxvt9LaRs3p/M7KKjXVjsySS7qylbj6QVEMeOIGlXwSilttuqCFn/uBMgrGPHD2Mb9+ppfW9urLCHal4XF2tnIoPwFPFNMXqiEuFTgxTJw= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.172.60.12) by MWHPR2201MB1726.namprd22.prod.outlook.com (10.164.206.156) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.17; Thu, 10 Oct 2019 18:54:03 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::c1dc:dba3:230c:e7f0]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::c1dc:dba3:230c:e7f0%8]) with mapi id 15.20.2347.016; Thu, 10 Oct 2019 18:54:03 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Paul Burton , Huacai Chen , Jiaxun Yang , "stable@vger.kernel.org" Subject: [PATCH] MIPS: Disable Loongson MMI instructions for kernel build Thread-Topic: [PATCH] MIPS: Disable Loongson MMI instructions for kernel build Thread-Index: AQHVf5wVKW7vpQ4uykW+vlSY7qdKrQ== Date: Thu, 10 Oct 2019 18:54:03 +0000 Message-ID: <20191010185324.2407578-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR01CA0016.prod.exchangelabs.com (2603:10b6:a02:80::29) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:18::12) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.23.0 x-originating-ip: [12.94.197.246] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ac950004-7d04-4c7d-908a-08d74db33814 x-ms-traffictypediagnostic: MWHPR2201MB1726: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:510; x-forefront-prvs: 018632C080 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39840400004)(366004)(396003)(136003)(52314003)(199004)(189003)(6436002)(99286004)(102836004)(52116002)(316002)(42882007)(26005)(186003)(6506007)(386003)(3846002)(6512007)(36756003)(5640700003)(6116002)(4326008)(476003)(44832011)(486006)(2906002)(2616005)(305945005)(7736002)(6916009)(66066001)(2501003)(2351001)(8676002)(81156014)(81166006)(8936002)(71200400001)(66946007)(64756008)(66556008)(66446008)(6486002)(66476007)(478600001)(5660300002)(50226002)(25786009)(1076003)(14444005)(71190400001)(14454004)(54906003)(256004);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1726;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 8lSEk9lsrjQ/C9D5UKSw2rmj298NEAlezOOrx5DM9e8q7gvK6P2o8MNYTKkYJcaqYSXj5qMrlYvF8QZHaj6V85BEw0KOT48rFMk2SVdLe7WNFxbRtViy95IRe32yzxP/2IEx/eO4drHoihkIKn610MvvdCxA1tL0Jyvvt9fB9M/JwKeAd/U7aUyFMXgVj3dq+ZNnqy39daOfv8TK6C/xA20WHJtVspK53MCq78xuDhPd1cs0eHRcuTS4EnSKnpge2qT+Y+Ed+FFj/5GSfC2bGg/E+8m8MIhuyg7flHVWbY4YlFHHrOh6anqRnv8szJbDF6VupGPZUGaWR0LViiXLjG9/Z4mMJNWfnbTu6xEXcq6KC3Knt/CF+Ql4XucGeB74jYFMKanFuER1xo5V5ObS7DyV2TrIAhBsId6Fy+4T6Qk= Content-ID: <036097482928BD46A3209E9254A65042@namprd22.prod.outlook.com> MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: ac950004-7d04-4c7d-908a-08d74db33814 X-MS-Exchange-CrossTenant-originalarrivaltime: 10 Oct 2019 18:54:03.3840 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 463607d3-1db3-40a0-8a29-970c56230104 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: h+9GuZHn1AJkRBMJlBEKSMJ4iFOSaiSIcelE8+BjDPM8SW/dxuvYD2k9s/v+7G02psn6dF8Vlak21WM4RaVs8w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR2201MB1726 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org GCC 9.x automatically enables support for Loongson MMI instructions when using some -march= flags, and then errors out when -msoft-float is specified with: cc1: error: ‘-mloongson-mmi’ must be used with ‘-mhard-float’ The kernel shouldn't be using these MMI instructions anyway, just as it doesn't use floating point instructions. Explicitly disable them in order to fix the build with GCC 9.x. Signed-off-by: Paul Burton Fixes: 3702bba5eb4f ("MIPS: Loongson: Add GCC 4.4 support for Loongson2E") Fixes: 6f7a251a259e ("MIPS: Loongson: Add basic Loongson 2F support") Fixes: 5188129b8c9f ("MIPS: Loongson-3: Improve -march option and move it to Platform") Cc: Huacai Chen Cc: Jiaxun Yang Cc: stable@vger.kernel.org # v2.6.32+ --- arch/mips/loongson64/Platform | 4 ++++ arch/mips/vdso/Makefile | 1 + 2 files changed, 5 insertions(+) diff --git a/arch/mips/loongson64/Platform b/arch/mips/loongson64/Platform index 28172500f95a..2855daf92fe8 100644 --- a/arch/mips/loongson64/Platform +++ b/arch/mips/loongson64/Platform @@ -66,6 +66,10 @@ else $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) endif +# Some -march= flags enable MMI instructions, and GCC complains about that +# support being enabled alongside -msoft-float. Thus explicitly disable MMI. +cflags-y += $(call cc-option,-mno-loongson-mmi) + # # Loongson Machines' Support # diff --git a/arch/mips/vdso/Makefile b/arch/mips/vdso/Makefile index 807f0f782f75..996a934ece7d 100644 --- a/arch/mips/vdso/Makefile +++ b/arch/mips/vdso/Makefile @@ -15,6 +15,7 @@ ccflags-vdso := \ $(filter -mmicromips,$(KBUILD_CFLAGS)) \ $(filter -march=%,$(KBUILD_CFLAGS)) \ $(filter -m%-float,$(KBUILD_CFLAGS)) \ + $(filter -mno-loongson-%,$(KBUILD_CFLAGS)) \ -D__VDSO__ ifdef CONFIG_CC_IS_CLANG