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 X-Spam-Level: X-Spam-Status: No, score=-13.1 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 94B29C433DF for ; Wed, 12 Aug 2020 14:05:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E8F220838 for ; Wed, 12 Aug 2020 14:05:54 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="F9c86y9V" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726447AbgHLOFy (ORCPT ); Wed, 12 Aug 2020 10:05:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726434AbgHLOFx (ORCPT ); Wed, 12 Aug 2020 10:05:53 -0400 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02F6EC061383 for ; Wed, 12 Aug 2020 07:05:53 -0700 (PDT) Received: by mail-pg1-x544.google.com with SMTP id o13so1116629pgf.0 for ; Wed, 12 Aug 2020 07:05:52 -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=GXf1APQN6pFWS8w8GMXLCqte10YV/D/cYzB6ddfVpxNwV2bV39NB+VdbaqTwL+k1mI DZjhgsnccuBYrDt1404brKzeLcs/s3E7eRTPCxivHhP/44FuFbC4hnCBet4x3ZBUbotT /Fawd7i7Youc0Zv9YoAG03+YOszQuOoU9s1b9hhoHxOR7PzMxXcFkw9GCKuhSupLjqTA 0wv+qvdT9s24HasFy+k7FBNnA73rTPRJViySncGH7/qkuFWVlSvPmO4z0MfjfNdiYMnn lovLc6QUZw+vOhEF73vuA/qu1R81rBILBlTTzxPdo5gE8uFRpIeVLLO1CDiBP+7LzMml 8/CA== X-Gm-Message-State: AOAM530F5O1v/P57nddZbWess+qKPWHP5mTP3THLiSuFMNPtXii9T5Y9 XkyRpwmSRO5XHJU06/4KSQ== 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 Cc: Pingfan Liu , James Morse , Russell King , Marc Zyngier , Julien Thierry , Suzuki K Poulose , linux-doc@vger.kernel.org, linux-arm-kernel@lists.infradead.org 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 Sender: linux-doc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-doc@vger.kernel.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. -- 2.7.5 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 X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50A11C433DF for ; Wed, 12 Aug 2020 15:15:19 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id C7DBE20781 for ; Wed, 12 Aug 2020 15:15:18 +0000 (UTC) Authentication-Results: mail.kernel.org; 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 C7DBE20781 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 11B944B946; Wed, 12 Aug 2020 11:15:18 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@gmail.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YEZxO21tJopv; Wed, 12 Aug 2020 11:15:17 -0400 (EDT) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id F284F4B938; Wed, 12 Aug 2020 11:15:16 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 972EC4B82B for ; Wed, 12 Aug 2020 10:05:55 -0400 (EDT) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id GAe88euZam-N for ; Wed, 12 Aug 2020 10:05:54 -0400 (EDT) Received: from mail-pg1-f194.google.com (mail-pg1-f194.google.com [209.85.215.194]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id 7CA6B4B826 for ; Wed, 12 Aug 2020 10:05:54 -0400 (EDT) Received: by mail-pg1-f194.google.com with SMTP id p37so1109003pgl.3 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=huoloHFHZZZgwYXhlmhL+4wlJbyJnMdYqQu6VLmlQYNOSJ7TpmwineD6EAYludx8mn Al7v6VHB3YRiLMuTIX/pFtkLm5LaP33RFDn6vDWlEI+fwOZow5ggG4HP84AiOkVSfADf 965eisz0PMx2NKRazgASzX97FvWWZAb8qI8SGyJ4nBrBm+ia5IeDqJ/Mum+KKB0NX6sP dj2+ZZQneTSeQWHbJM4BAOZN3w6kNhL6YIS9JncF4HPSjGJso7yddSH1J+yiN6YJMUhW YM75Bm6w8M592ZWkIJsp4KoH4fiT7j5iF1wCJnKpb5bto5Sq8bRZhHju+X8XjZ8rk8rH lNsg== X-Gm-Message-State: AOAM531mywPFtriKnTiU1KiQ9AjCseOPIMCwjW1jX3QLFCUqAfsQlLQW O2eFNEJZ1NZCj0m+l4c7o3BHlxg= 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-Mailman-Approved-At: Wed, 12 Aug 2020 11:15:16 -0400 Cc: Marc Zyngier , linux-doc@vger.kernel.org, Russell King , Pingfan Liu , linux-arm-kernel@lists.infradead.org X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu 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. -- 2.7.5 _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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 X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6BBEC433E0 for ; Wed, 12 Aug 2020 14:07:22 +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 6FBE320838 for ; Wed, 12 Aug 2020 14:07:22 +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 6FBE320838 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+linux-arm-kernel=archiver.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-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 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 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. -- 2.7.5 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel