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=-14.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 204CAC433B4 for ; Wed, 5 May 2021 18:04:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D9A7A61057 for ; Wed, 5 May 2021 18:04:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235276AbhEESFO (ORCPT ); Wed, 5 May 2021 14:05:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42936 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235723AbhEESEJ (ORCPT ); Wed, 5 May 2021 14:04:09 -0400 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CDDCA61057; Wed, 5 May 2021 18:03:12 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94) (envelope-from ) id 1leLra-00B5q6-Nc; Wed, 05 May 2021 19:03:10 +0100 Date: Wed, 05 May 2021 19:03:09 +0100 Message-ID: <871ralnjmq.wl-maz@kernel.org> From: Marc Zyngier To: Auger Eric Cc: Paolo Bonzini , Alexander Graf , Alexandru Elisei , Andrew Scull , Catalin Marinas , Christoffer Dall , David Brazdil , Gavin Shan , James Morse , Mark Rutland , Peng Hao , Quentin Perret , Will Deacon , Julien Thierry , Suzuki K Poulose , linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH 15/56] KVM: arm64: Add build rules for separate VHE/nVHE object files In-Reply-To: <2ff3a1cb-a310-7963-4171-bd1e7d08e39b@redhat.com> References: <20200805175700.62775-1-maz@kernel.org> <20200805175700.62775-16-maz@kernel.org> <2ff3a1cb-a310-7963-4171-bd1e7d08e39b@redhat.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: eric.auger@redhat.com, pbonzini@redhat.com, graf@amazon.com, alexandru.elisei@arm.com, ascull@google.com, catalin.marinas@arm.com, christoffer.dall@arm.com, dbrazdil@google.com, gshan@redhat.com, james.morse@arm.com, mark.rutland@arm.com, richard.peng@oppo.com, qperret@google.com, will@kernel.org, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org, kernel-team@android.com X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hi Eric, On Tue, 04 May 2021 15:47:36 +0100, Auger Eric wrote: > > Hi David, Marc, > > On 8/5/20 7:56 PM, Marc Zyngier wrote: > > From: David Brazdil > > > > Add new folders arch/arm64/kvm/hyp/{vhe,nvhe} and Makefiles for building code > > that runs in EL2 under VHE/nVHE KVM, repsectivelly. Add an include folder for > > hyp-specific header files which will include code common to VHE/nVHE. > > > > Build nVHE code with -D__KVM_NVHE_HYPERVISOR__, VHE code with > > -D__KVM_VHE_HYPERVISOR__. > > > > Under nVHE compile each source file into a `.hyp.tmp.o` object first, then > > prefix all its symbols with "__kvm_nvhe_" using `objcopy` and produce > > a `.hyp.o`. Suffixes were chosen so that it would be possible for VHE and nVHE > > to share some source files, but compiled with different CFLAGS. > > > > The nVHE ELF symbol prefix is added to kallsyms.c as ignored. EL2-only symbols > > will never appear in EL1 stack traces. > > > > Due to symbol prefixing, add a section in image-vars.h for aliases of symbols > > that are defined in nVHE EL2 and accessed by kernel in EL1 or vice versa. > > > > Signed-off-by: David Brazdil > > Signed-off-by: Marc Zyngier > > Link: https://lore.kernel.org/r/20200625131420.71444-4-dbrazdil@google.com > > --- > > arch/arm64/kernel/image-vars.h | 14 +++++++++++++ > > arch/arm64/kvm/hyp/Makefile | 10 +++++++--- > > arch/arm64/kvm/hyp/nvhe/Makefile | 34 ++++++++++++++++++++++++++++++++ > > arch/arm64/kvm/hyp/vhe/Makefile | 17 ++++++++++++++++ > > scripts/kallsyms.c | 1 + > > 5 files changed, 73 insertions(+), 3 deletions(-) > > create mode 100644 arch/arm64/kvm/hyp/nvhe/Makefile > > create mode 100644 arch/arm64/kvm/hyp/vhe/Makefile [...] > > diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c > > index 6dc3078649fa..0096cd965332 100644 > > --- a/scripts/kallsyms.c > > +++ b/scripts/kallsyms.c > > @@ -109,6 +109,7 @@ static bool is_ignored_symbol(const char *name, char type) > > ".LASANPC", /* s390 kasan local symbols */ > > "__crc_", /* modversions */ > > "__efistub_", /* arm64 EFI stub namespace */ > > + "__kvm_nvhe_", /* arm64 non-VHE KVM namespace */ > The addition of this line seems to have introduced errors on the > 'vmlinux symtab matches kallsyms' perf test (perf test -v 1) which fails > on aarch64 for all __kvm_nvhe_ prefixed symbols, like > > ERR : : __kvm_nvhe___invalid not on kallsyms > ERR : : __kvm_nvhe___do_hyp_init not on kallsyms > ERR : : __kvm_nvhe___kvm_handle_stub_hvc not on kallsyms > ERR : : __kvm_nvhe_reset not on kallsyms > ../.. > > I understand we willingly hided those symbols from /proc/kallsyms. Do > you confirm the right fix is to upgrade the perf test suite accordingly? Hmmm. This test always fail here, no matter whether I have this line or not: maz@big-leg-emma:~$ sudo perf_5.10 test -v 1 1: vmlinux symtab matches kallsyms : --- start --- test child forked, pid 664 /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! /proc/{kallsyms,modules} inconsistency while looking for "[bpf]" module! Looking at the vmlinux_path (8 entries long) symsrc__init: cannot get elf header. symsrc__init: cannot get elf header. Couldn't find a vmlinux that matches the kernel running on this machine, skipping test test child finished with -2 ---- end ---- vmlinux symtab matches kallsyms: Skip Rookie question: How do you provide a kernel to the test framework? Thanks, M. -- Without deviation from the norm, progress is not possible.