From patchwork Tue Apr 30 22:53:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Paul Burton X-Patchwork-Id: 10924313 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2C3EB1398 for ; Tue, 30 Apr 2019 22:53:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1CCC228ABE for ; Tue, 30 Apr 2019 22:53:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 107FA28D4C; Tue, 30 Apr 2019 22:53:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A19A928ABE for ; Tue, 30 Apr 2019 22:53:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727012AbfD3Wxf (ORCPT ); Tue, 30 Apr 2019 18:53:35 -0400 Received: from mail-eopbgr800137.outbound.protection.outlook.com ([40.107.80.137]:36205 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727341AbfD3Wxf (ORCPT ); Tue, 30 Apr 2019 18:53:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wavesemi.onmicrosoft.com; s=selector1-wavecomp-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=eHheTCa2/fHIVf1dPrBgm4mO/6qR/YdcpjibyC8ZHas=; b=cFvHj283wUQ0FQEcEeyKknFhcixzlCtwhsmv/BlbFAAJTh7kcbonVTvjQY5ZRwJPJwI3EtDoRRg2Tw1VUekZDXAmxRzW03mXSpaG3ADktSj62nGyEVCpkRNjGIqW4NTG2ZMPUmz0RXgK+5bYkU6mOjf5LZyDhq54XSwrji2uttM= Received: from MWHPR2201MB1277.namprd22.prod.outlook.com (10.174.162.17) by MWHPR2201MB1197.namprd22.prod.outlook.com (10.174.169.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1835.18; Tue, 30 Apr 2019 22:53:30 +0000 Received: from MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::b9d6:bf19:ec58:2765]) by MWHPR2201MB1277.namprd22.prod.outlook.com ([fe80::b9d6:bf19:ec58:2765%7]) with mapi id 15.20.1835.018; Tue, 30 Apr 2019 22:53:30 +0000 From: Paul Burton To: "linux-mips@vger.kernel.org" CC: Serge Semin , Paul Burton Subject: [PATCH 1/4] MIPS: Use memblock_phys_alloc() for exception vector Thread-Topic: [PATCH 1/4] MIPS: Use memblock_phys_alloc() for exception vector Thread-Index: AQHU/6eHQ/g7IE/wjkmbMM+qxRJ3+Q== Date: Tue, 30 Apr 2019 22:53:30 +0000 Message-ID: <20190430225216.7164-2-paul.burton@mips.com> References: <20190430225216.7164-1-paul.burton@mips.com> In-Reply-To: <20190430225216.7164-1-paul.burton@mips.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: BYAPR07CA0076.namprd07.prod.outlook.com (2603:10b6:a03:12b::17) To MWHPR2201MB1277.namprd22.prod.outlook.com (2603:10b6:301:24::17) authentication-results: spf=none (sender IP is ) smtp.mailfrom=pburton@wavecomp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.21.0 x-originating-ip: [12.94.197.246] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 228d3ee5-1a64-4378-befb-08d6cdbea9f0 x-microsoft-antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600141)(711020)(4605104)(2017052603328)(7193020);SRVR:MWHPR2201MB1197; x-ms-traffictypediagnostic: MWHPR2201MB1197: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:1417; x-forefront-prvs: 00235A1EEF x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(376002)(39840400004)(346002)(396003)(366004)(189003)(199004)(53936002)(305945005)(486006)(11346002)(186003)(42882007)(446003)(2616005)(7736002)(6512007)(6916009)(107886003)(44832011)(476003)(76176011)(99286004)(6436002)(5640700003)(14454004)(3846002)(25786009)(52116002)(2906002)(102836004)(2501003)(6116002)(6506007)(386003)(66446008)(66556008)(26005)(2351001)(66946007)(73956011)(66476007)(50226002)(64756008)(316002)(6486002)(66066001)(54906003)(4326008)(81156014)(8936002)(71190400001)(81166006)(256004)(8676002)(1076003)(36756003)(71200400001)(68736007)(5660300002)(478600001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR2201MB1197;H:MWHPR2201MB1277.namprd22.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: wavecomp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: YkkWACjrbHZlf3V4bwpnRGHBxQupRzVQk+Dj92yP+Qo0rC+qn1tINkcqUQh4aBXvVGgIkk57jNoRFarRSquLqx+v08InTrwIKY6wRcm5HASBUGWc0G+ts0eBnSXy3CoYaYSoUlwtDKFsrl8krKX9LzAlZR+eM7IkONvuc/WD1P5kXS4NHKB0Iwi2CHvI1ansQb3kHDNqrx8uliiV8AJ7cZUzIlL1u4Vyi0ikVaBTMqCit+2H8fNH+AQln2DjLAL80Q0xLovHZJ26Vzxuoei1j97ISJGk79KvFLTV+zLJM8WbiZMCBvj519D957ivs/a+JzbqFPp1rGPLlb84WYob46m6wTq106cKUHFHgw/IelRvx/j2bb8n8OWrMx3fMnIiWDgVQ8YhxppamOAKaWecUJKUZ5xH/UXHadGLMvyia9Q= MIME-Version: 1.0 X-OriginatorOrg: mips.com X-MS-Exchange-CrossTenant-Network-Message-Id: 228d3ee5-1a64-4378-befb-08d6cdbea9f0 X-MS-Exchange-CrossTenant-originalarrivaltime: 30 Apr 2019 22:53:30.1073 (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-Transport-CrossTenantHeadersStamped: MWHPR2201MB1197 Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Allocate the exception vector using memblock_phys_alloc() which gives us a physical address, rather than the previous convoluted setup which obtained a virtual address using memblock_alloc(), converted it to a physical address & then back to a virtual address. Signed-off-by: Paul Burton Reviewed-by: Philippe Mathieu-Daudé --- arch/mips/kernel/traps.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 98ca55d62201..00f44b16385e 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c @@ -2292,9 +2292,8 @@ void __init trap_init(void) unsigned long size = 0x200 + VECTORSPACING*64; phys_addr_t ebase_pa; - ebase = (unsigned long) - memblock_alloc(size, 1 << fls(size)); - if (!ebase) + ebase_pa = memblock_phys_alloc(size, 1 << fls(size)); + if (!ebase_pa) panic("%s: Failed to allocate %lu bytes align=0x%x\n", __func__, size, 1 << fls(size)); @@ -2309,9 +2308,10 @@ void __init trap_init(void) * EVA is special though as it allows segments to be rearranged * and to become uncached during cache error handling. */ - ebase_pa = __pa(ebase); if (!IS_ENABLED(CONFIG_EVA) && !WARN_ON(ebase_pa >= 0x20000000)) ebase = CKSEG0ADDR(ebase_pa); + else + ebase = (unsigned long)phys_to_virt(ebase_pa); } else { ebase = CAC_BASE;