Skip to content

Commit

Permalink
KVM: arm/arm64: Get rid of its->initialized field
Browse files Browse the repository at this point in the history
The its->initialized doesn't bring much to the table, and creates
unnecessary ordering between setting the address and initializing it
(which amounts to exactly nothing).

Let's kill it altogether, making KVM_DEV_ARM_VGIC_CTRL_INIT the no-op
it deserves to be.

Signed-off-by: Marc Zyngier <[email protected]>
Signed-off-by: Christoffer Dall <[email protected]>
Reviewed-by: Eric Auger <[email protected]>
  • Loading branch information
Marc Zyngier authored and Christoffer Dall committed May 9, 2017
1 parent 1aab6f4 commit 6cc40f2
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
1 change: 0 additions & 1 deletion include/kvm/arm_vgic.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ struct vgic_its {
gpa_t vgic_its_base;

bool enabled;
bool initialized;
struct vgic_io_device iodev;
struct kvm_device *dev;

Expand Down
7 changes: 1 addition & 6 deletions virt/kvm/arm/vgic/vgic-its.c
Original file line number Diff line number Diff line change
Expand Up @@ -1545,9 +1545,6 @@ static int vgic_register_its_iodev(struct kvm *kvm, struct vgic_its *its)
struct vgic_io_device *iodev = &its->iodev;
int ret;

if (!its->initialized)
return -EBUSY;

if (IS_VGIC_ADDR_UNDEF(its->vgic_its_base))
return -ENXIO;

Expand Down Expand Up @@ -1597,7 +1594,6 @@ static int vgic_its_create(struct kvm_device *dev, u32 type)
INIT_LIST_HEAD(&its->collection_list);

dev->kvm->arch.vgic.has_its = true;
its->initialized = false;
its->enabled = false;
its->dev = dev;

Expand Down Expand Up @@ -2397,8 +2393,7 @@ static int vgic_its_set_attr(struct kvm_device *dev,

switch (attr->attr) {
case KVM_DEV_ARM_VGIC_CTRL_INIT:
its->initialized = true;

/* Nothing to do */
return 0;
case KVM_DEV_ARM_ITS_SAVE_TABLES:
return abi->save_tables(its);
Expand Down

0 comments on commit 6cc40f2

Please sign in to comment.