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=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 9BF22C433DB for ; Tue, 2 Feb 2021 10:15:03 +0000 (UTC) Received: from mm01.cs.columbia.edu (mm01.cs.columbia.edu [128.59.11.253]) by mail.kernel.org (Postfix) with ESMTP id DA7A164DD1 for ; Tue, 2 Feb 2021 10:15:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA7A164DD1 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvmarm-bounces@lists.cs.columbia.edu Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 4B51E4B16F; Tue, 2 Feb 2021 05:15:02 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Authentication-Results: mm01.cs.columbia.edu (amavisd-new); dkim=softfail (fail, message has been altered) header.i=@google.com Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id F6qvtXsP7LR0; Tue, 2 Feb 2021 05:15:01 -0500 (EST) Received: from mm01.cs.columbia.edu (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 165924B165; Tue, 2 Feb 2021 05:15:01 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mm01.cs.columbia.edu (Postfix) with ESMTP id 0D2304B165 for ; Tue, 2 Feb 2021 05:15:00 -0500 (EST) X-Virus-Scanned: at lists.cs.columbia.edu Received: from mm01.cs.columbia.edu ([127.0.0.1]) by localhost (mm01.cs.columbia.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OiuqTI2zjv1e for ; Tue, 2 Feb 2021 05:14:58 -0500 (EST) Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) by mm01.cs.columbia.edu (Postfix) with ESMTPS id C63AA4B156 for ; Tue, 2 Feb 2021 05:14:58 -0500 (EST) Received: by mail-wr1-f43.google.com with SMTP id q7so19765428wre.13 for ; Tue, 02 Feb 2021 02:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=FOL+mQvxrnrE+2uwaih76cLeFlqKFQeumFQMbn7OQMAIpM3QuVMQbzQWvkXiuNztiU y88Fy/y32mILOuYt7wWj/C1cxaz5IxDEkFwRCNP1MWHgQJPqznb5h6i+wags+9DM4eku GfhWrhMLbwsnckJdPE1cjf0Fz2e7HQekW1N9ibs/9l5P8htQ+N+9qq0O8DFYqFfjzX+c KjwQkTwPz7YqHvii6xM2IYGYLtrFFWmyxlO7g2p4ASRNeb2LuIIY8b8n5ursKJkqtdJK iaprLMD4R7i3QzlQcFSuoesvVEd5irADknwJfcm81DsNs+mAmUNkflHqBCX9vMkrI8es NvoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=RkDC7B0dLMz5j450Qn/KbTekuNhxWlCTw2oG9mmDXAIw0hZYfIIsXQOOsm+PA6pG5/ 9RSLKaR2/pDcI7R7nCJ72OWL3w9eEEOEaeZwGRpurnYB39MjIo3aT091g0s5doEYEJzO 5BMYwfn8AERH5usxSPzPwuxKbfT459A7Hh8ELSSFlenQpTihAt8FGow6CFp4pZVCbWpN gRV3euf95MH680Qws9E08jHFYJVm0CU9kEzMWq1dMyJVQIA9nI6A0ovINf7hR4UAd2At YvKVsLOPLykmx1HEdFG0M6vlJZo84VfLBOT/Vq0jJbcTepbu2O8U4gr8j3lPdeTlMvBF uihg== X-Gm-Message-State: AOAM531ZFOON1FTbHIDG0DVZrEDFRsBsO1xDF/tNPZA6Yl8LiBOpXAx/ uwduWCjaP1/fAFYki1ir2Yvjjg== X-Google-Smtp-Source: ABdhPJyfWn6FsrHijyrJnW/tBTAvhlBZmX+sr4R/GNDwBS+eRgzTj9Ktrdkd2gpILs6BDmypHzVeRw== X-Received: by 2002:adf:e38d:: with SMTP id e13mr22258466wrm.231.1612260897588; Tue, 02 Feb 2021 02:14:57 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m22sm31890793wrh.66.2021.02.02.02.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:14:57 -0800 (PST) Date: Tue, 2 Feb 2021 10:14:51 +0000 From: Quentin Perret To: Will Deacon Subject: Re: [RFC PATCH v2 11/26] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-12-qperret@google.com> <20210201190620.GJ15632@willie-the-truck> <20210202100028.GA16657@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210202100028.GA16657@willie-the-truck> Cc: devicetree@vger.kernel.org, kernel-team@android.com, android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , linux-arm-kernel@lists.infradead.org, Marc Zyngier , Frank Rowand , kvmarm@lists.cs.columbia.edu X-BeenThere: kvmarm@lists.cs.columbia.edu X-Mailman-Version: 2.1.14 Precedence: list List-Id: Where KVM/ARM decisions are made List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kvmarm-bounces@lists.cs.columbia.edu Sender: kvmarm-bounces@lists.cs.columbia.edu On Tuesday 02 Feb 2021 at 10:00:29 (+0000), Will Deacon wrote: > On Tue, Feb 02, 2021 at 09:57:36AM +0000, Quentin Perret wrote: > > On Monday 01 Feb 2021 at 19:06:20 (+0000), Will Deacon wrote: > > > On Fri, Jan 08, 2021 at 12:15:09PM +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 1fc0684a7678..33bd381d8f73 100644 > > > > --- a/arch/arm64/kvm/hyp/nvhe/Makefile > > > > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile > > > > @@ -10,7 +10,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 > > > > > > Can we get away with defining our own CHECK_DATA_CORRUPTION macro instead? > > > > Yes I think eventually it'd be nice to get there, but that has other > > implications (e.g. how do you report something in dmesg from EL2?) so > > perhaps we can keep that a separate series? > > We wouldn't necessarily have to report anything, but having the return value > of these functions be based off the generic checks would be great if we can > do it (i.e. we'd avoid corrupting the list). Ah, I see what you mean. Happy to have a go a it, there are a few other small things that make that it a bit annoying e.g. CHECK_DATA_CORRUPTION is unconditionally defined in bug.h, and I'll need to stub EXPORT_SYMBOL as well, which may both require changing core files, but maybe that's fine. And if that is too painful I think it would make sense to keep this a separate and self-contained series which would be a nice incremental improvement over the simple approach I have here :) Cheers, Quentin _______________________________________________ kvmarm mailing list kvmarm@lists.cs.columbia.edu https://lists.cs.columbia.edu/mailman/listinfo/kvmarm 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.1 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 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 5083FC433DB for ; Tue, 2 Feb 2021 10:16:15 +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 E126F64DD1 for ; Tue, 2 Feb 2021 10:16:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E126F64DD1 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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=P+ywgU5InEdTq9h3QNeA8ylQOf623jmohTgXVcRkzY0=; b=VQqGslsPU6nZ9mclfUQixMDHd 4hYGUZmfDsOVd5ye7dLPXSVtbAeHXLyKZX5KCCy9osXt4yp/IBmmKuKLqp5E2o/wbj5uTIEWd4bKb GptJXPtyX5qijKOLoHFa8KcVpLX3bxfafxRg6y/E0MjPKCKOTEZpV0zhxq/0j2ccIi20EiRw9CpyC /woTlt7sJjHFVYvRgZJk0tR9PAUcL6rDoi67HTY/IKMNnRQAWC5zZqzfVZe/K+XAdlzmyD67m+h5h lJt31EZN0b+dFnRlA8B1fymHni6CoVomtuqL32tEI2FWnX3b+jFeQ+xlRkXJnMExlmvW/fEwnDFYx PPMtwZ6yQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6si6-0006yI-Gf; Tue, 02 Feb 2021 10:15:02 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6si3-0006xf-En for linux-arm-kernel@lists.infradead.org; Tue, 02 Feb 2021 10:15:00 +0000 Received: by mail-wr1-x432.google.com with SMTP id a1so19810501wrq.6 for ; Tue, 02 Feb 2021 02:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=FOL+mQvxrnrE+2uwaih76cLeFlqKFQeumFQMbn7OQMAIpM3QuVMQbzQWvkXiuNztiU y88Fy/y32mILOuYt7wWj/C1cxaz5IxDEkFwRCNP1MWHgQJPqznb5h6i+wags+9DM4eku GfhWrhMLbwsnckJdPE1cjf0Fz2e7HQekW1N9ibs/9l5P8htQ+N+9qq0O8DFYqFfjzX+c KjwQkTwPz7YqHvii6xM2IYGYLtrFFWmyxlO7g2p4ASRNeb2LuIIY8b8n5ursKJkqtdJK iaprLMD4R7i3QzlQcFSuoesvVEd5irADknwJfcm81DsNs+mAmUNkflHqBCX9vMkrI8es NvoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=DuPo31LD+/xSsdHeNK54tCm+diot1G7nC1DOGjaXP7JC6RwIfdo0H91wvjeIHEu9iK LfSXmQbm5WE2ICLU4revptQYkKnryJTKXlFoC2o8uSyFmCYEw/IMALhfFTH3CsLo1N0i JFY8PPXkHdYFUKyvNjZILo68jBCk0sL8uV6ke+py+nVVV9N/raI/IDa01CYNWhZxujkf Q6xsEe8EBfR23z0jUV0MTr8447cSObJk2DVPIxxTdf2NHdvPiW0XAsgAAIhezQun1K7w 0Yv4fvI4YdufIoV7kRwpabDtsqEjyrBKrEV26C0uOmuQqlV6UDtKMwLLmX0M1JXP+iT2 hEyA== X-Gm-Message-State: AOAM533Zt8jE/IP/vccWB5VtT9eh5st83c8i+04jozNpFirwvRyPoZj3 dLZv0T7P6j3cVoKmBGG7a6N4eg== X-Google-Smtp-Source: ABdhPJyfWn6FsrHijyrJnW/tBTAvhlBZmX+sr4R/GNDwBS+eRgzTj9Ktrdkd2gpILs6BDmypHzVeRw== X-Received: by 2002:adf:e38d:: with SMTP id e13mr22258466wrm.231.1612260897588; Tue, 02 Feb 2021 02:14:57 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m22sm31890793wrh.66.2021.02.02.02.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:14:57 -0800 (PST) Date: Tue, 2 Feb 2021 10:14:51 +0000 From: Quentin Perret To: Will Deacon Subject: Re: [RFC PATCH v2 11/26] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-12-qperret@google.com> <20210201190620.GJ15632@willie-the-truck> <20210202100028.GA16657@willie-the-truck> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210202100028.GA16657@willie-the-truck> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210202_051459_561530_69C36018 X-CRM114-Status: GOOD ( 31.54 ) 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: Mark Rutland , devicetree@vger.kernel.org, kernel-team@android.com, Suzuki K Poulose , android-kvm@google.com, Catalin Marinas , Fuad Tabba , linux-kernel@vger.kernel.org, Rob Herring , James Morse , linux-arm-kernel@lists.infradead.org, Marc Zyngier , David Brazdil , Frank Rowand , kvmarm@lists.cs.columbia.edu, Julien Thierry Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tuesday 02 Feb 2021 at 10:00:29 (+0000), Will Deacon wrote: > On Tue, Feb 02, 2021 at 09:57:36AM +0000, Quentin Perret wrote: > > On Monday 01 Feb 2021 at 19:06:20 (+0000), Will Deacon wrote: > > > On Fri, Jan 08, 2021 at 12:15:09PM +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 1fc0684a7678..33bd381d8f73 100644 > > > > --- a/arch/arm64/kvm/hyp/nvhe/Makefile > > > > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile > > > > @@ -10,7 +10,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 > > > > > > Can we get away with defining our own CHECK_DATA_CORRUPTION macro instead? > > > > Yes I think eventually it'd be nice to get there, but that has other > > implications (e.g. how do you report something in dmesg from EL2?) so > > perhaps we can keep that a separate series? > > We wouldn't necessarily have to report anything, but having the return value > of these functions be based off the generic checks would be great if we can > do it (i.e. we'd avoid corrupting the list). Ah, I see what you mean. Happy to have a go a it, there are a few other small things that make that it a bit annoying e.g. CHECK_DATA_CORRUPTION is unconditionally defined in bug.h, and I'll need to stub EXPORT_SYMBOL as well, which may both require changing core files, but maybe that's fine. And if that is too painful I think it would make sense to keep this a separate and self-contained series which would be a nice incremental improvement over the simple approach I have here :) Cheers, Quentin _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL 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 69975C433DB for ; Tue, 2 Feb 2021 10:15:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A41C64DD1 for ; Tue, 2 Feb 2021 10:15:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229852AbhBBKPl (ORCPT ); Tue, 2 Feb 2021 05:15:41 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbhBBKPj (ORCPT ); Tue, 2 Feb 2021 05:15:39 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 01649C061573 for ; Tue, 2 Feb 2021 02:14:59 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id p15so19746204wrq.8 for ; Tue, 02 Feb 2021 02:14:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=FOL+mQvxrnrE+2uwaih76cLeFlqKFQeumFQMbn7OQMAIpM3QuVMQbzQWvkXiuNztiU y88Fy/y32mILOuYt7wWj/C1cxaz5IxDEkFwRCNP1MWHgQJPqznb5h6i+wags+9DM4eku GfhWrhMLbwsnckJdPE1cjf0Fz2e7HQekW1N9ibs/9l5P8htQ+N+9qq0O8DFYqFfjzX+c KjwQkTwPz7YqHvii6xM2IYGYLtrFFWmyxlO7g2p4ASRNeb2LuIIY8b8n5ursKJkqtdJK iaprLMD4R7i3QzlQcFSuoesvVEd5irADknwJfcm81DsNs+mAmUNkflHqBCX9vMkrI8es NvoA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=S29qSBxrRMWdoh+uQ0z7xwZGgDdoQsP6bzHB4znO2RQ=; b=BVE4EsarO3tO12Vx1AMMq1Lx8hCPnaRLvxmHCYYur2uyzQy4OpoBCEUNbbK09CQGcw hQvftcJ0M6kWEr533dZboVuoC739T6JMagmeK+nESM0S3CENVczONQR7RtHD8dE/CLeh 2kL4V5FHM2ZlXklErXPnGpSsaSxmz4rs+zv3I8MsEfF05EOPELpOCWqdjhtpTEjgTYn6 gHIMSPwsaUpYYDWogQwnOv6HtUpJ2iyO07d65d+/QmXfGeNIYjUcBHB/TEhKJj2SJ2+7 JDDjumf5hKJieuASHnYXIBHBCQrH8/A1N+bimO/mkEo1JMe+JnjZtYOI0qnOCUlqB7ux b+/g== X-Gm-Message-State: AOAM532cH7kaf8aRX0sDCNxuwSewTPD4Stb8Oa8qtU5YpWDcCuP4KOe7 ROJT8KBi8coB2vq/bvJIBMXS8Q== X-Google-Smtp-Source: ABdhPJyfWn6FsrHijyrJnW/tBTAvhlBZmX+sr4R/GNDwBS+eRgzTj9Ktrdkd2gpILs6BDmypHzVeRw== X-Received: by 2002:adf:e38d:: with SMTP id e13mr22258466wrm.231.1612260897588; Tue, 02 Feb 2021 02:14:57 -0800 (PST) Received: from google.com (230.69.233.35.bc.googleusercontent.com. [35.233.69.230]) by smtp.gmail.com with ESMTPSA id m22sm31890793wrh.66.2021.02.02.02.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Feb 2021 02:14:57 -0800 (PST) Date: Tue, 2 Feb 2021 10:14:51 +0000 From: Quentin Perret To: Will Deacon Cc: Catalin Marinas , Marc Zyngier , James Morse , Julien Thierry , Suzuki K Poulose , Rob Herring , Frank Rowand , devicetree@vger.kernel.org, android-kvm@google.com, linux-kernel@vger.kernel.org, kernel-team@android.com, kvmarm@lists.cs.columbia.edu, linux-arm-kernel@lists.infradead.org, Fuad Tabba , Mark Rutland , David Brazdil Subject: Re: [RFC PATCH v2 11/26] KVM: arm64: Stub CONFIG_DEBUG_LIST at Hyp Message-ID: References: <20210108121524.656872-1-qperret@google.com> <20210108121524.656872-12-qperret@google.com> <20210201190620.GJ15632@willie-the-truck> <20210202100028.GA16657@willie-the-truck> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210202100028.GA16657@willie-the-truck> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Tuesday 02 Feb 2021 at 10:00:29 (+0000), Will Deacon wrote: > On Tue, Feb 02, 2021 at 09:57:36AM +0000, Quentin Perret wrote: > > On Monday 01 Feb 2021 at 19:06:20 (+0000), Will Deacon wrote: > > > On Fri, Jan 08, 2021 at 12:15:09PM +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 1fc0684a7678..33bd381d8f73 100644 > > > > --- a/arch/arm64/kvm/hyp/nvhe/Makefile > > > > +++ b/arch/arm64/kvm/hyp/nvhe/Makefile > > > > @@ -10,7 +10,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 > > > > > > Can we get away with defining our own CHECK_DATA_CORRUPTION macro instead? > > > > Yes I think eventually it'd be nice to get there, but that has other > > implications (e.g. how do you report something in dmesg from EL2?) so > > perhaps we can keep that a separate series? > > We wouldn't necessarily have to report anything, but having the return value > of these functions be based off the generic checks would be great if we can > do it (i.e. we'd avoid corrupting the list). Ah, I see what you mean. Happy to have a go a it, there are a few other small things that make that it a bit annoying e.g. CHECK_DATA_CORRUPTION is unconditionally defined in bug.h, and I'll need to stub EXPORT_SYMBOL as well, which may both require changing core files, but maybe that's fine. And if that is too painful I think it would make sense to keep this a separate and self-contained series which would be a nice incremental improvement over the simple approach I have here :) Cheers, Quentin