[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAC_TJvdAa0PnTSiNa4W0QusQYJ7bEGeWD2+i4EsuZL94LjB15Q@mail.gmail.com>
Date: Fri, 22 Jul 2022 10:25:13 -0700
From: Kalesh Singh <kaleshsingh@...gle.com>
To: Oliver Upton <oliver.upton@...ux.dev>
Cc: Marc Zyngier <maz@...nel.org>, Mark Rutland <mark.rutland@....com>,
Mark Brown <broonie@...nel.org>,
"Madhavan T. Venkataraman" <madvenka@...ux.microsoft.com>,
Fuad Tabba <tabba@...gle.com>, Will Deacon <will@...nel.org>,
Quentin Perret <qperret@...gle.com>,
James Morse <james.morse@....com>,
Alexandru Elisei <alexandru.elisei@....com>,
Suzuki K Poulose <suzuki.poulose@....com>,
Catalin Marinas <catalin.marinas@....com>,
andreyknvl@...il.com, vincenzo.frascino@....com,
Masami Hiramatsu <mhiramat@...nel.org>,
Alexei Starovoitov <ast@...nel.org>,
Andrew Jones <drjones@...hat.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>,
Marco Elver <elver@...gle.com>, Keir Fraser <keirf@...gle.com>,
Zenghui Yu <yuzenghui@...wei.com>,
Ard Biesheuvel <ardb@...nel.org>,
"moderated list:ARM64 PORT (AARCH64 ARCHITECTURE)"
<linux-arm-kernel@...ts.infradead.org>,
kvmarm <kvmarm@...ts.cs.columbia.edu>,
LKML <linux-kernel@...r.kernel.org>, android-mm@...gle.com,
"Cc: Android Kernel" <kernel-team@...roid.com>
Subject: Re: [PATCH v5 16/17] KVM: arm64: Introduce pkvm_dump_backtrace()
On Fri, Jul 22, 2022 at 4:16 AM Oliver Upton <oliver.upton@...ux.dev> wrote:
>
> Hi Kalesh,
>
> On Wed, Jul 20, 2022 at 10:57:27PM -0700, Kalesh Singh wrote:
>
> [...]
>
> > +/*
> > + * pkvm_dump_backtrace - Dump the protected nVHE HYP backtrace.
> > + *
> > + * @hyp_offset: hypervisor offset, used for address translation.
> > + *
> > + * Dumping of the pKVM HYP backtrace is done by reading the
> > + * stack addresses from the shared stacktrace buffer, since the
> > + * host cannot direclty access hyperviosr memory in protected
> > + * mode.
> > + */
> > +static void pkvm_dump_backtrace(unsigned long hyp_offset)
> > +{
> > + unsigned long *stacktrace_entry
> > + = (unsigned long *)this_cpu_ptr_nvhe_sym(pkvm_stacktrace);
> > + unsigned long va_mask, pc;
> > +
> > + va_mask = GENMASK_ULL(vabits_actual - 1, 0);
> > +
> > + kvm_err("Protected nVHE HYP call trace:\n");
>
> This and the footer printks should be put in respective helpers to share
> between pKVM and non-pKVM backtrace implementations. I imagine users
> will invariably bake some pattern matching to scrape traces, and it
> should be consistent between both flavors.
Hi Oliver,
Ok will split these out into helpers.
>
> > + /* The stack trace is terminated by a null entry */
> > + for (; *stacktrace_entry; stacktrace_entry++) {
>
> At the point we're dumping the backtrace we know that EL2 has already
> soiled itself, so we shouldn't explicitly depend on it providing NULL
> terminators. I believe this loop should have an explicit range && NULL
> check.
Good point, I'll add the additional checks in the next version,
Thanks,
Kalesh
>
> --
> Thanks,
> Oliver
Powered by blists - more mailing lists