From owner-svn-src-head@freebsd.org Sat May 13 13:01:16 2017 Return-Path: Delivered-To: svn-src-head@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 6BD8AD6A0A0; Sat, 13 May 2017 13:01:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3B669174A; Sat, 13 May 2017 13:01:16 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v4DD1FhJ038259; Sat, 13 May 2017 13:01:15 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v4DD1FBc038256; Sat, 13 May 2017 13:01:15 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201705131301.v4DD1FBc038256@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sat, 13 May 2017 13:01:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r318252 - head/sys/arm64/include X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 May 2017 13:01:16 -0000 Author: andrew Date: Sat May 13 13:01:15 2017 New Revision: 318252 URL: https://svnweb.freebsd.org/changeset/base/318252 Log: Add the VM_MEMATTR_WRITE_THROUGH memory type to arm64 and use it to support VM_MEMATTR_WRITE_COMBINING in the kernel. This fixes a bug where Xorg would use write back cached memory for its graphics buffers. This would produce artifacts on the screen as cachelines were written to memory. MFC after: 1 week Sponsored by: DARPA, AFRL Modified: head/sys/arm64/include/vm.h Modified: head/sys/arm64/include/vm.h ============================================================================== --- head/sys/arm64/include/vm.h Sat May 13 10:00:24 2017 (r318251) +++ head/sys/arm64/include/vm.h Sat May 13 13:01:15 2017 (r318252) @@ -30,9 +30,15 @@ #define _MACHINE_VM_H_ /* Memory attribute configuration. */ -#define VM_MEMATTR_DEVICE 0 -#define VM_MEMATTR_UNCACHEABLE 1 -#define VM_MEMATTR_WRITE_BACK 2 +#define VM_MEMATTR_DEVICE 0 +#define VM_MEMATTR_UNCACHEABLE 1 +#define VM_MEMATTR_WRITE_BACK 2 +#define VM_MEMATTR_WRITE_THROUGH 3 + +#ifdef _KERNEL +/* If defined vmstat will try to use both of these in a switch statement */ +#define VM_MEMATTR_WRITE_COMBINING VM_MEMATTR_WRITE_THROUGH +#endif #define VM_MEMATTR_DEFAULT VM_MEMATTR_WRITE_BACK