Skip to contentSkip to conversation

Single 64bit memory transaction instead of two 32bit memory transaction.

Qemu-devel Adnan Khaleel 2 participants 2 messages Nov 8, 2010 – Nov 9, 2010

lore
Share & tools
lore
#0 lore raw

In the file exec.c:

The memory Write/Read functions are declared as an array of 4 entries where the index values of 0,1,2 correspond to 8,16 and 32bit write and read functions respectively.

CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4]; CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];

Is there any reason why we can't extend this to include 64bit writes and read by increasing the array size? This is because 64bit reads are currently handled as two separate 32bit reads for eg: sommu_template.h

static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr,
target_ulong addr, void *retaddr)
{
:

    res = io_mem_read[index][2](io_mem_opaque[index], physaddr);
    res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr + 4) << 32;
:
    return res;
}

I'm sure this is happening in other places as well. Is there a reason for this or could we arbitrarily increase this (within limits ofcourse)?

Thanks

AK

#1 lore raw
Quoted 25 lines · Adnan Khaleel

In the file exec.c:

The memory Write/Read functions are declared as an array of 4 entries where the index values of 0,1,2 correspond to 8,16 and 32bit write and read functions respectively.

CPUWriteMemoryFunc *io_mem_write[IO_MEM_NB_ENTRIES][4]; CPUReadMemoryFunc *io_mem_read[IO_MEM_NB_ENTRIES][4];

Is there any reason why we can't extend this to include 64bit writes and read by increasing the array size? This is because 64bit reads are currently handled as two separate 32bit reads for eg: sommu_template.h

static inline DATA_TYPE glue(io_read, SUFFIX)(target_phys_addr_t physaddr, target_ulong addr, void *retaddr)
{
:
    res = io_mem_read[index][2](io_mem_opaque[index], physaddr); res |= (uint64_t)io_mem_read[index][2](io_mem_opaque[index], physaddr +
4) << 32;
:
    return res;
}

Quoted 2 lines

I'm sure this is happening in other places as well. Is there a reason for this or could we arbitrarily increase this (within limits ofcourse)?

Legacy. Patches have been submitted to add 64 bit IO handlers. But there have been other discussions to change the whole I/O interface.