Message ID | 20201116204318.63987-19-dbrazdil@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <SRS0=N9fY=EW=lists.infradead.org=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@kernel.org> 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.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,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 4644FC63697 for <linux-arm-kernel@archiver.kernel.org>; Mon, 16 Nov 2020 22:27:53 +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 C87FA20E65 for <linux-arm-kernel@archiver.kernel.org>; Mon, 16 Nov 2020 22:27:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A4Mjksxx"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="uvtq0SJM" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C87FA20E65 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.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:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: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:List-Owner; bh=FOkwyMt4g7vdqbhZSxxr8/+PIrKWpWYQiEo0JKjKxwI=; b=A4MjksxxY1/NVOR8k4Iz6GkBa FQajJD5ohObzOt+MBl5qxZ5hNO81ez9z5PzpZdOiFofl4sGPpvA0xFf51QEXudMwYR93FgeovHhvO gxXqxPzLfJh/WgdvCLlvdLZYSdlY4r/sWqsALxgekhJI1F7gxeyZrKrmnC0ydwbUrBNJ8HtZR3iGK BX9xCv1rSOt11vQxiaZinco/+IKWwq9kBPq/C0Qm6GkhBW3euRYo/rLTRrVc9KFcSH2z1umERopmJ F4QoS01/Csc/m9ZlBH4FRjuEtWG2Xcm40Ite4UfV0s462ymYhJAY5bCryM+5VDOMKRj38j5bzlHtw tZWMii/wA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kelPU-00013V-39; Mon, 16 Nov 2020 20:47:36 +0000 Received: from mail-wm1-x342.google.com ([2a00:1450:4864:20::342]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kelM2-0007pO-LF for linux-arm-kernel@lists.infradead.org; Mon, 16 Nov 2020 20:44:06 +0000 Received: by mail-wm1-x342.google.com with SMTP id p22so593986wmg.3 for <linux-arm-kernel@lists.infradead.org>; Mon, 16 Nov 2020 12:44:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xKNCvRo+cWBEwv+iG/MqOVO9vnc8V12glB7ZKcx5VKU=; b=uvtq0SJM5qXrnU0ME9zmBaFSQlas8lUR7tXAjYQxsKCnU6Mv96yccWofgGjWu+D1mh mWB1poN3vE8wxaPrJkGniVj8DLW7wtyKzrW7pB0S2nrlEW7mmubhnTLbq12562XJlBnS NqyXt56AkUb0nSpz1xXjKNLpTQH/grHJMSQnDMLeFaQdzTuCAXGjfX1R50mMBgpmT8vN c+p8mqjYRZVp/LLUZS8+VAl+5VlGbGx+dETtuUiK5ziqTTCDt5AmCF5XhZcF1NsSuQyb KLASGz2sR/NGVL3uSGy4PgyqPt60UjINx4oNeJ69y4LjYxz+AgSt1IHhCe1qEiq1j7QD Pcxg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xKNCvRo+cWBEwv+iG/MqOVO9vnc8V12glB7ZKcx5VKU=; b=EaDPMQaaoPCky7oajRgQkdseQq5OHCNhHtInOncdNqgTMb4QN70Za3iK2foft915RO C122AhqLXIb14fxparX5RnrSIPwZIwBpzggUb16Y981qK2W9c7w/mv/G1EX5t6sckJqL qFONGeYP0eXD9wRojX0Oz2YLcb7iV9VZooZ8cAu/w2BvwdohUmoJxCp8mwRWdxEeSK7Y JMkJ0FeRXyMN2S0A/DrC1m8KY9ioYhLlMsVU0/rj2vw++IWG0fXEef78dfkBIN7PdAdG gak6I/xePnaHGKqmVtWbceC/AJvzKj8CMQa537EDe8Np0E4z7xygggRV1L17ef/S0F2k psug== X-Gm-Message-State: AOAM530sHZ7HLxqzwikmdgNzM0crcl1XCmq7UB/c/sDA1ZtUXPztkhLJ Uuhokiu7IS2kheANdG46/+wHAA== X-Google-Smtp-Source: ABdhPJyIANBejihi3jGdjfX3z634hE2xrtyZytrb2OvyN3PLZZcUButBGlO29at3MIhqZkdG/pkKGA== X-Received: by 2002:a1c:bd0b:: with SMTP id n11mr718274wmf.111.1605559441419; Mon, 16 Nov 2020 12:44:01 -0800 (PST) Received: from localhost ([2a01:4b00:8523:2d03:bc40:bd71:373a:1b33]) by smtp.gmail.com with ESMTPSA id 18sm557066wmo.3.2020.11.16.12.44.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 16 Nov 2020 12:44:00 -0800 (PST) From: David Brazdil <dbrazdil@google.com> To: kvmarm@lists.cs.columbia.edu Subject: [PATCH v2 18/24] kvm: arm64: Add function to enter host from KVM nVHE hyp code Date: Mon, 16 Nov 2020 20:43:12 +0000 Message-Id: <20201116204318.63987-19-dbrazdil@google.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201116204318.63987-1-dbrazdil@google.com> References: <20201116204318.63987-1-dbrazdil@google.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201116_154402_821083_DB26D29E X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Cc: Mark Rutland <mark.rutland@arm.com>, kernel-team@android.com, Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>, Andrew Walbran <qwandor@google.com>, Suzuki K Poulose <suzuki.poulose@arm.com>, Marc Zyngier <maz@kernel.org>, Quentin Perret <qperret@google.com>, linux-kernel@vger.kernel.org, James Morse <james.morse@arm.com>, linux-arm-kernel@lists.infradead.org, Catalin Marinas <catalin.marinas@arm.com>, Tejun Heo <tj@kernel.org>, Dennis Zhou <dennis@kernel.org>, Christoph Lameter <cl@linux.com>, David Brazdil <dbrazdil@google.com>, Will Deacon <will@kernel.org>, Julien Thierry <julien.thierry.kdev@gmail.com>, Andrew Scull <ascull@google.com> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org |
Series |
Opt-in always-on nVHE hypervisor
|
expand
|
diff --git a/arch/arm64/kvm/hyp/nvhe/host.S b/arch/arm64/kvm/hyp/nvhe/host.S index 52dae5cd5a28..170d6f6376ae 100644 --- a/arch/arm64/kvm/hyp/nvhe/host.S +++ b/arch/arm64/kvm/hyp/nvhe/host.S @@ -41,6 +41,7 @@ SYM_FUNC_START(__host_exit) bl handle_trap /* Restore host regs x0-x17 */ +__host_enter_restore_full: ldp x0, x1, [x29, #CPU_XREG_OFFSET(0)] ldp x2, x3, [x29, #CPU_XREG_OFFSET(2)] ldp x4, x5, [x29, #CPU_XREG_OFFSET(4)] @@ -63,6 +64,14 @@ __host_enter_without_restoring: sb SYM_FUNC_END(__host_exit) +/* + * void __noreturn __host_enter(struct kvm_cpu_context *host_ctxt); + */ +SYM_FUNC_START(__host_enter) + mov x29, x0 + b __host_enter_restore_full +SYM_FUNC_END(__host_enter) + /* * void __noreturn __hyp_do_panic(bool restore_host, u64 spsr, u64 elr, u64 par); */
All nVHE hyp code is currently executed as handlers of host's HVCs. This will change as nVHE starts intercepting host's PSCI CPU_ON SMCs. The newly booted CPU will need to initialize EL2 state and then enter the host. Add __host_enter function that branches into the existing host state-restoring code after the trap handler would have returned. Signed-off-by: David Brazdil <dbrazdil@google.com> --- arch/arm64/kvm/hyp/nvhe/host.S | 9 +++++++++ 1 file changed, 9 insertions(+)