From patchwork Fri Jul 15 23:58:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalesh Singh X-Patchwork-Id: 12919932 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D6BECC43334 for ; Fri, 15 Jul 2022 23:59:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc: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=2Zjl4i/OVEmktcdprPCnzgxxJAuPcytwL3jnO+sZys4=; b=PlE UOcDsY3A4y1BmodnJegILpl8YXCtrc428a0GTAimr0y1rB3rXKDSfgDQQ321T9vQM04qgjlaqi8c5 dU8bN2+jtYAw8J+gcVGM/hWagXAzhEN3Nry+HJGD2rCtLZOaLCYrnDbM1r/lUzJyehVH7+T88ucZ5 4EM8YFm8F4Iymzrd/Z1FSx/x5q1usAnX3VHn43cbAkT0wagDhIxAtUNzX9okiUQPU0crvndW/R71T 6BMKe6UQqn8IItsvRQDSNQs7HPfKbSIAyds4HNucbdmgD4oxGX9Q/CyBk4MrSaYzIVCoelxA5+JHw F127x+9msxOxt6VWYQa3P3xQ6EK3ZPw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCVCj-00BL98-Vy; Fri, 15 Jul 2022 23:58:42 +0000 Received: from mail-yb1-xb4a.google.com ([2607:f8b0:4864:20::b4a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oCVCg-00BL6U-Ht for linux-arm-kernel@lists.infradead.org; Fri, 15 Jul 2022 23:58:39 +0000 Received: by mail-yb1-xb4a.google.com with SMTP id k13-20020a25240d000000b0066e32c61c25so4849876ybk.3 for ; Fri, 15 Jul 2022 16:58:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=4Gh4HGzCqCiR1aMRIxtcGB+xW1TuymtOUOGGi3XUe+w=; b=laaDvU+ra+tX4Ugt/hApPQt2F+7sMcLjlMfErCxQ6ZAH13Fl9Hv7omF2Saquz513mu J+bzAYxUx7CJ7btjmdncYrC4Y1veu4NHmQSeNXnOpqCAxzIaB5YMd/l72BqrmAcB25Re aNK+JcXfLhxCXei0o7ELRQeRTW82+RLqR5IixgRFrLcuYYER2aDhKQ486g/VCwUqVWtH tasGaqajdMOPcNItlrkBHc6TN6iHktOIIjVTgbV/GxxseQ1L4UA2gFqmJgw62Ugr1v/5 6gP6onX2YcRMENGDJD/h2b8G3wSA1GpfizjMN4ihAYbf/2VUfRAwE7VGIPqLL9iTf/e3 aq7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=4Gh4HGzCqCiR1aMRIxtcGB+xW1TuymtOUOGGi3XUe+w=; b=vk149wK2MDXKYja6WLfSl10EZKbacCl3UzgSlsSdtk2VKhKbnny8I8ciCFnQm/B3an SaoeKe7nXt3mA9SazhQRvI3nOr2OKxjhxLDqscjQpjYDtBp74vSZpLLQQdGRnY1u4/o8 feka++ZwC83eu3iJYvXclsxGP8H9QRiTe8+CfbjoXS6vlBvn2vl/Wh3TVL0jLbsw/v80 HLNHuab+QaQs2kOPkhDBlNLhYGf6/dZT+/jJn/P/uUunW5igXLUn8BWK0n2lCPkZLUwU syJW4r4OytrTEKAn+inKN2fUSNpGRWTczG6WBM0wozF2zrr7buRE6a9LfCFhzMS5GJFD 43CQ== X-Gm-Message-State: AJIora8OsVJHL1s0dxMSE5m+4Gi/7PQEyItSb3nuGm/L7wt3jHLBHnCa +V3BQYply3h/XfFQpXa4KRhqUT3MmD6kF0Rq7A== X-Google-Smtp-Source: AGRyM1vkyU/rsorWG73TjyeqssO4W2twt9Xtdrwt2iDSADe0KqgrXHN+i9CgnK6UL1nt08B+26vBLjDJeLP2QInhhQ== X-Received: from kaleshsingh.mtv.corp.google.com ([2620:15c:211:200:dbad:2778:c9ea:c5e9]) (user=kaleshsingh job=sendgmr) by 2002:a25:cb85:0:b0:66f:fffd:a726 with SMTP id b127-20020a25cb85000000b0066ffffda726mr3177720ybg.287.1657929512302; Fri, 15 Jul 2022 16:58:32 -0700 (PDT) Date: Fri, 15 Jul 2022 16:58:24 -0700 Message-Id: <20220715235824.2549012-1-kaleshsingh@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.37.0.170.g444d1eabd0-goog Subject: [PATCH] KVM: arm64: Fix hypervisor address symbolization From: Kalesh Singh To: maz@kernel.org, mark.rutland@arm.com, broonie@kernel.org, madvenka@linux.microsoft.com, tabba@google.com Cc: will@kernel.org, qperret@google.com, android-mm@google.com, kernel-team@android.com, Kalesh Singh , James Morse , Alexandru Elisei , Suzuki K Poulose , Catalin Marinas , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, linux-kernel@vger.kernel.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220715_165838_625437_4CC1EC84 X-CRM114-Status: GOOD ( 11.22 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org With CONFIG_RANDOMIZE_BASE=y vmlinux addresses will resolve correctly from kallsyms. Fix this by adding the KASLR offset before printing the symbols. Based on arm64 for-next/stacktrace. Fixes: 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses") Reported-by: Fuad Tabba Signed-off-by: Kalesh Singh --- arch/arm64/kvm/handle_exit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) base-commit: 82a592c13b0aeff94d84d54183dae0b26384c95f diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index f66c0142b335..e43926ef2bc2 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -347,10 +347,10 @@ void __noreturn __cold nvhe_hyp_panic_handler(u64 esr, u64 spsr, kvm_err("nVHE hyp BUG at: %s:%u!\n", file, line); else kvm_err("nVHE hyp BUG at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); } else { kvm_err("nVHE hyp panic at: [<%016llx>] %pB!\n", panic_addr, - (void *)panic_addr); + (void *)(panic_addr + kaslr_offset())); } /*