{"action":"created","comment":{"url":"https://api.github.com/repos/SESA/EbbRT/pulls/comments/73552804","id":73552804,"diff_hunk":"@@ -15,6 +15,33 @@\n #include <ebbrt/VMemAllocator.h>\n \n namespace ebbrt {\n+\n+// page fault handler for mapping in physical pages\n+// to virtual pages on all cores\n+class LargeRegionFaultHandler : public ebbrt::VMemAllocator::PageFaultHandler {\n+  std::map<uintptr_t, ebbrt::Pfn> tmap;\n+  size_t ps = 2 * 1024 * 1024;  // large page size\n+\n+ public:\n+  void SetMap(std::map<uintptr_t, ebbrt::Pfn> m) { tmap = std::move(m); }\n+\n+  // given faulted address, calculates virtual page frame and finds\n+  // corresponding physical page frame in tmap table, then calls\n+  // MapMemory to do actual mapping\n+  void HandleFault(ebbrt::idt::ExceptionFrame* ef,\n+                   uintptr_t faulted_address) override {\n+    auto vpage = ebbrt::Pfn::LDown(faulted_address);\n+    auto it = tmap.find(vpage.ToLAddr());\n+    if (likely(it != tmap.end())) {\n+      ebbrt::vmem::MapMemoryLarge(it->first, it->second, ps);\n+    } else {\n+      kabort(\"%s: abort in large region fault handler, cannot find 0x%lx in \"\n+             \"map table.\\n\",\n+             __PRETTY_FUNCTION__, vpage.ToLAddr());\n+    }\n+  }\n+};","path":"baremetal/src/include/ebbrt/GeneralPurposeAllocator.h","position":29,"original_position":29,"commit_id":"e563fbb718843f66fdbfef03017214ce4db4fe1a","original_commit_id":"e563fbb718843f66fdbfef03017214ce4db4fe1a","user":{"login":"handong32","id":8247145,"avatar_url":"https://avatars.githubusercontent.com/u/8247145?v=3","gravatar_id":"","url":"https://api.github.com/users/handong32","html_url":"https://github.com/handong32","followers_url":"https://api.github.com/users/handong32/followers","following_url":"https://api.github.com/users/handong32/following{/other_user}","gists_url":"https://api.github.com/users/handong32/gists{/gist_id}","starred_url":"https://api.github.com/users/handong32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handong32/subscriptions","organizations_url":"https://api.github.com/users/handong32/orgs","repos_url":"https://api.github.com/users/handong32/repos","events_url":"https://api.github.com/users/handong32/events{/privacy}","received_events_url":"https://api.github.com/users/handong32/received_events","type":"User","site_admin":false},"body":"I needed a VFN to PFN mapping? So a map made the most sense. Not sure about ordered vs unordered","created_at":"2016-08-04T16:10:17Z","updated_at":"2016-08-04T16:10:17Z","html_url":"https://github.com/SESA/EbbRT/pull/147#discussion_r73552804","pull_request_url":"https://api.github.com/repos/SESA/EbbRT/pulls/147","_links":{"self":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/comments/73552804"},"html":{"href":"https://github.com/SESA/EbbRT/pull/147#discussion_r73552804"},"pull_request":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/147"}}},"pull_request":{"url":"https://api.github.com/repos/SESA/EbbRT/pulls/147","id":79981946,"html_url":"https://github.com/SESA/EbbRT/pull/147","diff_url":"https://github.com/SESA/EbbRT/pull/147.diff","patch_url":"https://github.com/SESA/EbbRT/pull/147.patch","issue_url":"https://api.github.com/repos/SESA/EbbRT/issues/147","number":147,"state":"open","locked":false,"title":"fix(GeneralPurposeAllocator): page fault handler for mapping in large…","user":{"login":"handong32","id":8247145,"avatar_url":"https://avatars.githubusercontent.com/u/8247145?v=3","gravatar_id":"","url":"https://api.github.com/users/handong32","html_url":"https://github.com/handong32","followers_url":"https://api.github.com/users/handong32/followers","following_url":"https://api.github.com/users/handong32/following{/other_user}","gists_url":"https://api.github.com/users/handong32/gists{/gist_id}","starred_url":"https://api.github.com/users/handong32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handong32/subscriptions","organizations_url":"https://api.github.com/users/handong32/orgs","repos_url":"https://api.github.com/users/handong32/repos","events_url":"https://api.github.com/users/handong32/events{/privacy}","received_events_url":"https://api.github.com/users/handong32/received_events","type":"User","site_admin":false},"body":"… memory pages\r\n\r\nThere was no page fault handler for large memory pages in multi-core\r\nand they were set to nullptrs, which cause a secondary page fault. This fix\r\nkeeps a table of virtual to physical page mappings and uses it to do the same\r\nmapping on cores that suffer the fault on a virtual address.","created_at":"2016-08-03T21:25:35Z","updated_at":"2016-08-04T16:10:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f6ff054cb33df8648ac2b1d519e075a1f9abc03e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/SESA/EbbRT/pulls/147/commits","review_comments_url":"https://api.github.com/repos/SESA/EbbRT/pulls/147/comments","review_comment_url":"https://api.github.com/repos/SESA/EbbRT/pulls/comments{/number}","comments_url":"https://api.github.com/repos/SESA/EbbRT/issues/147/comments","statuses_url":"https://api.github.com/repos/SESA/EbbRT/statuses/e563fbb718843f66fdbfef03017214ce4db4fe1a","head":{"label":"handong32:large_memory_fix","ref":"large_memory_fix","sha":"e563fbb718843f66fdbfef03017214ce4db4fe1a","user":{"login":"handong32","id":8247145,"avatar_url":"https://avatars.githubusercontent.com/u/8247145?v=3","gravatar_id":"","url":"https://api.github.com/users/handong32","html_url":"https://github.com/handong32","followers_url":"https://api.github.com/users/handong32/followers","following_url":"https://api.github.com/users/handong32/following{/other_user}","gists_url":"https://api.github.com/users/handong32/gists{/gist_id}","starred_url":"https://api.github.com/users/handong32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handong32/subscriptions","organizations_url":"https://api.github.com/users/handong32/orgs","repos_url":"https://api.github.com/users/handong32/repos","events_url":"https://api.github.com/users/handong32/events{/privacy}","received_events_url":"https://api.github.com/users/handong32/received_events","type":"User","site_admin":false},"repo":{"id":53883007,"name":"EbbRT","full_name":"handong32/EbbRT","owner":{"login":"handong32","id":8247145,"avatar_url":"https://avatars.githubusercontent.com/u/8247145?v=3","gravatar_id":"","url":"https://api.github.com/users/handong32","html_url":"https://github.com/handong32","followers_url":"https://api.github.com/users/handong32/followers","following_url":"https://api.github.com/users/handong32/following{/other_user}","gists_url":"https://api.github.com/users/handong32/gists{/gist_id}","starred_url":"https://api.github.com/users/handong32/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/handong32/subscriptions","organizations_url":"https://api.github.com/users/handong32/orgs","repos_url":"https://api.github.com/users/handong32/repos","events_url":"https://api.github.com/users/handong32/events{/privacy}","received_events_url":"https://api.github.com/users/handong32/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/handong32/EbbRT","description":"Elastic building block runtime","fork":true,"url":"https://api.github.com/repos/handong32/EbbRT","forks_url":"https://api.github.com/repos/handong32/EbbRT/forks","keys_url":"https://api.github.com/repos/handong32/EbbRT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/handong32/EbbRT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/handong32/EbbRT/teams","hooks_url":"https://api.github.com/repos/handong32/EbbRT/hooks","issue_events_url":"https://api.github.com/repos/handong32/EbbRT/issues/events{/number}","events_url":"https://api.github.com/repos/handong32/EbbRT/events","assignees_url":"https://api.github.com/repos/handong32/EbbRT/assignees{/user}","branches_url":"https://api.github.com/repos/handong32/EbbRT/branches{/branch}","tags_url":"https://api.github.com/repos/handong32/EbbRT/tags","blobs_url":"https://api.github.com/repos/handong32/EbbRT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/handong32/EbbRT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/handong32/EbbRT/git/refs{/sha}","trees_url":"https://api.github.com/repos/handong32/EbbRT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/handong32/EbbRT/statuses/{sha}","languages_url":"https://api.github.com/repos/handong32/EbbRT/languages","stargazers_url":"https://api.github.com/repos/handong32/EbbRT/stargazers","contributors_url":"https://api.github.com/repos/handong32/EbbRT/contributors","subscribers_url":"https://api.github.com/repos/handong32/EbbRT/subscribers","subscription_url":"https://api.github.com/repos/handong32/EbbRT/subscription","commits_url":"https://api.github.com/repos/handong32/EbbRT/commits{/sha}","git_commits_url":"https://api.github.com/repos/handong32/EbbRT/git/commits{/sha}","comments_url":"https://api.github.com/repos/handong32/EbbRT/comments{/number}","issue_comment_url":"https://api.github.com/repos/handong32/EbbRT/issues/comments{/number}","contents_url":"https://api.github.com/repos/handong32/EbbRT/contents/{+path}","compare_url":"https://api.github.com/repos/handong32/EbbRT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/handong32/EbbRT/merges","archive_url":"https://api.github.com/repos/handong32/EbbRT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/handong32/EbbRT/downloads","issues_url":"https://api.github.com/repos/handong32/EbbRT/issues{/number}","pulls_url":"https://api.github.com/repos/handong32/EbbRT/pulls{/number}","milestones_url":"https://api.github.com/repos/handong32/EbbRT/milestones{/number}","notifications_url":"https://api.github.com/repos/handong32/EbbRT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/handong32/EbbRT/labels{/name}","releases_url":"https://api.github.com/repos/handong32/EbbRT/releases{/id}","deployments_url":"https://api.github.com/repos/handong32/EbbRT/deployments","created_at":"2016-03-14T18:51:24Z","updated_at":"2016-03-14T18:51:25Z","pushed_at":"2016-08-03T21:31:12Z","git_url":"git://github.com/handong32/EbbRT.git","ssh_url":"git@github.com:handong32/EbbRT.git","clone_url":"https://github.com/handong32/EbbRT.git","svn_url":"https://github.com/handong32/EbbRT","homepage":"","size":4028,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"SESA:master","ref":"master","sha":"c340c17b1e938cb0b6a7b8411642e60ee9f6ee04","user":{"login":"SESA","id":807950,"avatar_url":"https://avatars.githubusercontent.com/u/807950?v=3","gravatar_id":"","url":"https://api.github.com/users/SESA","html_url":"https://github.com/SESA","followers_url":"https://api.github.com/users/SESA/followers","following_url":"https://api.github.com/users/SESA/following{/other_user}","gists_url":"https://api.github.com/users/SESA/gists{/gist_id}","starred_url":"https://api.github.com/users/SESA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SESA/subscriptions","organizations_url":"https://api.github.com/users/SESA/orgs","repos_url":"https://api.github.com/users/SESA/repos","events_url":"https://api.github.com/users/SESA/events{/privacy}","received_events_url":"https://api.github.com/users/SESA/received_events","type":"Organization","site_admin":false},"repo":{"id":10059560,"name":"EbbRT","full_name":"SESA/EbbRT","owner":{"login":"SESA","id":807950,"avatar_url":"https://avatars.githubusercontent.com/u/807950?v=3","gravatar_id":"","url":"https://api.github.com/users/SESA","html_url":"https://github.com/SESA","followers_url":"https://api.github.com/users/SESA/followers","following_url":"https://api.github.com/users/SESA/following{/other_user}","gists_url":"https://api.github.com/users/SESA/gists{/gist_id}","starred_url":"https://api.github.com/users/SESA/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SESA/subscriptions","organizations_url":"https://api.github.com/users/SESA/orgs","repos_url":"https://api.github.com/users/SESA/repos","events_url":"https://api.github.com/users/SESA/events{/privacy}","received_events_url":"https://api.github.com/users/SESA/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/SESA/EbbRT","description":"Elastic building block runtime","fork":false,"url":"https://api.github.com/repos/SESA/EbbRT","forks_url":"https://api.github.com/repos/SESA/EbbRT/forks","keys_url":"https://api.github.com/repos/SESA/EbbRT/keys{/key_id}","collaborators_url":"https://api.github.com/repos/SESA/EbbRT/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/SESA/EbbRT/teams","hooks_url":"https://api.github.com/repos/SESA/EbbRT/hooks","issue_events_url":"https://api.github.com/repos/SESA/EbbRT/issues/events{/number}","events_url":"https://api.github.com/repos/SESA/EbbRT/events","assignees_url":"https://api.github.com/repos/SESA/EbbRT/assignees{/user}","branches_url":"https://api.github.com/repos/SESA/EbbRT/branches{/branch}","tags_url":"https://api.github.com/repos/SESA/EbbRT/tags","blobs_url":"https://api.github.com/repos/SESA/EbbRT/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/SESA/EbbRT/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/SESA/EbbRT/git/refs{/sha}","trees_url":"https://api.github.com/repos/SESA/EbbRT/git/trees{/sha}","statuses_url":"https://api.github.com/repos/SESA/EbbRT/statuses/{sha}","languages_url":"https://api.github.com/repos/SESA/EbbRT/languages","stargazers_url":"https://api.github.com/repos/SESA/EbbRT/stargazers","contributors_url":"https://api.github.com/repos/SESA/EbbRT/contributors","subscribers_url":"https://api.github.com/repos/SESA/EbbRT/subscribers","subscription_url":"https://api.github.com/repos/SESA/EbbRT/subscription","commits_url":"https://api.github.com/repos/SESA/EbbRT/commits{/sha}","git_commits_url":"https://api.github.com/repos/SESA/EbbRT/git/commits{/sha}","comments_url":"https://api.github.com/repos/SESA/EbbRT/comments{/number}","issue_comment_url":"https://api.github.com/repos/SESA/EbbRT/issues/comments{/number}","contents_url":"https://api.github.com/repos/SESA/EbbRT/contents/{+path}","compare_url":"https://api.github.com/repos/SESA/EbbRT/compare/{base}...{head}","merges_url":"https://api.github.com/repos/SESA/EbbRT/merges","archive_url":"https://api.github.com/repos/SESA/EbbRT/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/SESA/EbbRT/downloads","issues_url":"https://api.github.com/repos/SESA/EbbRT/issues{/number}","pulls_url":"https://api.github.com/repos/SESA/EbbRT/pulls{/number}","milestones_url":"https://api.github.com/repos/SESA/EbbRT/milestones{/number}","notifications_url":"https://api.github.com/repos/SESA/EbbRT/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/SESA/EbbRT/labels{/name}","releases_url":"https://api.github.com/repos/SESA/EbbRT/releases{/id}","deployments_url":"https://api.github.com/repos/SESA/EbbRT/deployments","created_at":"2013-05-14T16:28:36Z","updated_at":"2016-07-14T01:52:09Z","pushed_at":"2016-08-04T15:45:55Z","git_url":"git://github.com/SESA/EbbRT.git","ssh_url":"git@github.com:SESA/EbbRT.git","clone_url":"https://github.com/SESA/EbbRT.git","svn_url":"https://github.com/SESA/EbbRT","homepage":"","size":4146,"stargazers_count":7,"watchers_count":7,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":8,"mirror_url":null,"open_issues_count":5,"forks":8,"open_issues":5,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/147"},"html":{"href":"https://github.com/SESA/EbbRT/pull/147"},"issue":{"href":"https://api.github.com/repos/SESA/EbbRT/issues/147"},"comments":{"href":"https://api.github.com/repos/SESA/EbbRT/issues/147/comments"},"review_comments":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/147/comments"},"review_comment":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/SESA/EbbRT/pulls/147/commits"},"statuses":{"href":"https://api.github.com/repos/SESA/EbbRT/statuses/e563fbb718843f66fdbfef03017214ce4db4fe1a"}}}}
{"actor":{"display_login":"handong32"}}