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,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=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 DA734C43461 for ; Thu, 3 Sep 2020 13:54:57 +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 8C46E208CA for ; Thu, 3 Sep 2020 13:54:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="EYWt3vNo"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=google.com header.i=@google.com header.b="PmRfby3h" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8C46E208CA 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:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nE4iRnWnsrYFHToZhx7iJRT6Q6teuEY+Ji1Zx5KiWOU=; b=EYWt3vNoYj4drOwm5EEaAaJos 7z26Cqc21wwd9rqxe6YUiBytd67QHXm3618xFaG/tPa9k6y9+OEyn2PKmgGLsaQVZYhZW5i2g/cAG z9NdpHr30cwGeuW/uqtV5EbHrYFILM/iDMK8dtMRKBIVGGYeja3Z0supwmYYK44kiTp+U45oMB7+l YBCv2dfw9e+1LUWqGL2YUSi+qPnPFlmh5wWYdq/WrfqeOa6Tm8vP5UavwGHgw6FI/Apcxll3suor/ FgQvnLplYpNB75nJtxXdANNa0dcvtfWm3KeyBoTXvfYereoG1wJGMMGohiXppbMRBDABPaQL4zgoq 8ziA1mQYg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpg7-0001xm-Cs; Thu, 03 Sep 2020 13:53:27 +0000 Received: from mail-qt1-x84a.google.com ([2607:f8b0:4864:20::84a]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kDpg0-0001tp-32 for linux-arm-kernel@lists.infradead.org; Thu, 03 Sep 2020 13:53:22 +0000 Received: by mail-qt1-x84a.google.com with SMTP id c5so2154828qtd.12 for ; Thu, 03 Sep 2020 06:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=HMI50EVPzeYiaF7m1ikQ30B81RDqMtBiHFE/tVtsY8s=; b=PmRfby3hXid6gZ4VJt7FioQeg5+3eK9LDh3RE5BDeL2Hb7r3AjGS1aJzm9ov5o4S6x 2sRRMrQ+1rbi/H7LLAKK8XACU734J58OA4r3vTTkfGy3SzH/pHJ5T8LWFudF5XP/0bBL 2144S/NI+nUCyrTBwIhFLNfUybR5Wp0YYBQH1HazGExBTF8vcRkKFPJPLtYuEwU3L7Nc iaXV9YNP0NNYcCF/FDgUgaFYN7s2TrHL5AxIwyPJs3zMrhymXYuFR+kt86kX1GLnZzEu jUn5uBk71CsKViI48sIFYb4WPpFNYz61DeL3Wem6Nd9ne9z2VD36MWTs60rINOBY7hv0 VJZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=HMI50EVPzeYiaF7m1ikQ30B81RDqMtBiHFE/tVtsY8s=; b=YIO8QX775igyXMl8xrfK8jT+CuLSzIRJ04E3bGVXqUI55sSydk2+MayUt21DFnlNRI CUBAk4WSXJscUgUNDRDFceYidGaTwbA85Rn0RUVZeQUiPRWptfoQsT6aJgVAO8f6tG70 CYf8eQRyy0HySFljWcUlvK8EhfDShkQLOxEr/YRQbehH4GgyguXzVd+k4LK9CmdjXn47 6x84jsVLahsaxnWokkIw/9mYLI0/UiCU65RAvtE3UAP3yNQeOJETxuJL1RiI5+iaqiur 8RRsT6vHb7W7whnT+6jBQGTC1P7RdykPftOjD9Em5SiRAR39VECsFfLl8eO1FiaEluYt Q+ug== X-Gm-Message-State: AOAM530ES8CwOEbvQ/JrIRSpLjIldErvDZhFWRZ7uDcuzRZ4G8r76zrH 3xCTnbR3vVIgUwYrJdY/1zGlx4K6Xhg= X-Google-Smtp-Source: ABdhPJzGm97exg9+3Wae5DvDYOFZq8/kUwYyaJUF8OCkpkjtBu4H5CebmamII8OZ8XG1lG3ex60/Bqb09Lg= X-Received: from ascull.lon.corp.google.com ([2a00:79e0:d:109:4a0f:cfff:fe4a:6363]) (user=ascull job=sendgmr) by 2002:a0c:e892:: with SMTP id b18mr1984087qvo.5.1599141196120; Thu, 03 Sep 2020 06:53:16 -0700 (PDT) Date: Thu, 3 Sep 2020 14:52:51 +0100 In-Reply-To: <20200903135307.251331-1-ascull@google.com> Message-Id: <20200903135307.251331-3-ascull@google.com> Mime-Version: 1.0 References: <20200903135307.251331-1-ascull@google.com> X-Mailer: git-send-email 2.28.0.402.g5ffc5be6b7-goog Subject: [PATCH v3 02/18] KVM: arm64: Remove hyp_panic arguments From: Andrew Scull To: kvmarm@lists.cs.columbia.edu X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200903_095320_204455_501FB82A X-CRM114-Status: GOOD ( 13.31 ) 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: linux-arm-kernel@lists.infradead.org, kernel-team@android.com, suzuki.poulose@arm.com, maz@kernel.org, Sudeep Holla , james.morse@arm.com, Andrew Scull , catalin.marinas@arm.com, will@kernel.org, julien.thierry.kdev@gmail.com 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_panic is able to find all the context it needs from within itself so remove the argument. The __hyp_panic wrapper becomes redundant so is also removed. Signed-off-by: Andrew Scull --- arch/arm64/include/asm/kvm_hyp.h | 2 +- arch/arm64/kvm/hyp/hyp-entry.S | 7 +------ arch/arm64/kvm/hyp/include/hyp/switch.h | 4 +--- arch/arm64/kvm/hyp/nvhe/switch.c | 4 +++- arch/arm64/kvm/hyp/vhe/switch.c | 4 +++- 5 files changed, 9 insertions(+), 12 deletions(-) diff --git a/arch/arm64/include/asm/kvm_hyp.h b/arch/arm64/include/asm/kvm_hyp.h index 46689e7db46c..3de99b323061 100644 --- a/arch/arm64/include/asm/kvm_hyp.h +++ b/arch/arm64/include/asm/kvm_hyp.h @@ -89,7 +89,7 @@ void deactivate_traps_vhe_put(void); u64 __guest_enter(struct kvm_vcpu *vcpu, struct kvm_cpu_context *host_ctxt); -void __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt); +void __noreturn hyp_panic(void); #ifdef __KVM_NVHE_HYPERVISOR__ void __noreturn __hyp_do_panic(unsigned long, ...); #endif diff --git a/arch/arm64/kvm/hyp/hyp-entry.S b/arch/arm64/kvm/hyp/hyp-entry.S index 46b4dab933d0..9cb3fbca5d79 100644 --- a/arch/arm64/kvm/hyp/hyp-entry.S +++ b/arch/arm64/kvm/hyp/hyp-entry.S @@ -210,12 +210,7 @@ SYM_FUNC_START(__hyp_do_panic) SYM_FUNC_END(__hyp_do_panic) #endif -SYM_CODE_START(__hyp_panic) - get_host_ctxt x0, x1 - b hyp_panic -SYM_CODE_END(__hyp_panic) - -.macro invalid_vector label, target = __hyp_panic +.macro invalid_vector label, target = hyp_panic .align 2 SYM_CODE_START(\label) b \target diff --git a/arch/arm64/kvm/hyp/include/hyp/switch.h b/arch/arm64/kvm/hyp/include/hyp/switch.h index 0864f88bc840..96ea3fdd0c20 100644 --- a/arch/arm64/kvm/hyp/include/hyp/switch.h +++ b/arch/arm64/kvm/hyp/include/hyp/switch.h @@ -510,13 +510,11 @@ static inline void __set_host_arch_workaround_state(struct kvm_vcpu *vcpu) static inline void __kvm_unexpected_el2_exception(void) { unsigned long addr, fixup; - struct kvm_cpu_context *host_ctxt; struct exception_table_entry *entry, *end; unsigned long elr_el2 = read_sysreg(elr_el2); entry = hyp_symbol_addr(__start___kvm_ex_table); end = hyp_symbol_addr(__stop___kvm_ex_table); - host_ctxt = &__hyp_this_cpu_ptr(kvm_host_data)->host_ctxt; while (entry < end) { addr = (unsigned long)&entry->insn + entry->insn; @@ -531,7 +529,7 @@ static inline void __kvm_unexpected_el2_exception(void) return; } - hyp_panic(host_ctxt); + hyp_panic(); } #endif /* __ARM64_KVM_HYP_SWITCH_H__ */ diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c index 3c9c065b3264..1e8a31b7c94c 100644 --- a/arch/arm64/kvm/hyp/nvhe/switch.c +++ b/arch/arm64/kvm/hyp/nvhe/switch.c @@ -242,11 +242,13 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) return exit_code; } -void __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt) +void __noreturn hyp_panic(void) { u64 spsr = read_sysreg_el2(SYS_SPSR); u64 elr = read_sysreg_el2(SYS_ELR); u64 par = read_sysreg(par_el1); + struct kvm_cpu_context *host_ctxt = + &__hyp_this_cpu_ptr(kvm_host_data)->host_ctxt; struct kvm_vcpu *vcpu = host_ctxt->__hyp_running_vcpu; unsigned long str_va; diff --git a/arch/arm64/kvm/hyp/vhe/switch.c b/arch/arm64/kvm/hyp/vhe/switch.c index 6636522a8529..835c2dfc7a9f 100644 --- a/arch/arm64/kvm/hyp/vhe/switch.c +++ b/arch/arm64/kvm/hyp/vhe/switch.c @@ -208,8 +208,10 @@ static void __hyp_call_panic(u64 spsr, u64 elr, u64 par, } NOKPROBE_SYMBOL(__hyp_call_panic); -void __noreturn hyp_panic(struct kvm_cpu_context *host_ctxt) +void __noreturn hyp_panic(void) { + struct kvm_cpu_context *host_ctxt = + &__hyp_this_cpu_ptr(kvm_host_data)->host_ctxt; u64 spsr = read_sysreg_el2(SYS_SPSR); u64 elr = read_sysreg_el2(SYS_ELR); u64 par = read_sysreg(par_el1); -- 2.28.0.402.g5ffc5be6b7-goog _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel