On 02/11/2018 16:40, Keith Busch wrote: > Hey, so why is this memory region access even considered valid if the > request is out of range from what NVMe had registered for its > MemoryRegion? Wouldn't it be better to not call the mr->ops->read/write > if it's out of bounds? Otherwise every MemoryRegion needs to duplicate > the same check, right?
Because some crazy devices have misaligned registers. But actually this is not a problem because NVMe doesn't set ops->impl.unaligned to true, so indeed no change is needed. Paolo > Would something like the following work (minimally tested)?