Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp494271pxf; Thu, 11 Mar 2021 08:13:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpGQFtKWf1e8u3q6tNrpaxwHrWTgNRxD+RlesN/BdWXBJSi4IEOZJca3SkMi/uaOprf806 X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr3842280ejb.399.1615479208592; Thu, 11 Mar 2021 08:13:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615479208; cv=none; d=google.com; s=arc-20160816; b=CHvyAgIzhKhq4UeouwH4duycR5Z0JP2AUkHGLLwSrbqtU1s2lADskNakZFYJgvRlzx r7sK8S1U65zlnIyqrOnrv6AL069WDNghweOMDvS9HRMCrGCO9wT84+Pl8ZdbLklzwL5D N1aVZzNlArhCgu2vXMKLD8okcqC4IDiJpR8cKMMp2Ze+8gHhOe9CI6XFBQYtg9kbaEiH ZrjX3egsZiR501hyVbWgVHnoKKl+OwDwtsVbJKF75wJl4f6KobZzAyfy0khe58XS7yjC J7h10at2pnfx2a55Y4qAGYJQaY9VFcNVN8CwQz5+xrwbfbvcQDZhVaLjhWwQUZe+OWKq y+2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=/Vu4+uOU6lpKlR8/7+dEwWuOwOKWsO7uGbL+UobkK/s=; b=fRgzdqLIQ3AOFaOAPX8e0uXPHqhvGAnQInr8+jdTiXxBsLaMPw+bDUFPB3Iuyvi2Uu 72jEm4TXJsupaNybZl2yQhuQBKeS5pmHvr+nOcyitd5ivhM9u+lxoYMeo1MnMb3R1nRw W6o5lVwKflRgjgWh0c4N9MNPN7K4Vh/qpzAZGLUcrWOTJMIUES2lrcl7fVwr583hKELe lvUapXSvR3qjY8IRs47Abn+HunD2ZXRRe6VeSUCpsa1uDSJc/5yO2rpmOjJ/WIgTNUrj wyWm4I5CNt/MLHUZudvPBPCzUIJk1IaHN7DEprmAo+ZMvuQREvX+BBmvkz3CuDNJGY+7 2txA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r4nQkqHd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk9si1910593ejb.474.2021.03.11.08.13.05; Thu, 11 Mar 2021 08:13:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=r4nQkqHd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234356AbhCKQLy (ORCPT + 99 others); Thu, 11 Mar 2021 11:11:54 -0500 Received: from mail.kernel.org ([198.145.29.99]:50348 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234443AbhCKQLf (ORCPT ); Thu, 11 Mar 2021 11:11:35 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id C9B2464FA3; Thu, 11 Mar 2021 16:11:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615479095; bh=E87K7pnoXEeIDrTmeoC6YBHh9dve+IPi3cHQxxCc+48=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=r4nQkqHdL2JuiHy0v2ICafmTOqoiN8+zS4zbPAFePc4r1RMXoTJGboIAYvQZfEPBF GASa0lX9rDFbjdV/u9cqZYMIfoNOCbLZtk5qU9ZXXBK88F9pjPW5AaudDHtLSMCwAK UaCYzk52WXL9ew+/ibFLCtNCEoxbKtXA8hLTLaHKBz0VYcIBOLhKVG/yDso31B+O3a kg08E5Shw0uyYbCKengLJSNL8r9DwTPM+BhQI9l/Avm9I16E4tw+u/FbILg0EGqcOZ ZhHS/8FgummcqWjQ+ZKJoYyJ9/JRTfmt/XT0iRGrGFYfvcz9ARI3R119VVk1wpNUE2 /M+7wLuvdDMlQ== Date: Thu, 11 Mar 2021 16:11:28 +0000 From: Will Deacon To: Quentin Perret Cc: catalin.marinas@arm.com, maz@kernel.org, james.morse@arm.com, julien.thierry.kdev@gmail.com, suzuki.poulose@arm.com, android-kvm@google.com, linux-kernel@vger.kernel.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, tabba@google.com, mark.rutland@arm.com, dbrazdil@google.com, mate.toth-pal@arm.com, seanjc@google.com, robh+dt@kernel.org, ardb@kernel.org Subject: Re: [PATCH v4 11/34] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp Message-ID: <20210311161127.GB31206@willie-the-truck> References: <20210310175751.3320106-1-qperret@google.com> <20210310175751.3320106-12-qperret@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210310175751.3320106-12-qperret@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 10, 2021 at 05:57:28PM +0000, Quentin Perret wrote: > In order to use the kernel list library at EL2, introduce stubs for the > CONFIG_DEBUG_LIST out-of-lines calls. > > Signed-off-by: Quentin Perret > --- > arch/arm64/kvm/hyp/nvhe/Makefile | 2 +- > arch/arm64/kvm/hyp/nvhe/stub.c | 22 ++++++++++++++++++++++ > 2 files changed, 23 insertions(+), 1 deletion(-) > create mode 100644 arch/arm64/kvm/hyp/nvhe/stub.c > > diff --git a/arch/arm64/kvm/hyp/nvhe/Makefile b/arch/arm64/kvm/hyp/nvhe/Makefile > index 24ff99e2eac5..144da72ad510 100644 > --- a/arch/arm64/kvm/hyp/nvhe/Makefile > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile > @@ -13,7 +13,7 @@ lib-objs := clear_page.o copy_page.o memcpy.o memset.o > lib-objs := $(addprefix ../../../lib/, $(lib-objs)) > > obj-y := timer-sr.o sysreg-sr.o debug-sr.o switch.o tlb.o hyp-init.o host.o \ > - hyp-main.o hyp-smp.o psci-relay.o early_alloc.o > + hyp-main.o hyp-smp.o psci-relay.o early_alloc.o stub.o > obj-y += ../vgic-v3-sr.o ../aarch32.o ../vgic-v2-cpuif-proxy.o ../entry.o \ > ../fpsimd.o ../hyp-entry.o ../exception.o > obj-y += $(lib-objs) > diff --git a/arch/arm64/kvm/hyp/nvhe/stub.c b/arch/arm64/kvm/hyp/nvhe/stub.c > new file mode 100644 > index 000000000000..c0aa6bbfd79d > --- /dev/null > +++ b/arch/arm64/kvm/hyp/nvhe/stub.c > @@ -0,0 +1,22 @@ > +// SPDX-License-Identifier: GPL-2.0-only > +/* > + * Stubs for out-of-line function calls caused by re-using kernel > + * infrastructure at EL2. > + * > + * Copyright (C) 2020 - Google LLC > + */ > + > +#include > + > +#ifdef CONFIG_DEBUG_LIST > +bool __list_add_valid(struct list_head *new, struct list_head *prev, > + struct list_head *next) > +{ > + return true; > +} > + > +bool __list_del_entry_valid(struct list_head *entry) > +{ > + return true; > +} > +#endif This isn't any worse than disabling DEBUG_LIST for the EL2 object, so as an initial implementation: Acked-by: Will Deacon but we really should have the debug list checks on (probably unconditionally) for the EL2 code in my opinion. Will