From owner-freebsd-arm@freebsd.org Thu Jul 16 08:23:52 2015 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5C11D9A3732 for ; Thu, 16 Jul 2015 08:23:52 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: from phabric-backend.isc.freebsd.org (phabric-backend.isc.freebsd.org [IPv6:2001:4f8:3:ffe0:406a:0:50:2]) by mx1.freebsd.org (Postfix) with ESMTP id 2AEBD169A for ; Thu, 16 Jul 2015 08:23:52 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by phabric-backend.isc.freebsd.org (Postfix, from userid 1346) id 13BC2ECEE; Thu, 16 Jul 2015 08:23:52 +0000 (UTC) Date: Thu, 16 Jul 2015 08:23:52 +0000 To: freebsd-arm@freebsd.org From: "wma_semihalf.com (Wojciech Macek)" Reply-to: D3107+327+a15a6a8a12bdc6fc@FreeBSD.org Subject: [Differential] [Request, 3 lines] D3107: Fix ARM64 stack calculation Message-ID: X-Priority: 3 Thread-Topic: D3107: Fix ARM64 stack calculation X-Herald-Rules: <28>, <31>, <32>, <34> X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-To: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: X-Phabricator-Cc: Thread-Index: MGU3ZWIwMjcwYmFiODRiMmUwODVmN2IzNDdj Precedence: bulk X-Phabricator-Sent-This-Message: Yes X-Mail-Transport-Agent: MetaMTA X-Auto-Response-Suppress: All X-Phabricator-Mail-Tags: , , , MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="b1_f378b74b4b5e2033baf1d2c0b0b74c49" X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.20 List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 16 Jul 2015 08:23:52 -0000 --b1_f378b74b4b5e2033baf1d2c0b0b74c49 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit wma_semihalf.com created this revision. wma_semihalf.com added reviewers: andoriyu_gmail.com, emaste, zbb. wma_semihalf.com added a subscriber: freebsd-arm-list. wma_semihalf.com set the repository for this revision to rS FreeBSD src repository. Herald added subscribers: emaste, andrew, imp. REVISION SUMMARY Fixes in locore.s: - opt_kstack_pages.h include was added to ensure the proper KSTACK_PAGES value is used - secondary stack calculation is modified to provide stack_top = secondary_stacks + (cpu_id)*PAGE_SIZE*KSTACK_PAGES because on ARMv8 the stack grows into lower memory addresses REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D3107 AFFECTED FILES sys/arm64/arm64/locore.S CHANGE DETAILS diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S --- a/sys/arm64/arm64/locore.S +++ b/sys/arm64/arm64/locore.S @@ -182,8 +182,7 @@ mp_virtdone: ldr x4, =secondary_stacks mov x5, #(PAGE_SIZE * KSTACK_PAGES) - sub x1, x0, #1 - mul x5, x1, x5 + mul x5, x0, x5 add sp, x4, x5 b init_secondary EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: wma_semihalf.com, andoriyu_gmail.com, emaste, zbb Cc: imp, andrew, freebsd-arm-list, emaste --b1_f378b74b4b5e2033baf1d2c0b0b74c49 Content-Type: text/x-patch; charset=utf-8; name="D3107.7001.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D3107.7001.patch" ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hcm02NC9sb2NvcmUuUyBiL3N5cy9hcm02NC9hcm02NC9s b2NvcmUuUwotLS0gYS9zeXMvYXJtNjQvYXJtNjQvbG9jb3JlLlMKKysrIGIvc3lzL2FybTY0L2Fy bTY0L2xvY29yZS5TCkBAIC0xODIsOCArMTgyLDcgQEAKIG1wX3ZpcnRkb25lOgogCWxkcgl4NCwg PXNlY29uZGFyeV9zdGFja3MKIAltb3YJeDUsICMoUEFHRV9TSVpFICogS1NUQUNLX1BBR0VTKQot CXN1Ygl4MSwgeDAsICMxCi0JbXVsCXg1LCB4MSwgeDUKKwltdWwJeDUsIHgwLCB4NQogCWFkZAlz cCwgeDQsIHg1CiAKIAliCWluaXRfc2Vjb25kYXJ5Cgo= --b1_f378b74b4b5e2033baf1d2c0b0b74c49--