[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] x86/domain: restrict context switch hooks for the idle domain



From: Grygorii Strashko <grygorii_strashko@xxxxxxxx>

The arch_init_idle_domain() initializes struct arch_csw idle_csw as:

    static const struct arch_csw idle_csw = {
        .from = paravirt_ctxt_switch_from,
        .to   = paravirt_ctxt_switch_to,
        .tail = idle_loop,
    };

but only place where d->arch.ctxt_switch->{to,from}() are used is
__context_switch() where they are both guarded by !is_idle_domain(pd)
which makes the callbacks in idle_csw unreachable.

Drop to/from() callbacks initialization in idle_csw.

Signed-off-by: Grygorii Strashko <grygorii_strashko@xxxxxxxx>
Signed-off-by: Roger Pau Monné <roger@xxxxxxxxxxxxxx>
---
I don't think there's a suitable Fixes candidate here.  The idle domain
hooks used to piggyback on the PV ones, and commit ab914e04a6272 split
those out into it's own structure.  At that point the to/from hooks could
have been left zeroed, but that wasn't the point of that commit anyway.
---
 xen/arch/x86/domain.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c
index 996b50af7a17..464ca6f39026 100644
--- a/xen/arch/x86/domain.c
+++ b/xen/arch/x86/domain.c
@@ -813,8 +813,6 @@ static bool emulation_flags_ok(const struct domain *d, 
uint32_t emflags)
 void __init arch_init_idle_domain(struct domain *d)
 {
     static const struct arch_csw idle_csw = {
-        .from = paravirt_ctxt_switch_from,
-        .to   = paravirt_ctxt_switch_to,
         .tail = idle_loop,
     };
 
-- 
2.55.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.