Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp4237918ybh; Tue, 17 Mar 2020 15:06:49 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtsyg0AEqcL6xqu5f4GcEPnBxVcuo4rwJFUbHFp+LKP6aUkPdwifg8rAHR30eCRqSQUtKcw X-Received: by 2002:a9d:6c0b:: with SMTP id f11mr1246866otq.182.1584482809654; Tue, 17 Mar 2020 15:06:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584482809; cv=none; d=google.com; s=arc-20160816; b=Z4khZhpq7+bUltVWVoASskWLoICwiiOO5z7TpCxZdj9gJ7N6jJOAAjQMqJKKIOoIa6 MZtWcBvhz3/gV3gRLbvpyeJbBcwc8UEBYw9WwyRuEjHrcE7eL86Qo448YPbtjUT3MFuw +PTXoSVVbA174W2SguASbVE+7HqV65r8QavPPUpdU1fNNWJdT9ixXaGhMj5v+OW8xe8o gLJfhpPcoKVHoYnpcLaAIFZXqDzAO1DHWHZVij1YzMKYVVL2mIyqf6ka/NZuzu010NcR 8YFt2oSnx36TwwE6PVfiBfzNyu5xuGjv0HjMO7ozeMDJ+xIUtENp5AUnAWXfUiajZZ2+ 9glw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=gY+guVjbAMZU5uOESZLzfUGHTA73g3d/loWemG4Z+tE=; b=yTtY4AI9JpoEHovvFyyxsnyI/Quat58fwLtFC9N9q7Z+Hl1Iw0dSBUhyUfsV5WcXSi P0WaN7+SBTZlXC35KTgemtdTtvSz6QI1l6Q+ehjkLTpsPBujiCyi+DJ141AX4cAlX8v3 Avvkwj5FsGL16TrWQf5ygcp3f4VhAp9TOsIBSb0ed1eMotpTlRpISKj8z5HS1zroTRG0 5WaPsx0boIBjxgt0nCUYCekG79FJh23R6oHyspYaKRExeoA7/vwc/k4fkGGKBN1c3n0j r6E925WVhxIz/GWTrvDNrJwhHhQc6oPCGXtOPJxtQzkzfKb2N2arxAFZrtcGu8jl1LTq +4+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=DgVudzFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si2334561oto.123.2020.03.17.15.06.29; Tue, 17 Mar 2020 15:06:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@intel-com.20150623.gappssmtp.com header.s=20150623 header.b=DgVudzFU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726897AbgCQWFA (ORCPT + 99 others); Tue, 17 Mar 2020 18:05:00 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:34898 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726476AbgCQWE7 (ORCPT ); Tue, 17 Mar 2020 18:04:59 -0400 Received: by mail-oi1-f194.google.com with SMTP id k8so22156608oik.2 for ; Tue, 17 Mar 2020 15:04:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=gY+guVjbAMZU5uOESZLzfUGHTA73g3d/loWemG4Z+tE=; b=DgVudzFUJBGxeDF2iH5mheVO+tEr9voArIx64eJyZEBBg7cRUGb+cj/MjOf9oq3B2R QJIL+lhTJMNAQ2ngIH0YwrqRSHxOD/fXTbGSyUUiG2SG3d9V05oxPGTwun4uO4gi4IlX WxNQwPnIrSGREpuL3ogprgQmp5jDmU634+TUNER/9IW612bYKA/Y0kZDlnRh7OPIc7fZ N3HkePiHhMsx27VQXonJFl9bdxeB0ntQKwRhkKFQ/5Yysl6eRd32am9KSXxFsta5qcIo i3a8vj0Uaqxhll7rOfD9Qno75Qopvm5OE8wtwmN62BUdRv/lvuW7wYkuuokxAAcPHEuO 2jHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=gY+guVjbAMZU5uOESZLzfUGHTA73g3d/loWemG4Z+tE=; b=rl+DQ2zYePGnqlg9QgOBwNG5/PHB57bE1QJt8xyTz1ddiIq5zHeUoOiSMfFAU/Figf jqe16TixerDpjklFmawnjC6CiXBWYNwHhlB0OrCBzUclchHt3hb91jKFuR3JJip2mWAl polSbWdom/JPGwv+wRIbsXVUxsHwBg7Wr+b/fKJUC/mexAlvCYDh2Df5yiZNpney1hxC mTZBYCsjy/jCER55lfPd4ehAJyDlVaZjo6AyhWRmBkIvG9ESGh6KIfiIYN3eDUhDF4CP LOt6gT7yIvthxPrr6z9Mu1brPvzaHI6a4oZZm/SCxs9Z+3/mdrBOJ3w7dB0ggF4Loa5V 5sGg== X-Gm-Message-State: ANhLgQ34jIdJVuuvhMiyCeogAVhc8/PSpEVglqeRCzEp/T3y3HKrpk/k Gho2eIESqPZhoHBZzWAIYJbRlnvTNGC9132LL2aDRw== X-Received: by 2002:aca:4d8:: with SMTP id 207mr838171oie.70.1584482698821; Tue, 17 Mar 2020 15:04:58 -0700 (PDT) MIME-Version: 1.0 References: <158318759687.2216124.4684754859068906007.stgit@dwillia2-desk3.amr.corp.intel.com> <158318762012.2216124.16408566404290491508.stgit@dwillia2-desk3.amr.corp.intel.com> <1848cdb9-8c19-d7fe-870c-175bd60bc364@amd.com> In-Reply-To: <1848cdb9-8c19-d7fe-870c-175bd60bc364@amd.com> From: Dan Williams Date: Tue, 17 Mar 2020 15:04:48 -0700 Message-ID: Subject: Re: [PATCH 4/5] resource: Report parent to walk_iomem_res_desc() callback To: Tom Lendacky Cc: Linux ACPI , Jason Gunthorpe , Dave Hansen , Wei Yang , Peter Zijlstra , Ard Biesheuvel , linux-nvdimm , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 5, 2020 at 6:42 AM Tom Lendacky wrote: > > On 3/2/20 4:20 PM, Dan Williams wrote: > > In support of detecting whether a resource might have been been claimed, > > report the parent to the walk_iomem_res_desc() callback. For example, > > the ACPI HMAT parser publishes "hmem" platform devices per target range. > > However, if the HMAT is disabled / missing a fallback driver can attach > > devices to the raw memory ranges as a fallback if it sees unclaimed / > > orphan "Soft Reserved" resources in the resource tree. > > > > Otherwise, find_next_iomem_res() returns a resource with garbage data > > from the stack allocation in __walk_iomem_res_desc() for the res->parent > > field. > > Just wondering if we shouldn't just copy the complete resource struct and > just override the start and end values? That way, if some code in the > future wants to look at sibling or child values, another change isn't needed. > > Just a thought. Thanks for taking a look. I think it's ok to come update this again if that need arises.