From owner-svn-src-all@freebsd.org Thu Oct 31 15:16:11 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 052C315C698; Thu, 31 Oct 2019 15:16:11 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473pn663RKz4SMm; Thu, 31 Oct 2019 15:16:10 +0000 (UTC) (envelope-from mw@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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id B3249248C3; Thu, 31 Oct 2019 15:16:10 +0000 (UTC) (envelope-from mw@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9VFGA0T041523; Thu, 31 Oct 2019 15:16:10 GMT (envelope-from mw@FreeBSD.org) Received: (from mw@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9VFGAhK041522; Thu, 31 Oct 2019 15:16:10 GMT (envelope-from mw@FreeBSD.org) Message-Id: <201910311516.x9VFGAhK041522@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mw set sender to mw@FreeBSD.org using -f From: Marcin Wojtas Date: Thu, 31 Oct 2019 15:16:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354217 - head/sys/arm64/arm64 X-SVN-Group: head X-SVN-Commit-Author: mw X-SVN-Commit-Paths: head/sys/arm64/arm64 X-SVN-Commit-Revision: 354217 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Oct 2019 15:16:11 -0000 Author: mw Date: Thu Oct 31 15:16:10 2019 New Revision: 354217 URL: https://svnweb.freebsd.org/changeset/base/354217 Log: Fix pmap_change_attr() on arm64 to allow KV addresses Altough in the comment above the pmap_change_attr() it was mentioned that VA could be in KV or DMAP memory space. However, pmap_change_attr_locked() was accepting only the values inside the DMAP memory range. To fix that, the condition check was changed so also the va inside the KV memory range would be accepted. The sample use case that wasn't supported is the PCI Device that has the BAR which should me mapped with the Write Combine attribute - for example BAR2 of the ENA network controller on the A1 instances on AWS. Tested on A1 AWS instance and changed ENA BAR2 mapped resource to be write-combined memory region. Differential Revision: https://reviews.freebsd.org/D22055 MFC after: 2 weeks Submitted by: Michal Krawczyk Obtained from: Semihalf Sponsored by: Amazon, Inc. Modified: head/sys/arm64/arm64/pmap.c Modified: head/sys/arm64/arm64/pmap.c ============================================================================== --- head/sys/arm64/arm64/pmap.c Thu Oct 31 14:49:30 2019 (r354216) +++ head/sys/arm64/arm64/pmap.c Thu Oct 31 15:16:10 2019 (r354217) @@ -5291,7 +5291,8 @@ pmap_change_attr_locked(vm_offset_t va, vm_size_t size offset = va & PAGE_MASK; size = round_page(offset + size); - if (!VIRT_IN_DMAP(base)) + if (!VIRT_IN_DMAP(base) && + !(base >= VM_MIN_KERNEL_ADDRESS && base < VM_MAX_KERNEL_ADDRESS)) return (EINVAL); for (tmpva = base; tmpva < base + size; ) {