From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D4EACC38A2D for ; Thu, 27 Oct 2022 09:17:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234902AbiJ0JRL (ORCPT ); Thu, 27 Oct 2022 05:17:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53958 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235376AbiJ0JQ4 (ORCPT ); Thu, 27 Oct 2022 05:16:56 -0400 Received: from mail-pj1-x1035.google.com (mail-pj1-x1035.google.com [IPv6:2607:f8b0:4864:20::1035]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEAEC4BD24 for ; Thu, 27 Oct 2022 02:16:40 -0700 (PDT) Received: by mail-pj1-x1035.google.com with SMTP id m2so943287pjr.3 for ; Thu, 27 Oct 2022 02:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-ntu-edu-tw.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Y0jwfzDPpiiIA6G13h9XyMG8TS+aWs3VsgaKFJG4r/Y=; b=VdH5bBMbuaoLKAdZotjR+kRjpk0oZGv9hrkl9h8A1KXDH/zF2a2KjFmyUrMxaStb29 OyM0t531gOXJxVZxcFvVpf+ikh/UTgH8jszdO9mTAXfGLrTm5K83EJ01xVDx/dH+21OT wPBqotTm8VEsHI+4Awayn7e/oFkQCmr6F8VVbfwvBEJnqxyz6fWjo5aJ3df/mEpFIlQI DqdG6aC4WjX3SaEKNbjoEkK7BI7vOq1S4KrtFYB2XT0pZs3JndlEEPjv17XnDosPvHWc VjY/MloT7ayanxfnaXkjo3bFpNcvKlSDIhSyOWgdfC3yluP02Ul6H15CxjCLHvklufr6 kb2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y0jwfzDPpiiIA6G13h9XyMG8TS+aWs3VsgaKFJG4r/Y=; b=I81TZNaqnmv5x2VVvvopFA6AfZ3LQsPDxUQjMo7/F5dXO8ISyboHoRDFXhhljVe337 B5Zo7f/sbuC6FoEvARg7JAYHq+coWl7jOnSMAGfnmLSXPChUTEdk18jH4SYJZIkPIRZo pCBx9ndIQ/r/T3rIx9I8Ruya1jsfohDqgGcsHfB0dMWzqBd3h6ZdhpAe6ra082JFOWNE CeFIAVk/CYfqujoDVYc+1H7dKJ2ZRq3BYjyrZ/rU6YiSpSZGwBdpnY663G8I7GrPJxgC evAGCdgJ9amOSLmy6cqIGFeKtolGAIM5buNDuRjvwPW8YzYAHlVr5kzW/dYpzq2N000b Hodg== X-Gm-Message-State: ACrzQf3d5/Dzbrss36rhGR5MWqJJ0OVWDvyiXleFEukGFQ80Df4m/Ndr yZti2RgeEvAlC4XWmotZ48hKjXqPqnodKFHhz0IxP8eU1lEJaIDeFjHvjer9sMocoT//jxgAT8t dEkk5hzePXKHB/KFCEv+Da+Dtg8xMJMw63G8tvmtOTSuolzijARyUI6401U7zGi5HBtQmFjBilS fQTuZqU6jaxXKBZwom8K+2ODjbKzE= X-Google-Smtp-Source: AMsMyM4aHQAm15VDE1/vKTcXNEmcnXBX2pjTWeY3+FHq6p29Ayj+aYLyA1TFLyvsRWVx1l2oc2LxaQ== X-Received: by 2002:a17:902:b90b:b0:186:8a4d:d4b7 with SMTP id bf11-20020a170902b90b00b001868a4dd4b7mr26808587plb.129.1666862199646; Thu, 27 Oct 2022 02:16:39 -0700 (PDT) Received: from rhythm-ZenBook-UX425EA-UX425EA.csie.ntu.edu.tw (114-45-31-164.dynamic-ip.hinet.net. [114.45.31.164]) by smtp.gmail.com with ESMTPSA id b11-20020a1709027e0b00b00178650510f9sm721113plm.160.2022.10.27.02.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 02:16:39 -0700 (PDT) From: Wei-Lin Chang To: maz@kernel.org Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Wei-Lin Chang Subject: [PATCH] KVM: arm64: Update comment of create_hyp_mappings Date: Thu, 27 Oct 2022 17:15:23 +0800 Message-Id: <20221027091523.139598-1-r09922117@csie.ntu.edu.tw> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Gm-Spam: 0 X-Gm-Phishy: 0 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org HYP_PAGE_OFFSET is removed since 4.8, and the method for generating Hyp VAs has evolved. Update the functional description of create_hyp_mappings accordingly. Signed-off-by: Wei-Lin Chang --- arch/arm64/kvm/mmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index c9a13e487..a9ae4a3f9 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -424,9 +424,10 @@ void kvm_unshare_hyp(void *from, void *to) * @to: The virtual kernel end address of the range (exclusive) * @prot: The protection to be applied to this range * - * The same virtual address as the kernel virtual address is also used - * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying - * physical pages. + * The Hyp virtual address is generated by masking the kernel VA with + * va_mask then inserting tag_val for the higher bits starting from + * tag_lsb. See kvm_compute_layout() in va_layout.c for more info. + * Both Hyp VA and kernel VA ranges map to the same underlying physical pages. */ int create_hyp_mappings(void *from, void *to, enum kvm_pgtable_prot prot) { -- 2.34.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BC5F3C38A2D for ; Thu, 27 Oct 2022 10:31:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=BN2DqQXI41TOY4cQ4gtG29Agn7ab1lLwKi4EVj0SLRo=; b=q/fDZu/b0sflVY gbDEkGaiyysvPZllX/wlpErQFu3RPjrcxCIiuqK3B+s4itIrZ1qJ16wLUoOeUNeOYkoKL5DGBMBl0 KG3wVNi9HTBiBhJzrPsYghvbTB1r6Nqm8meByhvU4zgdTnCCqHXXAKQM6me5oWRh2vkEEfLiMsa6X y6bi6ZygeYCQFRBUaFqW/wZozEEZ/YRTvCeA50oAOwuKQ0PB3j/5QeKSC2JDR5idsKaco+dDAmQp1 xK5yXpD+EahDLfbPv7Zf6VW5fTiMPKftsxeWcsH2RnpAxb1+E6QphcQRRbAIzrbpn8sAgoJftYFae yfDv4y+yuVAACYaZUWpQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oo09t-00CrPC-3i; Thu, 27 Oct 2022 10:30:45 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1onz0J-00CZQm-VD for linux-arm-kernel@lists.infradead.org; Thu, 27 Oct 2022 09:16:50 +0000 Received: by mail-pl1-x62a.google.com with SMTP id l2so780488pld.13 for ; Thu, 27 Oct 2022 02:16:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=csie-ntu-edu-tw.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Y0jwfzDPpiiIA6G13h9XyMG8TS+aWs3VsgaKFJG4r/Y=; b=VdH5bBMbuaoLKAdZotjR+kRjpk0oZGv9hrkl9h8A1KXDH/zF2a2KjFmyUrMxaStb29 OyM0t531gOXJxVZxcFvVpf+ikh/UTgH8jszdO9mTAXfGLrTm5K83EJ01xVDx/dH+21OT wPBqotTm8VEsHI+4Awayn7e/oFkQCmr6F8VVbfwvBEJnqxyz6fWjo5aJ3df/mEpFIlQI DqdG6aC4WjX3SaEKNbjoEkK7BI7vOq1S4KrtFYB2XT0pZs3JndlEEPjv17XnDosPvHWc VjY/MloT7ayanxfnaXkjo3bFpNcvKlSDIhSyOWgdfC3yluP02Ul6H15CxjCLHvklufr6 kb2A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y0jwfzDPpiiIA6G13h9XyMG8TS+aWs3VsgaKFJG4r/Y=; b=OhiNu7ylFFgR6hy9/xw9DQuTFU/8Z2j552xbVSyQC4cRx/G/c0QUsPiYNz9UtjedGl GoI046mQqqjLw03W3sd9wMtBnCUbi55F0TxVSwOMjr5Nf9ICGUowrMi4BS8+o3S0kKx6 O3Ndy+bbF3DAoam3NakUFt8Zq4KnBUl25mFPd1rCZzUP+A+I2UOnhEbNHba1kCpHypbR 8+LWpKJKIR2LOrKOSfqwvtz7eS9LLGgk8unxA5Xcjqk5hLxcl353xohnolALBkatsUrX Q7nh/05DtP8LVkvT2ZwyYtl+F6uIM1fI5WYC6Ez6Ya41DjIy+wzXYFbYMbdULwDfw1o3 x9ew== X-Gm-Message-State: ACrzQf22qdyNEbjp2XihpWRgsyWwfP8kGKT3XAOa+GNUsgQDsuQ39A8X yIIGm+149eKEnDUiu210DbyH6v8G0HsC/WcoSt1nfBMKj1RGTejtYhyFn0HMNANBGya9exVxEk7 ltCchg8Rwrjtx6qibyg0YPq3YaTX7+AOg8E9HbOL4pDVyiiHR1zIGVIibLD/4UF4Jo7F9KHETEt RQbaFl9ALW9Ir6LRXgBo+a+A+Ojr20s8CVOKNpaw== X-Google-Smtp-Source: AMsMyM4aHQAm15VDE1/vKTcXNEmcnXBX2pjTWeY3+FHq6p29Ayj+aYLyA1TFLyvsRWVx1l2oc2LxaQ== X-Received: by 2002:a17:902:b90b:b0:186:8a4d:d4b7 with SMTP id bf11-20020a170902b90b00b001868a4dd4b7mr26808587plb.129.1666862199646; Thu, 27 Oct 2022 02:16:39 -0700 (PDT) Received: from rhythm-ZenBook-UX425EA-UX425EA.csie.ntu.edu.tw (114-45-31-164.dynamic-ip.hinet.net. [114.45.31.164]) by smtp.gmail.com with ESMTPSA id b11-20020a1709027e0b00b00178650510f9sm721113plm.160.2022.10.27.02.16.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Oct 2022 02:16:39 -0700 (PDT) From: Wei-Lin Chang To: maz@kernel.org Cc: james.morse@arm.com, alexandru.elisei@arm.com, suzuki.poulose@arm.com, oliver.upton@linux.dev, catalin.marinas@arm.com, will@kernel.org, linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org, Wei-Lin Chang Subject: [PATCH] KVM: arm64: Update comment of create_hyp_mappings Date: Thu, 27 Oct 2022 17:15:23 +0800 Message-Id: <20221027091523.139598-1-r09922117@csie.ntu.edu.tw> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Gm-Spam: 0 X-Gm-Phishy: 0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221027_021648_241543_5159EDA7 X-CRM114-Status: GOOD ( 11.40 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org HYP_PAGE_OFFSET is removed since 4.8, and the method for generating Hyp VAs has evolved. Update the functional description of create_hyp_mappings accordingly. Signed-off-by: Wei-Lin Chang --- arch/arm64/kvm/mmu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c index c9a13e487..a9ae4a3f9 100644 --- a/arch/arm64/kvm/mmu.c +++ b/arch/arm64/kvm/mmu.c @@ -424,9 +424,10 @@ void kvm_unshare_hyp(void *from, void *to) * @to: The virtual kernel end address of the range (exclusive) * @prot: The protection to be applied to this range * - * The same virtual address as the kernel virtual address is also used - * in Hyp-mode mapping (modulo HYP_PAGE_OFFSET) to the same underlying - * physical pages. + * The Hyp virtual address is generated by masking the kernel VA with + * va_mask then inserting tag_val for the higher bits starting from + * tag_lsb. See kvm_compute_layout() in va_layout.c for more info. + * Both Hyp VA and kernel VA ranges map to the same underlying physical pages. */ int create_hyp_mappings(void *from, void *to, enum kvm_pgtable_prot prot) { -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel