mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 02:21:52 +09:00
Revert "irqchip/gic-v4: Don't allow a VMOVP on a dying VPE"
This reverts commit 64b12b061c which is
commit 1442ee0011983f0c5c4b92380e6853afb513841a upstream.
It breaks the Android kernel abi and can be brought back in the future
in an abi-safe way if it is really needed.
Bug: 161946584
Change-Id: Ia5031b51ea15d52b9b2183de4fa1c9871559bb03
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -793,8 +793,8 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its,
|
||||
its_encode_valid(cmd, desc->its_vmapp_cmd.valid);
|
||||
|
||||
if (!desc->its_vmapp_cmd.valid) {
|
||||
alloc = !atomic_dec_return(&desc->its_vmapp_cmd.vpe->vmapp_count);
|
||||
if (is_v4_1(its)) {
|
||||
alloc = !atomic_dec_return(&desc->its_vmapp_cmd.vpe->vmapp_count);
|
||||
its_encode_alloc(cmd, alloc);
|
||||
/*
|
||||
* Unmapping a VPE is self-synchronizing on GICv4.1,
|
||||
@@ -813,13 +813,13 @@ static struct its_vpe *its_build_vmapp_cmd(struct its_node *its,
|
||||
its_encode_vpt_addr(cmd, vpt_addr);
|
||||
its_encode_vpt_size(cmd, LPI_NRBITS - 1);
|
||||
|
||||
alloc = !atomic_fetch_inc(&desc->its_vmapp_cmd.vpe->vmapp_count);
|
||||
|
||||
if (!is_v4_1(its))
|
||||
goto out;
|
||||
|
||||
vconf_addr = virt_to_phys(page_address(desc->its_vmapp_cmd.vpe->its_vm->vprop_page));
|
||||
|
||||
alloc = !atomic_fetch_inc(&desc->its_vmapp_cmd.vpe->vmapp_count);
|
||||
|
||||
its_encode_alloc(cmd, alloc);
|
||||
|
||||
/*
|
||||
@@ -3795,13 +3795,6 @@ static int its_vpe_set_affinity(struct irq_data *d,
|
||||
unsigned long flags;
|
||||
int from, cpu;
|
||||
|
||||
/*
|
||||
* Check if we're racing against a VPE being destroyed, for
|
||||
* which we don't want to allow a VMOVP.
|
||||
*/
|
||||
if (!atomic_read(&vpe->vmapp_count))
|
||||
return -EINVAL;
|
||||
|
||||
/*
|
||||
* Changing affinity is mega expensive, so let's be as lazy as
|
||||
* we can and only do it if we really have to. Also, if mapped
|
||||
@@ -4438,8 +4431,9 @@ static int its_vpe_init(struct its_vpe *vpe)
|
||||
raw_spin_lock_init(&vpe->vpe_lock);
|
||||
vpe->vpe_id = vpe_id;
|
||||
vpe->vpt_page = vpt_page;
|
||||
atomic_set(&vpe->vmapp_count, 0);
|
||||
if (!gic_rdists->has_rvpeid)
|
||||
if (gic_rdists->has_rvpeid)
|
||||
atomic_set(&vpe->vmapp_count, 0);
|
||||
else
|
||||
vpe->vpe_proxy_event = -1;
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -58,12 +58,10 @@ struct its_vpe {
|
||||
bool enabled;
|
||||
bool group;
|
||||
} sgi_config[16];
|
||||
atomic_t vmapp_count;
|
||||
};
|
||||
};
|
||||
|
||||
/* Track the VPE being mapped */
|
||||
atomic_t vmapp_count;
|
||||
|
||||
/*
|
||||
* Ensures mutual exclusion between affinity setting of the
|
||||
* vPE and vLPI operations using vpe->col_idx.
|
||||
|
||||
Reference in New Issue
Block a user