Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp8214163pxb; Fri, 19 Feb 2021 10:07:22 -0800 (PST) X-Google-Smtp-Source: ABdhPJzjUtWDHFEb/UWhrffifODs2LIQNBlYJ6aNkSzWE7pXxLgkgVVa2lwniegTET8j9BLm4Dns X-Received: by 2002:a05:6402:1ac2:: with SMTP id ba2mr10125170edb.81.1613758042015; Fri, 19 Feb 2021 10:07:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613758042; cv=none; d=google.com; s=arc-20160816; b=z21GccqEe7qKwZqq2RoYDSJx1akROLxo/Si05NG9U0rQoeJdMcezw+TaZnFsMiic43 lzbJ0F0l7Eq+ddOKs8zT1RC4GE/Iyd4RgKWfY0RlCJpYkiW1RmjGCMGOZid6hZ3u4cow czz0aqKgPZ/rJvPVwRnC3BRDDYoAfTCvCCl8+Xp5Mtxhih34bDX5+PsbHGP/I0SYDIJ0 uWEWBa/V/YnAX1flwgIG8Vylg92kWJ6oIsHObncElUL5igsKFM9FabWcNu7kyoxrJgta 7Kpqg+An+agPpgmlDvynoOwMlk0w1uc1hAy1JTe9nozin0QffZQV2mkbayG1XrQImNFz DU9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=OlN9WV3e7PMSpj/ja1iO6+Wn1S8Jae+104rD5AWhduc=; b=gS9px1Xye41zXXcF5GSSbvtywJV86O+n660caRXmK7Hc9t4lP+ceEkX4uPCZRvje+Q FdE7DSKu2lobdUrShMtC2HIkAS3DSFAoonA6BIf27zHemeLFwr6JVZoWwNQTUqFljvc4 LXpfYYEWZCBSL5Q9sepwWGnc0RtypT05HgyYu9Nq6kjBi7K5yDYxj2JRsG8RxOjjM1VW vyoOH4pIaEtv7OIdi4v6393CChJJUo6zV1s+hKlRZsIYnGWV6HY6gyLMvAo5+0OVSJUd NjJc6CaLi+kY9Y8FSIMC9WsYIsrPhWg6uYKH3LOZC0sk7eLWfKe2M97Bd4puP2NHDieJ oARw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=oDTuYM2v; 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq1si3445215edb.162.2021.02.19.10.06.57; Fri, 19 Feb 2021 10:07:22 -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=@ibm.com header.s=pp1 header.b=oDTuYM2v; 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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbhBSSFe (ORCPT + 99 others); Fri, 19 Feb 2021 13:05:34 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:18726 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229515AbhBSSFd (ORCPT ); Fri, 19 Feb 2021 13:05:33 -0500 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 11JI3dnw190229; Fri, 19 Feb 2021 13:04:19 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=OlN9WV3e7PMSpj/ja1iO6+Wn1S8Jae+104rD5AWhduc=; b=oDTuYM2vtwj2xbdB0GM5ReOD9N5aOmjWJQnNJtiXDNGh5E6vVrNW/5j/lsFls/agqfNz YymqNK1W+SHLhAE4ufqFrHFie/wJN/6nhgSAWuLdsw9LSpmkip9TAfpvZgxAAd7UXQ5J BGQWIRocYSJxt8hqbteEdIT8PZXxHDAMnJDPmMOWTyaxO284aQg59dMg+qpO/YXy7jgF s68sldd+36QznuWtTrqaCCKWKuf35/WO6Vn9bbKNSNfoRDE2rQBbS1F+DPyiv03b0wpn AUMgShs3WwHaAaX9Z4WFOBGI7GlLYyZBNZIu5ivykgUbphbr1LITPhVxoSzIZjLeR5Vt KA== Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 36thye0j2h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Feb 2021 13:04:19 -0500 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 11JI2fMU017691; Fri, 19 Feb 2021 18:03:54 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma04ams.nl.ibm.com with ESMTP id 36p6d8dsn6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Feb 2021 18:03:54 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 11JI3qOJ37618092 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 19 Feb 2021 18:03:52 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E9CAAE04D; Fri, 19 Feb 2021 18:03:52 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2D9A0AE05A; Fri, 19 Feb 2021 18:03:48 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.211.144.116]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 19 Feb 2021 18:03:47 +0000 (GMT) Message-ID: <6a197963deb8e44c71384ea9b89d7f3f13c947bf.camel@linux.ibm.com> Subject: Re: [PATCH] of: error: 'const struct kimage' has no member named 'arch' From: Mimi Zohar To: Rob Herring , Lakshmi Ramasubramanian Cc: Thiago Jung Bauermann , "AKASHI, Takahiro" , Greg Kroah-Hartman , Will Deacon , Joe Perches , Catalin Marinas , Michael Ellerman , Stephen Rothwell , James Morse , Sasha Levin , Benjamin Herrenschmidt , linux-integrity@vger.kernel.org, "linux-kernel@vger.kernel.org" , linux-arm-kernel , devicetree@vger.kernel.org, linuxppc-dev Date: Fri, 19 Feb 2021 13:03:46 -0500 In-Reply-To: References: <20210218223305.2044-1-nramas@linux.microsoft.com> <8b8c0b70-c7ab-33f3-b66c-9ea03388497b@linux.microsoft.com> <87k0r4yi4s.fsf@manicouagan.localdomain> <3ca0aa87-ca83-8024-4067-c2382a360db9@linux.microsoft.com> <98a061d1-05ea-eff2-5c5c-a59f491fe924@linux.microsoft.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-14.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.369,18.0.761 definitions=2021-02-19_08:2021-02-18,2021-02-19 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 impostorscore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 mlxscore=0 malwarescore=0 spamscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2102190137 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-02-19 at 11:43 -0600, Rob Herring wrote: > On Fri, Feb 19, 2021 at 10:57 AM Lakshmi Ramasubramanian > wrote: > > > > On 2/19/21 6:16 AM, Rob Herring wrote: > > > On Thu, Feb 18, 2021 at 8:53 PM Lakshmi Ramasubramanian > > > wrote: > > >> > > >> On 2/18/21 5:13 PM, Thiago Jung Bauermann wrote: > > >>> > > >>> Lakshmi Ramasubramanian writes: > > >>> > > >>>> On 2/18/21 4:07 PM, Mimi Zohar wrote: > > >>>> > > >>>> Hi Mimi, > > >>>> > > >>>>> On Thu, 2021-02-18 at 14:33 -0800, Lakshmi Ramasubramanian wrote: > > >>>>>> of_kexec_alloc_and_setup_fdt() defined in drivers/of/kexec.c builds > > >>>>>> a new device tree object that includes architecture specific data > > >>>>>> for kexec system call. This should be defined only if the architecture > > >>>>>> being built defines kexec architecture structure "struct kimage_arch". > > >>>>>> > > >>>>>> Define a new boolean config OF_KEXEC that is enabled if > > >>>>>> CONFIG_KEXEC_FILE and CONFIG_OF_FLATTREE are enabled, and > > >>>>>> the architecture is arm64 or powerpc64. Build drivers/of/kexec.c > > >>>>>> if CONFIG_OF_KEXEC is enabled. > > >>>>>> > > >>>>>> Signed-off-by: Lakshmi Ramasubramanian > > >>>>>> Fixes: 33488dc4d61f ("of: Add a common kexec FDT setup function") > > >>>>>> Reported-by: kernel test robot > > >>>>>> --- > > >>>>>> drivers/of/Kconfig | 6 ++++++ > > >>>>>> drivers/of/Makefile | 7 +------ > > >>>>>> 2 files changed, 7 insertions(+), 6 deletions(-) > > >>>>>> > > >>>>>> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig > > >>>>>> index 18450437d5d5..f2e8fa54862a 100644 > > >>>>>> --- a/drivers/of/Kconfig > > >>>>>> +++ b/drivers/of/Kconfig > > >>>>>> @@ -100,4 +100,10 @@ config OF_DMA_DEFAULT_COHERENT > > >>>>>> # arches should select this if DMA is coherent by default for OF devices > > >>>>>> bool > > >>>>>> +config OF_KEXEC > > >>>>>> + bool > > >>>>>> + depends on KEXEC_FILE > > >>>>>> + depends on OF_FLATTREE > > >>>>>> + default y if ARM64 || PPC64 > > >>>>>> + > > >>>>>> endif # OF > > >>>>>> diff --git a/drivers/of/Makefile b/drivers/of/Makefile > > >>>>>> index c13b982084a3..287579dd1695 100644 > > >>>>>> --- a/drivers/of/Makefile > > >>>>>> +++ b/drivers/of/Makefile > > >>>>>> @@ -13,11 +13,6 @@ obj-$(CONFIG_OF_RESERVED_MEM) += of_reserved_mem.o > > >>>>>> obj-$(CONFIG_OF_RESOLVE) += resolver.o > > >>>>>> obj-$(CONFIG_OF_OVERLAY) += overlay.o > > >>>>>> obj-$(CONFIG_OF_NUMA) += of_numa.o > > >>>>>> - > > >>>>>> -ifdef CONFIG_KEXEC_FILE > > >>>>>> -ifdef CONFIG_OF_FLATTREE > > >>>>>> -obj-y += kexec.o > > >>>>>> -endif > > >>>>>> -endif > > >>>>>> +obj-$(CONFIG_OF_KEXEC) += kexec.o > > >>>>>> obj-$(CONFIG_OF_UNITTEST) += unittest-data/ > > >>>>> Is it possible to reuse CONFIG_HAVE_IMA_KEXEC here? > > >>>>> > > >>>> > > >>>> For ppc64 CONFIG_HAVE_IMA_KEXEC is selected when CONFIG_KEXEC_FILE is enabled. > > >>>> So I don't see a problem in reusing CONFIG_HAVE_IMA_KEXEC for ppc. > > >>>> > > >>>> But for arm64, CONFIG_HAVE_IMA_KEXEC is enabled in the final patch in the patch > > >>>> set (the one for carrying forward IMA log across kexec for arm64). arm64 calls > > >>>> of_kexec_alloc_and_setup_fdt() prior to enabling CONFIG_HAVE_IMA_KEXEC and hence > > >>>> breaks the build for arm64. > > >>> > > >>> One problem is that I believe that this patch won't placate the robot, > > >>> because IIUC it generates config files at random and this change still > > >>> allows hppa and s390 to enable CONFIG_OF_KEXEC. > > >> > > >> I enabled CONFIG_OF_KEXEC for s390. With my patch applied, > > >> CONFIG_OF_KEXEC is removed. So I think the robot enabling this config > > >> would not be a problem. > > >> > > >>> > > >>> Perhaps a new CONFIG_HAVE_KIMAGE_ARCH option? Not having that option > > >>> would still allow building kexec.o, but would be used inside kexec.c to > > >>> avoid accessing kimage.arch members. > > >>> > > >> > > >> I think this is a good idea - a new CONFIG_HAVE_KIMAGE_ARCH, which will > > >> be selected by arm64 and ppc for now. I tried this, and it fixes the > > >> build issue. > > >> > > >> Although, the name for the new config can be misleading since PARISC, > > >> for instance, also defines "struct kimage_arch". Perhaps, > > >> CONFIG_HAVE_ELF_KIMAGE_ARCH since of_kexec_alloc_and_setup_fdt() is > > >> accessing ELF specific fields in "struct kimage_arch"? > > >> > > >> Rob/Mimi - please let us know which approach you think is better. > > > > > > I'd just move the fields to kimage. > > > > > > > I think Mimi's suggestion to use CONFIG_HAVE_IMA_KEXEC for building > > drivers/of/kexec.c would work and also avoid the bisect issue if we do > > the following: > > That seems wrong given only a portion of the file depends on IMA. And > it reduces our compile coverage. I agree with you this is the wrong solution. Lakshmi's patch introduced a new option to prevent other arch's from including kexec.o, which is the same functionality as CONFIG_HAVE_IMA_KEXEC. I'm just not sure what the right solution would be. Mimi