From owner-freebsd-arm@freebsd.org Thu Jul 16 05:09:59 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 6AA1E9A3A7F for ; Thu, 16 Jul 2015 05:09:59 +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 4A4B511D5 for ; Thu, 16 Jul 2015 05:09:59 +0000 (UTC) (envelope-from daemon-user@freebsd.org) Received: by phabric-backend.isc.freebsd.org (Postfix, from userid 1346) id 44B84EFFC; Thu, 16 Jul 2015 05:09:59 +0000 (UTC) Date: Thu, 16 Jul 2015 05:09:59 +0000 To: freebsd-arm@freebsd.org From: "wma_semihalf.com (Wojciech Macek)" Reply-to: D3106+327+b28f69eb027ff4f2@FreeBSD.org Subject: [Differential] [Request, 5 lines] D3106: Fix possible coherency issues between PEs related to I-cache Message-ID: X-Priority: 3 Thread-Topic: D3106: Fix possible coherency issues between PEs related to I-cache 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: MjNjMTI1ZTZiZGVmZmU3NDRjM2FmNmIzZTA3 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_c4ac98e6957a6929455f88ceeb97fdf6" 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 05:09:59 -0000 --b1_c4ac98e6957a6929455f88ceeb97fdf6 Content-Type: text/plain; charset = "utf-8" Content-Transfer-Encoding: 8bit wma_semihalf.com created this revision. wma_semihalf.com added reviewers: andrew, 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 Basing on B.2.3.4: Synchronization and coherency issues between data and instruction accesses. To ensure that modified instructions are visible to all PEs in a shareability domain one need to perform following sequence: 1. Clean D-cache 2. Ensure the visibility of data cleaned from cache 3. Invalidate I-cache 4. Ensure completion 5. In SMP system PE must issue isb to ensure execution of the modified instructions REPOSITORY rS FreeBSD src repository REVISION DETAIL https://reviews.freebsd.org/D3106 AFFECTED FILES sys/arm64/arm64/cpufunc_asm.S CHANGE DETAILS diff --git a/sys/arm64/arm64/cpufunc_asm.S b/sys/arm64/arm64/cpufunc_asm.S --- a/sys/arm64/arm64/cpufunc_asm.S +++ b/sys/arm64/arm64/cpufunc_asm.S @@ -61,17 +61,18 @@ add x1, x1, x2 /* Add these to the size */ bic x0, x0, x4 /* Clear the low bit of the address */ 1: + dc \dcop, x0 + dsb ish .if \ic != 0 ic \icop, x0 + dsb ish .endif - dc \dcop, x0 add x0, x0, x3 /* Move to the next line */ subs x1, x1, x3 /* Reduce the size */ b.hi 1b /* Check if we are done */ .if \ic != 0 isb .endif - dsb ish ret .endm EMAIL PREFERENCES https://reviews.freebsd.org/settings/panel/emailpreferences/ To: wma_semihalf.com, andrew, emaste, zbb Cc: imp, andrew, freebsd-arm-list, emaste --b1_c4ac98e6957a6929455f88ceeb97fdf6 Content-Type: text/x-patch; charset=utf-8; name="D3106.6995.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="D3106.6995.patch" ZGlmZiAtLWdpdCBhL3N5cy9hcm02NC9hcm02NC9jcHVmdW5jX2FzbS5TIGIvc3lzL2FybTY0L2Fy bTY0L2NwdWZ1bmNfYXNtLlMKLS0tIGEvc3lzL2FybTY0L2FybTY0L2NwdWZ1bmNfYXNtLlMKKysr IGIvc3lzL2FybTY0L2FybTY0L2NwdWZ1bmNfYXNtLlMKQEAgLTYxLDE3ICs2MSwxOCBAQAogCWFk ZAl4MSwgeDEsIHgyCQkvKiBBZGQgdGhlc2UgdG8gdGhlIHNpemUgKi8KIAliaWMJeDAsIHgwLCB4 NAkJLyogQ2xlYXIgdGhlIGxvdyBiaXQgb2YgdGhlIGFkZHJlc3MgKi8KIDE6CisJZGMJXGRjb3As IHgwCisJZHNiCWlzaAogLmlmIFxpYyAhPSAwCiAJaWMJXGljb3AsIHgwCisJZHNiCWlzaAogLmVu ZGlmCi0JZGMJXGRjb3AsIHgwCiAJYWRkCXgwLCB4MCwgeDMJCS8qIE1vdmUgdG8gdGhlIG5leHQg bGluZSAqLwogCXN1YnMJeDEsIHgxLCB4MwkJLyogUmVkdWNlIHRoZSBzaXplICovCiAJYi5oaQkx YgkJCS8qIENoZWNrIGlmIHdlIGFyZSBkb25lICovCiAuaWYgXGljICE9IDAKIAlpc2IKIC5lbmRp ZgotCWRzYglpc2gKIAlyZXQKIC5lbmRtCiAKCg== --b1_c4ac98e6957a6929455f88ceeb97fdf6--