From patchwork Thu Jan 28 17:38:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Quentin Perret X-Patchwork-Id: 12054281 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=-17.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,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 DE1B6C433E0 for ; Thu, 28 Jan 2021 17:40:27 +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 9CF8064DD8 for ; Thu, 28 Jan 2021 17:40:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9CF8064DD8 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:Mime-Version:Message-Id:Date: 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=wI/IfMBWGSX10Ab5t/awadoNJghOD2kGP7FkTImxWKw=; b=FH/6e3iFJdrzsXNBenHB71ccuJ G+P6QxpaLLuoU3HRd1FNvyyo1yVMbaqBqSC9aPS4o4m90A+D9wpQP225h4TEKc1GeFMz0dCqZU/lk G8HAzDh5VntyUFhm7H2wFqyooS7JmoGXrlPVZnzU92cRBejvXiPCOQ5VWZlkgrZS+pJspjzk6W7Jx 76GN8iiy2yD0OwdrdM21vuAGKrWZzDr3CI2sW6qWRsUIKhj/l3gvcUVPSqDgnqT3zcuUeBXqX3wpK MBW5+56YLrz/pDfVVCBAEX+gkoyCXdvP1YzzZfhAyrXlYYK1pYq9dADejC0REEBCndDYDOrHZcumC Zw5V9DHw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5BFy-0005Xe-KD; Thu, 28 Jan 2021 17:38:58 +0000 Received: from mail-ej1-x649.google.com ([2a00:1450:4864:20::649]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l5BFx-0005X5-0B for linux-arm-kernel@lists.infradead.org; Thu, 28 Jan 2021 17:38:57 +0000 Received: by mail-ej1-x649.google.com with SMTP id b18so2515348ejz.6 for ; Thu, 28 Jan 2021 09:38:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:message-id:mime-version:subject:from:to:cc; bh=TrahohdnGnkFNIlzsxT0lt2fKHMsEEWPsWhwzs4awt8=; b=uukTJK9rp794K+uk3CI4kYPX+Mu1VkRgFU3Nkz0UD6J51DW9OqWQHkIlADcKrO8NDC PfYfKMwHHla4Yxj07UL1oI5BN32BuvvgAslyhCF0Ky+oDyYXLefeZ5zckX6jiYHKGM8C lY+jXTTQGzTjfd5qAnfeiE4ueO4TjhSY69iOz7yHDZBv1tF+1ketzX8IWxCt/WDO5EW8 5r1sOEUl+wYEsmXlC0Rvj+Fj3++dhKjrCXvWBszTSxRJm8Omqb62yoLDX1v6R1Ws66OQ /GmOQ7B5A5q4BqFu9EsVM82Hi1nVhuKY7oupMhhaMVCKL/IrtcUcWxauxqna7xkVy4Gy qSZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:message-id:mime-version:subject:from :to:cc; bh=TrahohdnGnkFNIlzsxT0lt2fKHMsEEWPsWhwzs4awt8=; b=FEG/RgOUeerw78ySGxBLZ3O9fA2faIOpLhCChCxNz5wRCZOX3ffZwFGF0qcGqG8iIp nLt59O9ijoHfrhrur/PUT+lkCu95p/C00T1DGuK1ifb6jn5RxEy1wL0fJcgagVOPmCd8 zbr2dUFeRTXtUi79MhZZ1vKKfXbYwkasctANXQZD/0PdbDWm3n7Zf2hnwfNas4nHj0Sh EXH39oOH7RUlCMe8/Gen0rpGo/pzNXLp/ILxy7mxWSzF0Zdb3IqNOaQLYfMZ7WSvR98t SMZuMkQMXPpZdRwHo/Lck3uAlnTrOOR5le7hGe7IQs8kFbz4cjinaZrSGVBEXHUDvmT9 irrA== X-Gm-Message-State: AOAM531MLP5enWPw65Qi3sxR8T1mtmIw3o/vfIcg/XQrmhYhg9rmu7tn pcab63j2fLxTKMYgPwTjAE3o0Tq1eY8T X-Google-Smtp-Source: ABdhPJxEhKi749Qbu8TbBAghdDiR8ZIeAEhUG60Tu9mrTIiKptvwvEbelYwTE1zdZE7ACRqs/3KXL+gvnUFV X-Received: from r2d2-qp.c.googlers.com ([fda3:e722:ac3:10:28:9cb1:c0a8:1652]) (user=qperret job=sendgmr) by 2002:a17:906:3685:: with SMTP id a5mr496672ejc.544.1611855533828; Thu, 28 Jan 2021 09:38:53 -0800 (PST) Date: Thu, 28 Jan 2021 17:38:50 +0000 Message-Id: <20210128173850.2478161-1-qperret@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.30.0.280.ga3ce27912f-goog Subject: [PATCH] KVM: arm64: Move __hyp_set_vectors out of .hyp.text From: Quentin Perret To: catalin.marinas@arm.com, will@kernel.org, maz@kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210128_123857_080034_DA20229B X-CRM114-Status: GOOD ( 12.17 ) 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: kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, qperret@google.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The .hyp.text section is supposed to be reserved for the nVHE EL2 code. However, there is currently one occurrence of EL1 executing code located in .hyp.text when calling __hyp_{re}set_vectors(), which happen to sit next to the EL2 stub vectors. While not a problem yet, such patterns will cause issues when removing the host kernel from the TCB, so a cleaner split would be preferable. Fix this by delimiting the end of the .hyp.text section in hyp-stub.S. Signed-off-by: Quentin Perret Acked-by: Marc Zyngier --- arch/arm64/kernel/hyp-stub.S | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/arm64/kernel/hyp-stub.S b/arch/arm64/kernel/hyp-stub.S index 160f5881a0b7..8a60f9c586bb 100644 --- a/arch/arm64/kernel/hyp-stub.S +++ b/arch/arm64/kernel/hyp-stub.S @@ -85,6 +85,8 @@ SYM_CODE_END(\label) invalid_vector el1_fiq_invalid invalid_vector el1_error_invalid + .popsection + /* * __hyp_set_vectors: Call this after boot to set the initial hypervisor * vectors as part of hypervisor installation. On an SMP system, this should