|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/6] xen: use domid check in is_hardware_domain
On 03/05/2014 04:23 AM, Jan Beulich wrote: On 04.03.14 at 23:51, Daniel De Graaf <dgdegra@xxxxxxxxxxxxx> wrote:The hardware domain manages devices for PCI pass-through to driver domains or can act as a driver domain itself, depending on the desired degree of disaggregation. It is also the domain managing devices that do not support pass-through: PCI configuration space access, parsing the hardware ACPI tables and system power or machine check events. This is the only domain where is_hardware_domain() is true. The return of is_control_domain() is false for this domain."s/is/may be/" ? I had intended this sentence to describe the model, where the return is always false. However, I agree with the change to avoid confusion that the two is_*_domain() functions are exclusive.
Agreed, the hardware domain also needs to be checked for here. The reason the control domain is present is that it needs to see real CPUID values in order to set CPUID policy for guests based on the real hardware values.
OK. I prefer to avoid the if (!foo) bar; else baz; construct where possible, but common case first is a good reason to use it.
I don't directly consider profiling to be a control domain property, but I also don't consider it a hardware domain property, and it does need to be restricted in some way. I could make a separate patch changing the condition to use an XSM hook, only setting xenoprof_primary_profiler if the domain is allowed the XEN__PRIVPROFILE permission, but this still could cause multiple domains to be eligible. From my cursory examination when I made this change, the first domain to try becoming the primary profiler will succeed and be assigned to xenoprof_primary_profiler. Later domains will not be considered since the primary will already be set. One thing I had not considered that may be a problem: if the profiling domain is shut down without calling XENOPROF_shutdown, it will not be possible to use profiling this boot unless the struct domain* is reused. This may then become a security issue because an arbitrary domain is now the primary profiler, although the XSM policy should prevent any actions by a domain not permitted to use the profiling hypercalls. Using is_hardware_domain here avoids that problem (as the hardware domain may never shut down or be destroyed), so that may be the simplest solution until a better model of who is responsible for profiling is presented. -- Daniel De Graaf National Security Agency _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |