From patchwork Wed Sep 13 18:08:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yury Norov X-Patchwork-Id: 9951831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7F7006038F for ; Wed, 13 Sep 2017 18:09:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 743A528674 for ; Wed, 13 Sep 2017 18:09:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 689DC28CE1; Wed, 13 Sep 2017 18:09:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7416228674 for ; Wed, 13 Sep 2017 18:09:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751419AbdIMSIw (ORCPT ); Wed, 13 Sep 2017 14:08:52 -0400 Received: from mail-dm3nam03on0082.outbound.protection.outlook.com ([104.47.41.82]:49568 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751106AbdIMSIu (ORCPT ); Wed, 13 Sep 2017 14:08:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=w/tY43Fc/4SX5WB77a4Vf8+Se+3y0DncdtEtglcsYIs=; b=GHBhUWBYN8I7xyTTkP/FhOVgSbnIYY3JDIMYi21kDmIZR09N5gh9Uqgw3YTIqMLeSelWP611e8VnxVS/vXXMhZItGV+sBWfIRue2KoStqfx/PWAe5QGPaKi5npTP/j7kiXdJ1K7NDfoU1GLp8OA/J/boOswvvKPRbo16jT8V8U8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Received: from localhost (176.59.106.116) by MWHPR0701MB3834.namprd07.prod.outlook.com (2603:10b6:301:7f::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.35.12; Wed, 13 Sep 2017 18:08:46 +0000 From: Yury Norov To: Marc Zyngier , Catalin Marinas , Will Deacon Cc: Yury Norov , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org Subject: [PATCH] arm64: fix documentation on kernel pages mappings to HYP VA Date: Wed, 13 Sep 2017 21:08:30 +0300 Message-Id: <20170913180830.8608-1-ynorov@caviumnetworks.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-Originating-IP: [176.59.106.116] X-ClientProxiedBy: VI1P189CA0003.EURP189.PROD.OUTLOOK.COM (2603:10a6:802:2a::16) To MWHPR0701MB3834.namprd07.prod.outlook.com (2603:10b6:301:7f::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 74374947-95b7-4e59-e056-08d4fad27a8c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:MWHPR0701MB3834; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0701MB3834; 3:WJgjSdzs1SGqmW/YIJICFYhjeP7Zeld5p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2roYgXcF6HedEnxXO1AtQyMBrE/rw1r/UcPv2Awf77QNMZWqmC3hJ8MTVENiZeyak8egnj8gGsOnxxQSOT7tdXXgWYMoKAJKtKZS0bEOkizawxWYkezZyGvzrT2jKrmFUMire5C+dnG6hXO5P4vHjPZt/4jvwvmNACVOeEHmE3u35PMeGR4EMRiQrE5K8r6KvTUdW+VSvgVsNg6iAFJyh7WYSEVk6/DzBywO1F/fPVNQ5yAaQArKsPUQ6eE541EpH+Ek4yeYRJiGgOt8W12TqnIte/kLJPyod6JDDXBYvt+bO5oWKRcqygMrs2vz8NUlBPno6BF07jTqsd5px1UCCd9PVtwWeRYn/apiurDcxYKxAr50ChOMBTAQnFIfIBxoSlPNjc7xIKgn4hkO1JsqYxVaDVbgd8=; 4:d7LErRbaoRfvJJih58vIre3UoaGE2zRGeGP2mwD8KXLyu0vl6xV+wxXtEGRYZBRyyeNHHduhLhZhe72ZS9Yt1/3zIqZt1PEGFOgdRGIEOhV420k6PKstPS06tPRZZ8ACFWbduPtbGVYt7XIKpJD1rKlqFDsWiyPwGsb81iG+0tmPMMr6AyYi72aQ44OH8KiK78QAcApcDYZrVhHpf5q4V4L8edXyKC7t7gaHcqNvBZGsKMjGY5d8PEw8u3fl95Uz X-Exchange-Antispam-Report-Test: UriScan:; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(5005006)(8121501046)(10201501046)(93006095)(100000703101)(100105400095)(3002001)(6041248)(20161123558100)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123564025)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:MWHPR0701MB3834; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:MWHPR0701MB3834; X-Forefront-PRVS: 042957ACD7 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6069001)(6009001)(346002)(376002)(199003)(189002)(5003940100001)(50466002)(316002)(101416001)(50986999)(97736004)(76506005)(189998001)(305945005)(7736002)(72206003)(16526017)(36756003)(5660300001)(478600001)(4326008)(48376002)(6496005)(33646002)(66066001)(106356001)(25786009)(68736007)(50226002)(6486002)(53936002)(42882006)(47776003)(1076002)(8936002)(105586002)(2906002)(6666003)(81166006)(81156014)(6116002)(3846002)(8676002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0701MB3834; H:localhost; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0701MB3834; 23:V87g7nD2f5wtcF65Ig1EbPGE45tnVqAAtYik3b7?= =?us-ascii?Q?QKjl7FqPXLjb22ZKMvaRSHuG6aqO1fq+vFB3pFy6idgmNk2vRT+sbRp9KSAf?= =?us-ascii?Q?aVJTMo7KkCW93bRbQJMKvT+TrJnz96MFT0kRB41eX7/DPeJMCoi3BcRw5w4e?= =?us-ascii?Q?1XMqOoR3ZH6WXB8ArE1uhbGf63ZsEcrs8pBrdlUystVigHwqfuvYKttmYzwK?= =?us-ascii?Q?vJChMF40DEaA0HDeQifVNyrzYSLiqeCEowKIMbBPMoPr57muvxtTU+iEZ760?= =?us-ascii?Q?XgaLq5l7mJo3/jnvhZZVC/klOAu3M9CvwVeWv9qqluVB/dSj/MYTJ+DBdB/e?= =?us-ascii?Q?M0RLXArN7dCzBVSGgo7TMpeaim5Fx7IogKjqNNgLsnZFPlmQQT7WCMYXFB8q?= =?us-ascii?Q?TpvR/lEz3+ts8/blCpbXtGFLJCo5brayODKPW2CpWSmQAbo88j4Bv/KB/T0J?= =?us-ascii?Q?lbRihlzWbtieuZ37rofw6apcUGUia4wdysPn2s9sGGgD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degN/LKqFLqc1gWTHrwgVo+HmqtXd8U2XHkM6YSFFxkXcTd4Whkl2d+Ld5SgRj5ILzpZhCBpMmBu47giXZbJ9MFoo/ZDnnp0ZDuYEJP4vm10KSdW9wkoFp34h1r9w==; 24:Vvm1ULtWSbHET0z4JkVqdaMVMcNP+4CH3bjrNt47SWtHw5vbv8XENfxU21f7auvAhJB1PQqn5u/5g9T4TiDdAzVulR7AsbeUnGT+XEDDRTc=; 7:9vpIV1GkiDJa0Zs1zeRDyRYNSPZgzAAqPv2EQkAvjcqwEoSva6Yt48uJ1mgSJ1S7uSOrVeQCagNG79iJLyRqm3Bm8XHrqlS8NRlHRuUGfIbCSkNLqmdfUrwnzmG+agRFh1CRTrNpxa4vF/38mQz5KovSIY4+pKPKqFLz6N5L4dgZAs5/MiaOIwqJxm+F7gsiCX0mHd3hv7oOubnRoc+/75vav5y3tZ5C6RouCliA7qs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Sep 2017 18:08:46.5648 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR0701MB3834 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The Documentation/arm64/memory.txt says: When using KVM, the hypervisor maps kernel pages in EL2, at a fixed offset from the kernel VA (top 24bits of the kernel VA set to zero): In fact, kernel addresses are transleted to HYP with kern_hyp_va macro, which has more options, and none of them assumes clearing of top 24bits of the kernel VA. Signed-off-by: Yury Norov --- Documentation/arm64/memory.txt | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/Documentation/arm64/memory.txt b/Documentation/arm64/memory.txt index d7273a5f6456..c39895d7e3a2 100644 --- a/Documentation/arm64/memory.txt +++ b/Documentation/arm64/memory.txt @@ -86,9 +86,12 @@ Translation table lookup with 64KB pages: +-------------------------------------------------> [63] TTBR0/1 -When using KVM, the hypervisor maps kernel pages in EL2, at a fixed -offset from the kernel VA (top 24bits of the kernel VA set to zero): - -Start End Size Use ------------------------------------------------------------------------ -0000004000000000 0000007fffffffff 256GB kernel objects mapped in HYP +When using KVM without Virtualization Host Extensions, the hypervisor maps +kernel pages in EL2, at a fixed offset from the kernel VA. Namely, top 16 +or 25 bits of the kernel VA set to zero depending on ARM64_VA_BITS_48 or +ARM64_VA_BITS_39 config option selected; or top 17 or 26 bits of the kernel +VA set to zero if CPU has Reduced HYP mapping offset capability. See +kern_hyp_va macro. + +When using KVM with Virtualization Host Extensions, no additional mappings +created as host kernel already operates in EL2.