From: Ulrich Wulff <[email protected]>

Move setting HCR_EL2.FB from disable to shutdown.

Signed-off-by: Ulrich wulff <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
---
 hypervisor/arch/arm64/setup.c | 2 +-
 hypervisor/control.c          | 7 -------
 2 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/hypervisor/arch/arm64/setup.c b/hypervisor/arch/arm64/setup.c
index dbcba6691729a..21afdb7ae174d 100644
--- a/hypervisor/arch/arm64/setup.c
+++ b/hypervisor/arch/arm64/setup.c
@@ -123,7 +123,7 @@ void arch_shutdown_self(struct per_cpu *cpu_data)
        irqchip_cpu_shutdown(&cpu_data->public);
 
        /* Free the guest */
-       arm_write_sysreg(HCR_EL2, HCR_RW_BIT);
+       arm_write_sysreg(HCR_EL2, HCR_RW_BIT | HCR_FB_BIT);
        arm_write_sysreg(VTCR_EL2, VTCR_RES1);
 
        /* Remove stage-2 mappings */
diff --git a/hypervisor/control.c b/hypervisor/control.c
index a7bcd060ab0ed..3ad8ee48967b4 100644
--- a/hypervisor/control.c
+++ b/hypervisor/control.c
@@ -826,7 +826,6 @@ static int hypervisor_disable(struct per_cpu *cpu_data)
        unsigned int this_cpu = cpu_data->public.cpu_id;
        unsigned int cpu;
        int state, ret;
-       u64 hcr_el2;
 
        /* We do not support shutdown over non-root cells. */
        if (cpu_data->public.cell != &root_cell)
@@ -858,12 +857,6 @@ static int hypervisor_disable(struct per_cpu *cpu_data)
         */
        spin_lock(&shutdown_lock);
 
-       /* set the FB bit in HCR_EL2 */
-       arm_read_sysreg(HCR_EL2, hcr_el2);
-       hcr_el2 |= HCR_FB_BIT;
-       arm_write_sysreg(HCR_EL2, hcr_el2);
-       printk("Set the FB bit in HCR_EL2\n");
-
        if (cpu_data->public.shutdown_state == SHUTDOWN_NONE) {
                state = num_cells == 1 ? SHUTDOWN_STARTED : -EBUSY;
                for_each_cpu(cpu, root_cell.cpu_set)
-- 
2.40.1

-- 
You received this message because you are subscribed to the Google Groups 
"Jailhouse" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jailhouse-dev/20230602074808.1383333-4-bigeasy%40linutronix.de.

Reply via email to