From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from mail.kernel.org (mail.kernel.org [198.145.29.99])
 by mx.groups.io with SMTP id smtpd.web08.5711.1637759255281758512
 for <devel@edk2.groups.io>;
 Wed, 24 Nov 2021 05:07:35 -0800
Authentication-Results: mx.groups.io;
 dkim=pass header.i=@kernel.org header.s=k20201202 header.b=fAl/qEGZ;
 spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org)
Received: by mail.kernel.org (Postfix) with ESMTPSA id 7F58E633BD
	for <devel@edk2.groups.io>; Wed, 24 Nov 2021 13:07:34 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org;
	s=k20201202; t=1637759254;
	bh=y2cV4P/dM0MyFax0lhXVUERzHVW9irRnCEuYKKEKIj0=;
	h=References:In-Reply-To:From:Date:Subject:To:Cc:From;
	b=fAl/qEGZ5pn7WqxsrllZg2ENAivq6jKhqP7CQjt3M9XZl9OQMRCs+ksZ5F0qZ1Pn/
	 yY6DWNixkS4HhUyPn/p2H4rbt/2iWC+zFVY8KSFZ/TntvchZrauUqyE4NEgFy+8w1h
	 XrYhBwL6q+gw1u/1T205ftnnFTiKdijOULavnBEPWyXrSBWWz9ErWek6XRzdbfUO1o
	 BYTGB+6plK/baHcMILcgw7/F6WM7YzhEnQSgWB4zJYpxY/r5AJq3ntqwyUEFgAkr4B
	 y0i4eeWP5eXDq8KiOS3n9zF4FgepWhKqCehP5m9QmKo8jTreiy8kQ3zbV8WugOJHg+
	 LUPkkNKYKgsjQ==
Received: by mail-ot1-f45.google.com with SMTP id n17-20020a9d64d1000000b00579cf677301so4118354otl.8
        for <devel@edk2.groups.io>; Wed, 24 Nov 2021 05:07:34 -0800 (PST)
X-Gm-Message-State: AOAM532Ks9xLEIYlr8WZo2WD/2b5FbGn4xo9VzOFbWlcv9vhhAzLMUWQ
	JCHlpTQ7Hxx7pzLqVbbtSDLdd+qR3m/cgK5j6CI=
X-Google-Smtp-Source: ABdhPJzScoMsFxSdjVeqMQVovtFk9STm+RmukTy2KsHQI29WaDmFXIrmag95hjQefsy+O7Y5GWjq+l4kvvLjaztS/XU=
X-Received: by 2002:a9d:6c54:: with SMTP id g20mr13225504otq.30.1637759253721;
 Wed, 24 Nov 2021 05:07:33 -0800 (PST)
MIME-Version: 1.0
References: <20211116113301.31088-1-sami.mujawar@arm.com> <20211116113301.31088-3-sami.mujawar@arm.com>
 <YZ4q/jsJHt5o+Ra/@leviathan> <CAMj1kXG+Ovfjbyyc7N6GJB7-DVp=wPuEF7RA+bGhQxTRyriURg@mail.gmail.com>
 <YZ44lsc/LYS8nhr4@leviathan>
In-Reply-To: <YZ44lsc/LYS8nhr4@leviathan>
From: "Ard Biesheuvel" <ardb@kernel.org>
Date: Wed, 24 Nov 2021 14:07:22 +0100
X-Gmail-Original-Message-ID: <CAMj1kXEvi1QJdMOr2qAmr80Rw3LtvpAq4GPv5BhVrQ=UEUhPAA@mail.gmail.com>
Message-ID: <CAMj1kXEvi1QJdMOr2qAmr80Rw3LtvpAq4GPv5BhVrQ=UEUhPAA@mail.gmail.com>
Subject: Re: [PATCH v2 2/8] ArmPkg: PCD to select conduit for monitor calls
To: Leif Lindholm <leif@nuviainc.com>
Cc: Sami Mujawar <sami.mujawar@arm.com>, Ard Biesheuvel <ardb+tianocore@kernel.org>, 
	edk2-devel-groups-io <devel@edk2.groups.io>, Rebecca Cran <rebecca@bsdio.com>, 
	Gerd Hoffmann <kraxel@redhat.com>, Michael Kinney <michael.d.kinney@intel.com>, 
	"Liming Gao (Byosoft address)" <gaoliming@byosoft.com.cn>, Zhiguang Liu <zhiguang.liu@intel.com>, 
	Jiewen Yao <jiewen.yao@intel.com>, Jian J Wang <jian.j.wang@intel.com>, Matteo.Carlini@arm.com, 
	Akanksha.Jain2@arm.com, Ben.Adderson@arm.com, nd <nd@arm.com>
Content-Type: text/plain; charset="UTF-8"

On Wed, 24 Nov 2021 at 14:05, Leif Lindholm <leif@nuviainc.com> wrote:
>
> On Wed, Nov 24, 2021 at 14:03:51 +0100, Ard Biesheuvel wrote:
> > On Wed, 24 Nov 2021 at 13:07, Leif Lindholm <leif@nuviainc.com> wrote:
> > >
> > > Ard - how does this interact with e.g. ArmVirtPsciResetSystemLib,
> > > which reads its conduit out of the DT passed to it by QEMU?
> > >
> >
> > As long as ArmCallSmc() and ArmCallHvc() continue to exist and behave
> > as before, I don't think those libraries are affected.
>
> Well, I was thinking more that you can now end up with a firmware
> build where the conduit is sometimes dynamically determined, and
> sometimes compile-time determined.
>

There is nothing wrong with that by itself: if you have a DT that
describes this, it makes sense to carry support for both. If the bare
metal you are targetting only ever uses SMC, no need for the discovery
and a PCD is fine.

Question remains whether this PCD could/should be configurable as
dynamic, so we collapse the static/dynamic options into a single PCD
based choice.