All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Julien Grall <julien@xen.org>,
	xen-devel@lists.xenproject.org,
	Volodymyr Babchuk <Volodymyr_Babchuk@epam.com>,
	Wei Liu <wl@xen.org>
Cc: scott.davis@starlab.io, jandryuk@gmail.com,
	christopher.clark@starlab.io,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Bertrand Marquis" <bertrand.marquis@arm.com>,
	"Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"George Dunlap" <george.dunlap@citrix.com>,
	"Dario Faggioli" <dfaggioli@suse.com>,
	"Daniel De Graaf" <dgdegra@tycho.nsa.gov>
Subject: Re: [PATCH v6 1/2] xsm: create idle domain privileged and demote after setup
Date: Wed, 11 May 2022 07:06:37 -0400	[thread overview]
Message-ID: <ec7e2b3b-c756-ad6b-1b8d-79beb0f2339a@apertussolutions.com> (raw)
In-Reply-To: <abad832f-9007-d056-f280-c7463d80eed3@xen.org>

On 5/9/22 14:38, Julien Grall wrote:
> Hi Daniel,
> 
> On 03/05/2022 12:17, Daniel P. Smith wrote:
>> There are new capabilities, dom0less and hyperlaunch, that introduce
>> internal
>> hypervisor logic which needs to make resource allocation calls that are
>> protected by XSM access checks. This creates an issue as a subset of the
>> hypervisor code is executed under a system domain, the idle domain,
>> that is
>> represented by a per-CPU non-privileged struct domain. To enable these
>> new
>> capabilities to function correctly but in a controlled manner, this
>> commit
>> changes the idle system domain to be created as a privileged domain
>> under the
>> default policy and demoted before transitioning to running. A new XSM
>> hook,
>> xsm_set_system_active(), is introduced to allow each XSM policy type
>> to demote
>> the idle domain appropriately for that policy type. In the case of
>> SILO, it
>> inherits the default policy's hook for xsm_set_system_active().
>>
>> For flask a stub is added to ensure that flask policy system will
>> function
>> correctly with this patch until flask is extended with support for
>> starting the
>> idle domain privileged and properly demoting it on the call to
>> xsm_set_system_active().
>>
>> Signed-off-by: Daniel P. Smith <dpsmith@apertussolutions.com>
>> Reviewed-by: Jason Andryuk <jandryuk@gmail.com>
>> ---
>>   xen/arch/arm/setup.c    |  4 ++++
>>   xen/arch/x86/setup.c    |  5 +++++
>>   xen/common/sched/core.c |  7 ++++++-
>>   xen/include/xsm/dummy.h | 17 +++++++++++++++++
>>   xen/include/xsm/xsm.h   |  6 ++++++
>>   xen/xsm/dummy.c         |  1 +
>>   xen/xsm/flask/hooks.c   | 23 +++++++++++++++++++++++
>>   7 files changed, 62 insertions(+), 1 deletion(-)
>>
>> diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
>> index d5d0792ed4..39a654926d 100644
>> --- a/xen/arch/arm/setup.c
>> +++ b/xen/arch/arm/setup.c
>> @@ -1048,6 +1048,10 @@ void __init start_xen(unsigned long
>> boot_phys_offset,
>>       /* Hide UART from DOM0 if we're using it */
>>       serial_endboot();
>>   +    if ( (rc = xsm_set_system_active()) != 0 )
>> +        panic("xsm(err=%d): "
>> +              "unable to set hypervisor to SYSTEM_ACTIVE
>> privilege\n", rc);
> 
> We usually don't split error message over multiple lines (even if they
> are over 80 characters).
> 
>> +
>>       system_state = SYS_STATE_active;
>>         for_each_domain( d )
>> diff --git a/xen/arch/x86/setup.c b/xen/arch/x86/setup.c
>> index 6f20e17892..36a60ce884 100644
>> --- a/xen/arch/x86/setup.c
>> +++ b/xen/arch/x86/setup.c
>> @@ -620,6 +620,11 @@ static void noreturn init_done(void)
>>   {
>>       void *va;
>>       unsigned long start, end;
>> +    int err;
>> +
>> +    if ( (err = xsm_set_system_active()) != 0 )
>> +        panic("xsm(err=%d): "
>> +              "unable to set hypervisor to SYSTEM_ACTIVE
>> privilege\n", err);
> 
> Same here.
> 
> Other than the two remarks above and Luca's one:
> 
> Acked-by: Julien Grall <jgrall@amazon.com> # arm

Ack.

v/r,
dps


  reply	other threads:[~2022-05-11 11:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-03 11:17 [PATCH v6 0/2] Adds starting the idle domain privileged Daniel P. Smith
2022-05-03 11:17 ` [PATCH v6 1/2] xsm: create idle domain privileged and demote after setup Daniel P. Smith
2022-05-03 12:27   ` Luca Fancellu
2022-05-03 13:17   ` Luca Fancellu
2022-05-09 18:33     ` Julien Grall
2022-05-11 11:05       ` Daniel P. Smith
2022-05-11 11:05     ` Daniel P. Smith
2022-05-09 18:38   ` Julien Grall
2022-05-11 11:06     ` Daniel P. Smith [this message]
2022-05-03 11:17 ` [PATCH v6 2/2] flask: implement xsm_set_system_active Daniel P. Smith
2022-05-03 13:23   ` Luca Fancellu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ec7e2b3b-c756-ad6b-1b8d-79beb0f2339a@apertussolutions.com \
    --to=dpsmith@apertussolutions.com \
    --cc=Volodymyr_Babchuk@epam.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=bertrand.marquis@arm.com \
    --cc=christopher.clark@starlab.io \
    --cc=dfaggioli@suse.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=george.dunlap@citrix.com \
    --cc=jandryuk@gmail.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=roger.pau@citrix.com \
    --cc=scott.davis@starlab.io \
    --cc=sstabellini@kernel.org \
    --cc=wl@xen.org \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.