[bug-fix] about guest access GICD_ICFGRn

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

 



Hi, I use the kernel which version is 3.12 - rc7 .  About the vgic module, in the handle_mmio_cfg_reg function :

In program, we all know that we use the bitmap to save the GICD_ICFGRn value (need two bits pre irq). so we use

the vgic_cfg_expand and the vgic_cfg_compress functions.

 

But, i think we pass the wrong parameter about offset in caller the vgic_reg_access function.

for example , we access GICD_ICFGR3(offset value is 0xc), when the vgic_reg_access function is called, and then the offset value is 0x6 (as above say, for compress).

 in  vgic_reg_access function :

static void vgic_reg_access(struct kvm_exit_mmio *mmio, u32 *reg,
       phys_addr_t offset, int mode)
{
 int word_offset = (offset & 3) * 8;
 u32 mask = (1UL << (mmio->len * 8)) - 1;
 u32 regval;

 u32 data = "" mask) << word_offset;

mmio_data_write_32bits(mmio, mask, regval >> word_offset);

 

the word_offset value is 16 . that is not we expect . isn't it ?

diff --git a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
index 685fc72..6699ed9 100644
--- a/virt/kvm/arm/vgic.c
+++ b/virt/kvm/arm/vgic.c
@@ -553,7 +553,7 @@ static bool handle_mmio_cfg_reg(struct kvm_vcpu *vcpu,
                val = *reg & 0xffff;

        val = vgic_cfg_expand(val);
-       vgic_reg_access(mmio, &val, offset,
+       vgic_reg_access(mmio, &val, offset << 1,
                        ACCESS_READ_VALUE | ACCESS_WRITE_VALUE);
        if (mmio->is_write) {
                if (offset < 4) {

--
Regards
Wang Haibin
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm

[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux