From patchwork Wed Aug 12 14:05:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11710879 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2F20B174A for ; Wed, 12 Aug 2020 14:06:14 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 02C9120885 for ; Wed, 12 Aug 2020 14:06:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Wj2Or577"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F9c86y9V" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 02C9120885 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:MIME-Version:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-Id:Date:Subject: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=IM7WPILuvILGEmQpnG2t+Ws5WBFTyQEa5f5jpLq22vc=; b=Wj2Or577ZvPEhJcVCBdToa9NWI cQhad2DZ97402lnkVu3tApygR+nmgTXoBI5XsXUrxjHOqAI/O8Vjfd1bx6tF8eXNBqO3jw/pB2w5/ HjhLxg6tJpYJ9FPx8oo7CGOhoEPGbZcKeUm4WBNRL+rmFlHeTZPUkF71pGSnvY1xv6ZJBYXztf4XL rPKESwj1q0j4PYnkHjyu/hCePruPUiIchgsHmnC35frt3G3P9l3V53D9g4aodgzt9+eZ/b0q00TWR zvidHVBVKpAV7Hw/PzSIFYMWlikyfo6Zrb8kvnzUW8jClVVxdClhRHFyIAGQrVC8+iAhvHzx2/cBA Ntz3ubbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5rOA-0000YI-N0; Wed, 12 Aug 2020 14:05:58 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5rO7-0000Xc-VZ for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2020 14:05:56 +0000 Received: by mail-pf1-x442.google.com with SMTP id x25so1089513pff.4 for ; Wed, 12 Aug 2020 07:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Xd1JlhTQ+LLGkrxsiKUO3U1+DIxkbudA+7Iwr86BTU8=; b=F9c86y9VswsM0NUf74FtnnPIbwPvAQ9av1nET9wLixxZPMGcbjwrXQwXFtMX/zXngK SmteOy/Xapx4/roJdflzP4wkNi00uU+YCs5Fs17iom5qqsxoXJ3xszwJWsw4WZ5BTOtV vy3ecI9Xaep4Lctmf9PAETCTd5OGNtr2uXBjLD3m1Qf8dl4CO6h8ZaH30apV0dAYDE3G yj2BopxwB8J2ijJ5U1Iloe4L0UBBeadKBVq4avns03hDMvpeRdM0+jVZVFrhKhTkCnrZ v6OykPd4DwMDrN9nASoykO+ynV4Tyh87qnchtdZxqSmHOpMRFVvSXNyCZpbraJAzoi4H OnfA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Xd1JlhTQ+LLGkrxsiKUO3U1+DIxkbudA+7Iwr86BTU8=; b=nw5q3OUSxLtBM49b/SHpSqFog7Acjt3CqkcB4XIwjCMzB/bY6RI9JTTSmCl0ES7kSP T5bNBxMtfNaimmC/mPRNbYSrJoY/eKo4wSS6unJnq7UKjSQXEWC3zZUrhrMzfKSvVNaV 3MsBY+rUonGcVZbofkoWSRgOIZSiH6QiRlF8ioLJiL6VBzX2DN/dhF4Pd4IsPh2DLCis bWq8a7Ei9kPhm5Ds6aKQHRz8IFv2KIy7S3l9D1SafnjEbSiNO3RUCbmQiCXfhxAysQP1 oQzoU4rq+N3XncssLzLLHEzt287xqDyME6t8NxRFYIRIozO+PcLqF8tXKP21x00KOpcb 7a1A== X-Gm-Message-State: AOAM530qPfKCetqQixVFeK7+a2UU9RkPILiZCamwG5Ls/2Ig2Qr6ldXh t52dgLP8Sl+ZcMDR998Vng== X-Google-Smtp-Source: ABdhPJxqZMYDPp3Rjza7Lj0jActSfJ6DzFH8hI5Qkgg6uv/KnZxmirsVuHYk65hKLNQ8yYsyIzjrTA== X-Received: by 2002:a62:8081:: with SMTP id j123mr11569824pfd.80.1597241152533; Wed, 12 Aug 2020 07:05:52 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id s22sm2711033pfh.16.2020.08.12.07.05.48 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Aug 2020 07:05:51 -0700 (PDT) From: Pingfan Liu To: kvmarm@lists.cs.columbia.edu Subject: [PATCH] arm(64)/kvm: improve the documentation about HVC calls Date: Wed, 12 Aug 2020 22:05:33 +0800 Message-Id: <1597241133-3630-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200812_100556_031896_AA0619A8 X-CRM114-Status: GOOD ( 13.16 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [kernelfans[at]gmail.com] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Suzuki K Poulose , Marc Zyngier , linux-doc@vger.kernel.org, Russell King , Pingfan Liu , James Morse , linux-arm-kernel@lists.infradead.org, Julien Thierry MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Both arm and arm64 kernel entry point have the following prerequisite: MMU = off, D-cache = off, I-cache = dont care. HVC_SOFT_RESTART call should meet this prerequisite before jumping to the new kernel. Furthermore, on arm64, el2_setup doesn't set I+C bits and keeps EL2 MMU off, and KVM resets them when its unload. These are achieved by HVC_RESET_VECTORS call. Improve the document. Signed-off-by: Pingfan Liu Cc: James Morse Cc: Russell King Cc: Marc Zyngier Cc: Julien Thierry Cc: Suzuki K Poulose Cc: linux-doc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org To: kvmarm@lists.cs.columbia.edu --- Documentation/virt/kvm/arm/hyp-abi.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Documentation/virt/kvm/arm/hyp-abi.rst b/Documentation/virt/kvm/arm/hyp-abi.rst index d9eba93..a95bc30 100644 --- a/Documentation/virt/kvm/arm/hyp-abi.rst +++ b/Documentation/virt/kvm/arm/hyp-abi.rst @@ -40,9 +40,9 @@ these functions (see arch/arm{,64}/include/asm/virt.h): * :: - r0/x0 = HVC_RESET_VECTORS + x0 = HVC_RESET_VECTORS (arm64 only) - Turn HYP/EL2 MMU off, and reset HVBAR/VBAR_EL2 to the initials + Disable HYP/EL2 MMU and D-cache, and reset HVBAR/VBAR_EL2 to the initials stubs' exception vector value. This effectively disables an existing hypervisor. @@ -54,7 +54,7 @@ these functions (see arch/arm{,64}/include/asm/virt.h): x3 = x1's value when entering the next payload (arm64) x4 = x2's value when entering the next payload (arm64) - Mask all exceptions, disable the MMU, move the arguments into place + Mask all exceptions, disable the MMU and D-cache, move the arguments into place (arm64 only), and jump to the restart address while at HYP/EL2. This hypercall is not expected to return to its caller.