Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031630AbdIZSqA (ORCPT ); Tue, 26 Sep 2017 14:46:00 -0400 Received: from mail-dm3nam03on0071.outbound.protection.outlook.com ([104.47.41.71]:12352 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1031611AbdIZSp5 (ORCPT ); Tue, 26 Sep 2017 14:45:57 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Yuri.Norov@cavium.com; Date: Tue, 26 Sep 2017 21:45:42 +0300 From: Yury Norov To: Marc Zyngier , Catalin Marinas , Will Deacon Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, Yury Norov Subject: Re: [PATCH] arm64: fix documentation on kernel pages mappings to HYP VA Message-ID: <20170926184542.t56zpdx2s5et77gy@yury-thinkpad> References: <20170913180830.8608-1-ynorov@caviumnetworks.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170913180830.8608-1-ynorov@caviumnetworks.com> User-Agent: NeoMutt/20170113 (1.7.2) X-Originating-IP: [176.59.119.117] X-ClientProxiedBy: VI1PR08CA0127.eurprd08.prod.outlook.com (2603:10a6:800:d4::29) To CY4PR0701MB3825.namprd07.prod.outlook.com (2603:10b6:910:94::31) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0290448e-7402-404d-2e39-08d5050ed1a5 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254152)(2017052603199)(201703131423075)(201703031133081)(201702281549075);SRVR:CY4PR0701MB3825; X-Microsoft-Exchange-Diagnostics: 1;CY4PR0701MB3825;3:j53C4/IP6+t3YaOQ4ffF1M5O9/ZT+IC25IKpy2gEaxRlurFsdZ0edvXDS6XtrQblLbu9+HZxl8BGhd3vp4PujmCGQVAkUzrtxEh2rWyMj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dwqyoT6i3aZzfc0vT3KImbbc6LTn3h8rE+Q3LgJ/RJ0Hlaj+4Mf6cw7H1veqZhJQxH1rD8Ax1fnRyvwfxIRUOVxqWHUvAcEDreQJLQp6fzMVb2p4RGzeCm7Zqgr+SzNH7EHkAyPK93CfhOiWfVbbcEL5eq4ky3NLOZpl2i5seEhy1SpvPdWXM3bNDGKFZvj2EBJM84YlwmCjDscP7KJWlvA6CFhyPFcnnBc3n7eW+l9/KqpEkFYAsOzqCA84KG9Ux8IIHe0i3OP6umYHnoo6uapD3m7YWWAficm1gue5qSGeKLNXJ1zp8SSgKSlenMh+gW9OgkEVuwlbfjx1Toucu6ekA=;4:/SGhwl7cNj1J1wKpUH0yW54ojcD0JfmOyjijj+0B4oikY4iq7xi7pSTVcMev+aeZEpPfC3Gg/XG4sgo7aK8CTvCiKU/I3i9qRRr+M2dP6+PvBCGey7KzB4/jXDqaqzxg2pPgkcLG3wrwMYPbrAnBkZEEQ3VyrkFUdhCfMPl1gTcaGLmoBgYBW/u+B7Du0hsuXGr0UKOz5tkuvu9t6SWpIVppNRsXd6Z3lFMkBIP3VNkileNuEoyBII7RAc/pGWCL 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)(100000703101)(100105400095)(10201501046)(3002001)(93006095)(6041248)(20161123562025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:CY4PR0701MB3825;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:CY4PR0701MB3825; X-Forefront-PRVS: 0442E569BC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(6069001)(7916004)(346002)(376002)(199003)(24454002)(189002)(33646002)(4326008)(6246003)(7736002)(2950100002)(53936002)(42882006)(101416001)(107886003)(106356001)(6496005)(9686003)(54356999)(5660300001)(76176999)(2906002)(50986999)(47776003)(105586002)(66066001)(6666003)(189998001)(81166006)(76506005)(1076002)(305945005)(72206003)(110136005)(6486002)(68736007)(229853002)(23726003)(97736004)(316002)(3846002)(25786009)(58126008)(8936002)(50466002)(81156014)(8676002)(16586007)(33716001)(478600001)(83506001)(6116002)(16526017);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR0701MB3825;H:localhost;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR0701MB3825;23:3U/Cm26WbhZyrTAZarQkkMWod4TfF0bh2o5+HY4?= =?us-ascii?Q?tLer4AttG4acpV5VgydSHlG7hwJZy0ZnMaEtWlCFkyT2ZXZwt8+GkiSbeCzg?= =?us-ascii?Q?QII5O+aXDck9YhbMguuEYuLbXiqCEHC97DVrfy4S3aUPYiW9GV217koVIXbj?= =?us-ascii?Q?YME6j4aOLc4ZfmnukFq5ksWMBJ0p7Wvc3GZdRSRzybzppCfQhhmrvQ4rh4GD?= =?us-ascii?Q?2rQNUw9oL2v1PToEFkHum9VBk7Fwko0WQKTHbwMlhK1+lwIChTbDaSBIjUHQ?= =?us-ascii?Q?MiWqz6llfTQnH6I3LDzpt+6vfz+sMY3RcRAcoI0P8nGrQlPj4P+A2negGyli?= =?us-ascii?Q?swQaI5lwZ2UHJFOjivaEr7M722eRlnk3BlwZAjLcBzPLlNdkRonvcSgJih9Y?= =?us-ascii?Q?Y/mjCwENbU8VltXLXB5yjqArrzCakg7lVSUOEJ/foPZhEIytmPus+d+s/i4L?= =?us-ascii?Q?tSYnHgnI+eCsbudRjdI0bu6zaphb7cp54zGaNHaDhCfKO/hk1pOEXhK5nDG9?= =?us-ascii?Q?f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bJdCK4gvzOLrAEwcPscuysEmluCvjGpoSsgJkO16MByDWVH5geGnlhUlSRQFqJPBdQLVeo8dI4403pAnZgfrMGaXUQwq7/H00uKrXInHQuV6Ph6LY8Ht5gsAUJD2SCK1lV9gPzlMqC5DAQ8+UwsJtyPgehAmzcshbjspWeZDzWYfhqHuyomchLYQIFtwcDrXME3AbFjvyBcBenDqtpSUbWkmPKV9Ma0olgeaYZlsnCzA==;5:ZeA2wjPM3fTSp2dGzXOFdEu9I6GOD5KMfAe69k8qhiDMT3GDn4UN7u70ULqmdsIgqNgtbKpcz2+50uCH2G98kY/qgDm6pOdPJXFE5qvCGZ6TnttxhLx6Zc7Viar6ZLERheZj2SdEs4bgE99tJblcEg==;24:zLQNKU0ijQ7DbJeRAI7YBZBY8drz0a/x2/mh/bGfh006ABFaVZTyrblKvDiyPhGoozn8K3eUBF9dKxIDlRm+lDfehcy6ASLxZ5S2S2vPjhA=;7:3I6PZehpvFnBMtizR5HCVVRjifzKAKPzOtJ/ezhZ+cKXgbd7lFg1hU88SL2hMOPWX5EzosIwqW7R2P3+wn+fVy7dW5Bf9NdCFmQFuHEdVl03AOphB5RZQlEd2ulMT+5KI/tWIKXxRudo2SFe7BCPOKIwkDL4kUkxgh+KFQcCAO5ALXRnmKEX0aUMjRFAL4qIeH0qmfdhmT4JfO/GRMg07Z6y9Ukn4dK3u/S3tAGeSho= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Sep 2017 18:45:53.7581 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3825 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1810 Lines: 41 Ping? On Wed, Sep 13, 2017 at 09:08:30PM +0300, Yury Norov wrote: > 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. > -- > 2.11.0