1*cb4b231eSschwarze.\" $OpenBSD: memconfig.8,v 1.12 2014/01/20 05:07:48 schwarze Exp $ 2cdbdb68aSaaron.\" 3221b506fSmatthieu.\" Copyright (c) 1999 Chris Costello 4221b506fSmatthieu.\" All rights reserved. 5221b506fSmatthieu.\" 6221b506fSmatthieu.\" Redistribution and use in source and binary forms, with or without 7221b506fSmatthieu.\" modification, are permitted provided that the following conditions 8221b506fSmatthieu.\" are met: 9221b506fSmatthieu.\" 1. Redistributions of source code must retain the above copyright 10221b506fSmatthieu.\" notice, this list of conditions and the following disclaimer. 11221b506fSmatthieu.\" 2. Redistributions in binary form must reproduce the above copyright 12221b506fSmatthieu.\" notice, this list of conditions and the following disclaimer in the 13221b506fSmatthieu.\" documentation and/or other materials provided with the distribution. 14221b506fSmatthieu.\" 15221b506fSmatthieu.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 16221b506fSmatthieu.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17221b506fSmatthieu.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18221b506fSmatthieu.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 19221b506fSmatthieu.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20221b506fSmatthieu.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21221b506fSmatthieu.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22221b506fSmatthieu.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23221b506fSmatthieu.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24221b506fSmatthieu.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25221b506fSmatthieu.\" SUCH DAMAGE. 26221b506fSmatthieu.\" 27a78a644dSmatthieu.\" $FreeBSD: /home/ncvs/src/usr.sbin/memcontrol/memcontrol.8,v 1.9 2002/09/15 15:07:55 dwmalone Exp $ 28221b506fSmatthieu.\" 29*cb4b231eSschwarze.Dd $Mdocdate: January 20 2014 $ 30221b506fSmatthieu.Dt MEMCONFIG 8 31221b506fSmatthieu.Os 32221b506fSmatthieu.Sh NAME 33221b506fSmatthieu.Nm memconfig 3473d4fc9bSjmc.Nd control system cache behaviour with respect to memory 35221b506fSmatthieu.Sh SYNOPSIS 3684fb96c5Saaron.Nm memconfig 37221b506fSmatthieu.Ar list 38221b506fSmatthieu.Op Fl a 3984fb96c5Saaron.Nm memconfig 40221b506fSmatthieu.Ar set 41221b506fSmatthieu.Fl b Ar base 42221b506fSmatthieu.Fl l Ar length 43221b506fSmatthieu.Fl o Ar owner 44221b506fSmatthieu.Ar attribute 4584fb96c5Saaron.Nm memconfig 46221b506fSmatthieu.Ar clear 47221b506fSmatthieu.Fl o Ar owner 4884fb96c5Saaron.Nm memconfig 49221b506fSmatthieu.Ar clear 50221b506fSmatthieu.Fl b Ar base 51221b506fSmatthieu.Fl l Ar length 52221b506fSmatthieu.Sh DESCRIPTION 53221b506fSmatthieuA number of supported system architectures allow the behaviour of the CPU 54221b506fSmatthieucache to be programmed to behave differently depending on the region being 55221b506fSmatthieuwritten. 56221b506fSmatthieu.Pp 5784fb96c5Saaron.Nm 58221b506fSmatthieuprovides an interface to this facility, allowing CPU cache behavior to 59221b506fSmatthieube altered for ranges of system physical memory. 60221b506fSmatthieu.Pp 61221b506fSmatthieuThese ranges are typically power-of-2 aligned and sized, however the specific 62cdbdb68aSaaronrules governing their layout vary between architectures. 63cdbdb68aSaaronThe 6484fb96c5Saaron.Nm 65221b506fSmatthieuprogram does not attempt to enforce these rules, however the system will 66221b506fSmatthieureject any attempt to set an illegal combination. 6784fb96c5Saaron.Pp 6884fb96c5SaaronThe operands and their options are as follows: 69221b506fSmatthieu.Bl -tag -width clear 70221b506fSmatthieu.It Ar list 71221b506fSmatthieuList range slots. 72221b506fSmatthieu.Bl -tag -width xxxxxx 73fc1fba1aSjmc.It Fl a 7484fb96c5SaaronList all range slots, even those that are inactive. 75221b506fSmatthieu.El 76221b506fSmatthieu.It Ar set 77221b506fSmatthieuSet memory range attributes. 78221b506fSmatthieu.Bl -tag -width xxxxxx 79221b506fSmatthieu.It Fl b Ar base 8084fb96c5SaaronMemory range base address. 81221b506fSmatthieu.It Fl l Ar length 8284fb96c5SaaronLength of memory range in bytes, power of 2. 83221b506fSmatthieu.It Fl o Ar owner 8484fb96c5SaaronText identifier for this setting (7 char max). 85221b506fSmatthieu.It Ar attribute 86a78a644dSmatthieuAttributes applied to this range; combinations of 87a78a644dSmatthieu.Ar force , 88221b506fSmatthieu.Ar uncacheable , 89221b506fSmatthieu.Ar write-combine , 90221b506fSmatthieu.Ar write-through , 91221b506fSmatthieu.Ar write-back , 9284fb96c5Saaronor 9384fb96c5Saaron.Ar write-protect . 94221b506fSmatthieu.El 95221b506fSmatthieu.It Ar clear 96cdbdb68aSaaronClear memory range attributes. 97cdbdb68aSaaronRanges may be cleared by owner or by base/length combination. 98221b506fSmatthieu.Pp 99221b506fSmatthieuTo clear based on ownership: 100221b506fSmatthieu.Bl -tag -width xxxxxx 101221b506fSmatthieu.It Fl o Ar owner 10284fb96c5SaaronAll ranges with this owner will be cleared. 103221b506fSmatthieu.El 104221b506fSmatthieu.Pp 105221b506fSmatthieuTo clear based on the base/length combination: 106221b506fSmatthieu.Bl -tag -width xxxxxx 107221b506fSmatthieu.It Fl b Ar base 10884fb96c5SaaronMemory range base address. 109221b506fSmatthieu.It Fl l Ar length 11084fb96c5SaaronLength of memory range in bytes, power of 2. 111221b506fSmatthieu.El 112221b506fSmatthieu.Pp 113221b506fSmatthieuBase and length must exactly match an existing range. 114221b506fSmatthieu.El 115221b506fSmatthieu.Sh SEE ALSO 116221b506fSmatthieu.Xr mtrr 4 117221b506fSmatthieu.Sh HISTORY 11884fb96c5Saaron.Nm 1190cfa78c6Smpechwas originally introduced in 1200cfa78c6Smpech.Fx 3.3 1210cfa78c6Smpechas 122*cb4b231eSschwarze.Sy memcontrol . 123