)]}'
{
  "commit": "2f859f80c2077e00237ea1dfae2523ebd8377f5f",
  "tree": "affe829e79f5b4072983cc50b7bf7b9b9ca5a4fb",
  "parents": [
    "22227f121bddb038a0335cf83a3c24f451e2e836"
  ],
  "author": {
    "name": "Laszlo Ersek",
    "email": "lersek@redhat.com",
    "time": "Tue May 20 13:39:44 2014 +0200"
  },
  "committer": {
    "name": "Luiz Capitulino",
    "email": "lcapitulino@redhat.com",
    "time": "Wed Jun 11 10:10:28 2014 -0400"
  },
  "message": "dump: eliminate DumpState.page_size (\"guest\u0027s page size\")\n\nUse TARGET_PAGE_SIZE and ~TARGET_PAGE_MASK instead.\n\n\"DumpState.page_size\" has type \"size_t\", whereas TARGET_PAGE_SIZE has type\n\"int\". TARGET_PAGE_MASK is of type \"int\" and has negative value. The patch\naffects the implicit type conversions as follows:\n\n- create_header32() and create_header64(): assigned to \"block_size\", which\n  has type \"uint32_t\". No change.\n\n- get_next_page(): \"block-\u003etarget_start\", \"block-\u003etarget_end\" and \"addr\"\n  have type \"hwaddr\" (uint64_t).\n\n  Before the patch,\n  - if \"size_t\" was \"uint64_t\", then no additional conversion was done as\n    part of the usual arithmetic conversions,\n  - If \"size_t\" was \"uint32_t\", then it was widened to uint64_t as part of\n    the usual arithmetic conversions,\n  for the remainder and addition operators.\n\n  After the patch,\n  - \"~TARGET_PAGE_MASK\" expands to  ~~((1 \u003c\u003c TARGET_PAGE_BITS) - 1). It\n    has type \"int\" and positive value (only least significant bits set).\n    That\u0027s converted (widened) to \"uint64_t\" for the bit-ands. No visible\n    change.\n  - The same holds for the (addr + TARGET_PAGE_SIZE) addition.\n\n- write_dump_pages():\n  - TARGET_PAGE_SIZE passed as argument to a bunch of functions that all\n    have prototypes. No change.\n\n  - When incrementing \"offset_data\" (of type \"off_t\"): given that we never\n    build for ILP32_OFF32 (see \"-D_FILE_OFFSET_BITS\u003d64\" in configure),\n    \"off_t\" is always \"int64_t\", and we only need to consider:\n    - ILP32_OFFBIG: \"size_t\" is \"uint32_t\".\n      - before: int64_t +\u003d uint32_t. Page size converted to int64_t for\n        the addition.\n      - after:  int64_t +\u003d int32_t. No change.\n    - LP64_OFF64: \"size_t\" is \"uint64_t\".\n      - before: int64_t +\u003d uint64_t. Offset converted to uint64_t for the\n        addition, then the uint64_t result is converted to int64_t for\n        storage.\n      - after:  int64_t +\u003d int32_t. Same as the ILP32_OFFBIG/after case.\n        No visible change.\n\n  - (size_out \u003c s-\u003epage_size) comparisons, and (size_out \u003d s-\u003epage_size)\n    assignment:\n    - before: \"size_out\" is of type \"size_t\", no implicit conversion for\n              either operator.\n    - after: TARGET_PAGE_SIZE (of type \"int\" and positive value) is\n             converted to \"size_t\" (for the relop because the latter is\n             one of \"uint32_t\" and \"uint64_t\"). No visible change.\n\n- dump_init():\n  - DIV_ROUND_UP(DIV_ROUND_UP(s-\u003emax_mapnr, CHAR_BIT), s-\u003epage_size): The\n    innermost \"DumpState.max_mapnr\" field has type uint64_t, which\n    propagates through all implicit conversions at hand:\n\n    #define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))\n\n    regardless of the page size macro argument\u0027s type. In the outer macro\n    replacement, the page size is converted from uint32_t and int32_t\n    alike to uint64_t.\n\n  - (tmp * s-\u003epage_size) multiplication: \"tmp\" has size \"uint64_t\"; the\n    RHS is converted to that type from uint32_t and int32_t just the same\n    if it\u0027s not uint64_t to begin with.\n\nSigned-off-by: Laszlo Ersek \u003clersek@redhat.com\u003e\nReviewed-by: Paolo Bonzini \u003cpbonzini@redhat.com\u003e\nSigned-off-by: Luiz Capitulino \u003clcapitulino@redhat.com\u003e\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "cde14d9d7560926c101ff525732a12e317b916c6",
      "old_mode": 33188,
      "old_path": "dump.c",
      "new_id": "e0a606fbbc2afe2ddbd6440ab111889e203b6c7f",
      "new_mode": 33188,
      "new_path": "dump.c"
    }
  ]
}
