From: Jacob Lifshay Date: Mon, 4 Dec 2023 10:13:52 +0000 (-0800) Subject: MemMMap: use modified_pages.discard instead of remove since pages may not be modified X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b81986476c4f62dc1ff25cd92e3f325027c4b582;p=openpower-isa.git MemMMap: use modified_pages.discard instead of remove since pages may not be modified --- diff --git a/src/openpower/decoder/isa/mem.py b/src/openpower/decoder/isa/mem.py index ddb3b886..4947e9b1 100644 --- a/src/openpower/decoder/isa/mem.py +++ b/src/openpower/decoder/isa/mem.py @@ -651,7 +651,7 @@ class MemMMap(MemCommon): # mark pages as empty for page_idx in block.page_indexes: self.__page_flags.pop(page_idx) - self.modified_pages.remove(page_idx) + self.modified_pages.discard(page_idx) return retval def __mmap_emu_zero_block(self, block): @@ -716,13 +716,13 @@ class MemMMap(MemCommon): return None for page_idx in r: self.__page_flags.pop(page_idx) - self.modified_pages.remove(page_idx) + self.modified_pages.discard(page_idx) else: # expanding -- map pages at end, they're cleared already r = range(block.page_indexes.stop, new_block.page_indexes.stop) for page_idx in r: self.__page_flags[page_idx] = block.flags - self.modified_pages.remove(page_idx) # cleared page + self.modified_pages.discard(page_idx) # cleared page self.__mmap_emu_alloc_blocks.remove(block) self.__mmap_emu_alloc_blocks.add(new_block) return new_block