Date: Mon, 25 Jul 2016 23:19:53 +0200 From: Oliver Pinter <oliver.pinter@hardenedbsd.org> To: Konstantin Belousov <kib@freebsd.org> Cc: "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "Conrad E. Meyer" <cem@freebsd.org> Subject: Re: svn commit: r290156 - head/sys/amd64/amd64 Message-ID: <CAPQ4ffsVh%2B2SF52wOq%2BqAYQahYeQWk1fbNQKWJaJjuDN623Odw@mail.gmail.com> In-Reply-To: <201510291907.t9TJ70UN004616@repo.freebsd.org> References: <201510291907.t9TJ70UN004616@repo.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Oct 29, 2015 at 8:07 PM, Conrad E. Meyer <cem@freebsd.org> wrote: > Author: cem > Date: Thu Oct 29 19:07:00 2015 > New Revision: 290156 > URL: https://svnweb.freebsd.org/changeset/base/290156 > > Log: > pmap_change_attr: Only fixup DMAP for DMAPed ranges > > pmap_change_attr must change the memory type of both the requested KVA > and the corresponding DMAP mappings (if such mappings exist), to satisfy > an Intel requirement that two or more mappings to the same physical > pages must have the same memory type. > > However, not all kernel mapped pages have corresponding DMAP mappings -- > for example, 64-bit BARs. Skip fixing up the DMAP for out-of-bounds > addresses. > > Submitted by: Steve Wahl <steve_wahl@dell.com> > Reviewed by: alc, jhb > Sponsored by: Dell Compellent > Differential Revision: https://reviews.freebsd.org/D4030 > > Modified: > head/sys/amd64/amd64/pmap.c Hi Konstantin! MFC back this to 10-STABLE? Sure, it was never marked as MFC, but cem@ never mark them. Thanks, Oliver > > Modified: head/sys/amd64/amd64/pmap.c > ============================================================================== > --- head/sys/amd64/amd64/pmap.c Thu Oct 29 19:02:24 2015 (r290155) > +++ head/sys/amd64/amd64/pmap.c Thu Oct 29 19:07:00 2015 (r290156) > @@ -6411,7 +6411,7 @@ pmap_change_attr_locked(vm_offset_t va, > */ > for (tmpva = base; tmpva < base + size; ) { > pdpe = pmap_pdpe(kernel_pmap, tmpva); > - if (*pdpe == 0) > + if (pdpe == NULL || *pdpe == 0) > return (EINVAL); > if (*pdpe & PG_PS) { > /* > @@ -6484,7 +6484,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PDE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pdpe & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pdpe & PG_PS_FRAME; > @@ -6513,7 +6514,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PDE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pde & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pde & PG_PS_FRAME; > @@ -6540,7 +6542,8 @@ pmap_change_attr_locked(vm_offset_t va, > X86_PG_PTE_CACHE); > changed = TRUE; > } > - if (tmpva >= VM_MIN_KERNEL_ADDRESS) { > + if (tmpva >= VM_MIN_KERNEL_ADDRESS && > + (*pte & PG_PS_FRAME) < dmaplimit) { > if (pa_start == pa_end) { > /* Start physical address run. */ > pa_start = *pte & PG_FRAME; > _______________________________________________ > svn-src-head@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/svn-src-head > To unsubscribe, send any mail to "svn-src-head-unsubscribe@freebsd.org"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPQ4ffsVh%2B2SF52wOq%2BqAYQahYeQWk1fbNQKWJaJjuDN623Odw>