{"action":"created","comment":{"url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/comments/192519218","pull_request_review_id":125310695,"id":192519218,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjUxOTIxOA==","diff_hunk":"@@ -0,0 +1,279 @@\n+//\n+// Bareflank Hypervisor\n+// Copyright (C) 2018 Assured Information Security, Inc.\n+//\n+// This library is free software; you can redistribute it and/or\n+// modify it under the terms of the GNU Lesser General Public\n+// License as published by the Free Software Foundation; either\n+// version 2.1 of the License, or (at your option) any later version.\n+//\n+// This library is distributed in the hope that it will be useful,\n+// but WITHOUT ANY WARRANTY; without even the implied warranty of\n+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n+// Lesser General Public License for more details.\n+//\n+// You should have received a copy of the GNU Lesser General Public\n+// License along with this library; if not, write to the Free Software\n+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\n+\n+#include <array>\n+#include <cstdio>\n+#include <arch/x64/misc.h>\n+#include <arch/intel_x64/bit.h>\n+#include <arch/intel_x64/mtrr.h>\n+#include <hve/arch/intel_x64/mtrr.h>\n+#include <hve/arch/intel_x64/phys_mtrr.h>\n+\n+namespace eapis\n+{\n+namespace intel_x64\n+{\n+\n+using namespace ::intel_x64::mtrr;\n+\n+///\n+/// Phys MTRR\n+///\n+phys_mtrr::phys_mtrr()\n+{\n+    expects(::intel_x64::mtrr::is_supported());\n+\n+    const auto cap = ia32_mtrrcap::get();\n+    const auto num = ia32_mtrrcap::vcnt::get(cap);\n+    expects(num > 0U && num <= 0xFFU);\n+\n+    const auto def = ia32_mtrr_def_type::get();\n+    expects(ia32_mtrr_def_type::e::is_enabled(def));\n+\n+    m_cap = cap;\n+    m_def = def;\n+    m_pas = ::x64::cpuid::addr_size::phys::get();\n+\n+    this->init_fixed_ranges();\n+    this->init_variable_ranges();\n+}\n+\n+static uint64_t fixed_range_size(uint64_t range)","path":"bfvmm/src/hve/arch/intel_x64/phys_mtrr.cpp","position":56,"original_position":56,"commit_id":"5a8fcb1948d06f59a2ca982c1300016c6364fa19","original_commit_id":"5a8fcb1948d06f59a2ca982c1300016c6364fa19","user":{"login":"JaredWright","id":13487832,"node_id":"MDQ6VXNlcjEzNDg3ODMy","avatar_url":"https://avatars0.githubusercontent.com/u/13487832?v=4","gravatar_id":"","url":"https://api.github.com/users/JaredWright","html_url":"https://github.com/JaredWright","followers_url":"https://api.github.com/users/JaredWright/followers","following_url":"https://api.github.com/users/JaredWright/following{/other_user}","gists_url":"https://api.github.com/users/JaredWright/gists{/gist_id}","starred_url":"https://api.github.com/users/JaredWright/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JaredWright/subscriptions","organizations_url":"https://api.github.com/users/JaredWright/orgs","repos_url":"https://api.github.com/users/JaredWright/repos","events_url":"https://api.github.com/users/JaredWright/events{/privacy}","received_events_url":"https://api.github.com/users/JaredWright/received_events","type":"User","site_admin":false},"body":"Why static function instead of a private member? Did this get left in here by accident since its only called by the print functions?","created_at":"2018-06-01T21:24:30Z","updated_at":"2018-06-01T21:32:12Z","html_url":"https://github.com/Bareflank/extended_apis/pull/91#discussion_r192519218","pull_request_url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/comments/192519218"},"html":{"href":"https://github.com/Bareflank/extended_apis/pull/91#discussion_r192519218"},"pull_request":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91"}}},"pull_request":{"url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91","id":192098705,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkyMDk4NzA1","html_url":"https://github.com/Bareflank/extended_apis/pull/91","diff_url":"https://github.com/Bareflank/extended_apis/pull/91.diff","patch_url":"https://github.com/Bareflank/extended_apis/pull/91.patch","issue_url":"https://api.github.com/repos/Bareflank/extended_apis/issues/91","number":91,"state":"open","locked":false,"title":"Add phys_mtrr class","user":{"login":"connojd","id":9279947,"node_id":"MDQ6VXNlcjkyNzk5NDc=","avatar_url":"https://avatars0.githubusercontent.com/u/9279947?v=4","gravatar_id":"","url":"https://api.github.com/users/connojd","html_url":"https://github.com/connojd","followers_url":"https://api.github.com/users/connojd/followers","following_url":"https://api.github.com/users/connojd/following{/other_user}","gists_url":"https://api.github.com/users/connojd/gists{/gist_id}","starred_url":"https://api.github.com/users/connojd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connojd/subscriptions","organizations_url":"https://api.github.com/users/connojd/orgs","repos_url":"https://api.github.com/users/connojd/repos","events_url":"https://api.github.com/users/connojd/events{/privacy}","received_events_url":"https://api.github.com/users/connojd/received_events","type":"User","site_admin":false},"body":"- Add a minimal mtrr::variable_range class along with static helpers\r\n  for parsing the fields out of the class's physbase and physmask\r\n  msr members.\r\n\r\n- Provide an interface that clients may use to query the memory type\r\n  of a physical address as specified by the MTRRs. The\r\n  phys_mtrr::mem_type function takes a host-physical address and returns\r\n  one of the types listed in bfintrinsics/include/arch/intel_x64/mtrr.h\r\n\r\n- Add phys_mtrr unit tests\r\n\r\nSigned-off-by: Connor Davis <davisc@ainfosec.com>","created_at":"2018-06-01T17:38:34Z","updated_at":"2018-06-01T21:32:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f897756ad5d8c00b0c937c1413236749611f040","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91/commits","review_comments_url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91/comments","review_comment_url":"https://api.github.com/repos/Bareflank/extended_apis/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Bareflank/extended_apis/issues/91/comments","statuses_url":"https://api.github.com/repos/Bareflank/extended_apis/statuses/5a8fcb1948d06f59a2ca982c1300016c6364fa19","head":{"label":"connojd:mtrr","ref":"mtrr","sha":"5a8fcb1948d06f59a2ca982c1300016c6364fa19","user":{"login":"connojd","id":9279947,"node_id":"MDQ6VXNlcjkyNzk5NDc=","avatar_url":"https://avatars0.githubusercontent.com/u/9279947?v=4","gravatar_id":"","url":"https://api.github.com/users/connojd","html_url":"https://github.com/connojd","followers_url":"https://api.github.com/users/connojd/followers","following_url":"https://api.github.com/users/connojd/following{/other_user}","gists_url":"https://api.github.com/users/connojd/gists{/gist_id}","starred_url":"https://api.github.com/users/connojd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connojd/subscriptions","organizations_url":"https://api.github.com/users/connojd/orgs","repos_url":"https://api.github.com/users/connojd/repos","events_url":"https://api.github.com/users/connojd/events{/privacy}","received_events_url":"https://api.github.com/users/connojd/received_events","type":"User","site_admin":false},"repo":{"id":80876240,"node_id":"MDEwOlJlcG9zaXRvcnk4MDg3NjI0MA==","name":"extended_apis","full_name":"connojd/extended_apis","owner":{"login":"connojd","id":9279947,"node_id":"MDQ6VXNlcjkyNzk5NDc=","avatar_url":"https://avatars0.githubusercontent.com/u/9279947?v=4","gravatar_id":"","url":"https://api.github.com/users/connojd","html_url":"https://github.com/connojd","followers_url":"https://api.github.com/users/connojd/followers","following_url":"https://api.github.com/users/connojd/following{/other_user}","gists_url":"https://api.github.com/users/connojd/gists{/gist_id}","starred_url":"https://api.github.com/users/connojd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/connojd/subscriptions","organizations_url":"https://api.github.com/users/connojd/orgs","repos_url":"https://api.github.com/users/connojd/repos","events_url":"https://api.github.com/users/connojd/events{/privacy}","received_events_url":"https://api.github.com/users/connojd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/connojd/extended_apis","description":"Intel's VT-x / VT-d APIs for the Bareflank hypervisor","fork":true,"url":"https://api.github.com/repos/connojd/extended_apis","forks_url":"https://api.github.com/repos/connojd/extended_apis/forks","keys_url":"https://api.github.com/repos/connojd/extended_apis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/connojd/extended_apis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/connojd/extended_apis/teams","hooks_url":"https://api.github.com/repos/connojd/extended_apis/hooks","issue_events_url":"https://api.github.com/repos/connojd/extended_apis/issues/events{/number}","events_url":"https://api.github.com/repos/connojd/extended_apis/events","assignees_url":"https://api.github.com/repos/connojd/extended_apis/assignees{/user}","branches_url":"https://api.github.com/repos/connojd/extended_apis/branches{/branch}","tags_url":"https://api.github.com/repos/connojd/extended_apis/tags","blobs_url":"https://api.github.com/repos/connojd/extended_apis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/connojd/extended_apis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/connojd/extended_apis/git/refs{/sha}","trees_url":"https://api.github.com/repos/connojd/extended_apis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/connojd/extended_apis/statuses/{sha}","languages_url":"https://api.github.com/repos/connojd/extended_apis/languages","stargazers_url":"https://api.github.com/repos/connojd/extended_apis/stargazers","contributors_url":"https://api.github.com/repos/connojd/extended_apis/contributors","subscribers_url":"https://api.github.com/repos/connojd/extended_apis/subscribers","subscription_url":"https://api.github.com/repos/connojd/extended_apis/subscription","commits_url":"https://api.github.com/repos/connojd/extended_apis/commits{/sha}","git_commits_url":"https://api.github.com/repos/connojd/extended_apis/git/commits{/sha}","comments_url":"https://api.github.com/repos/connojd/extended_apis/comments{/number}","issue_comment_url":"https://api.github.com/repos/connojd/extended_apis/issues/comments{/number}","contents_url":"https://api.github.com/repos/connojd/extended_apis/contents/{+path}","compare_url":"https://api.github.com/repos/connojd/extended_apis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/connojd/extended_apis/merges","archive_url":"https://api.github.com/repos/connojd/extended_apis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/connojd/extended_apis/downloads","issues_url":"https://api.github.com/repos/connojd/extended_apis/issues{/number}","pulls_url":"https://api.github.com/repos/connojd/extended_apis/pulls{/number}","milestones_url":"https://api.github.com/repos/connojd/extended_apis/milestones{/number}","notifications_url":"https://api.github.com/repos/connojd/extended_apis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/connojd/extended_apis/labels{/name}","releases_url":"https://api.github.com/repos/connojd/extended_apis/releases{/id}","deployments_url":"https://api.github.com/repos/connojd/extended_apis/deployments","created_at":"2017-02-03T22:51:01Z","updated_at":"2018-05-24T16:14:10Z","pushed_at":"2018-06-01T20:37:45Z","git_url":"git://github.com/connojd/extended_apis.git","ssh_url":"git@github.com:connojd/extended_apis.git","clone_url":"https://github.com/connojd/extended_apis.git","svn_url":"https://github.com/connojd/extended_apis","homepage":"","size":1391,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Bareflank:master","ref":"master","sha":"37061379e051b09ca2b6bfa15bb1dec1bb2efb62","user":{"login":"Bareflank","id":15015782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDE1Nzgy","avatar_url":"https://avatars1.githubusercontent.com/u/15015782?v=4","gravatar_id":"","url":"https://api.github.com/users/Bareflank","html_url":"https://github.com/Bareflank","followers_url":"https://api.github.com/users/Bareflank/followers","following_url":"https://api.github.com/users/Bareflank/following{/other_user}","gists_url":"https://api.github.com/users/Bareflank/gists{/gist_id}","starred_url":"https://api.github.com/users/Bareflank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bareflank/subscriptions","organizations_url":"https://api.github.com/users/Bareflank/orgs","repos_url":"https://api.github.com/users/Bareflank/repos","events_url":"https://api.github.com/users/Bareflank/events{/privacy}","received_events_url":"https://api.github.com/users/Bareflank/received_events","type":"Organization","site_admin":false},"repo":{"id":64543597,"node_id":"MDEwOlJlcG9zaXRvcnk2NDU0MzU5Nw==","name":"extended_apis","full_name":"Bareflank/extended_apis","owner":{"login":"Bareflank","id":15015782,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE1MDE1Nzgy","avatar_url":"https://avatars1.githubusercontent.com/u/15015782?v=4","gravatar_id":"","url":"https://api.github.com/users/Bareflank","html_url":"https://github.com/Bareflank","followers_url":"https://api.github.com/users/Bareflank/followers","following_url":"https://api.github.com/users/Bareflank/following{/other_user}","gists_url":"https://api.github.com/users/Bareflank/gists{/gist_id}","starred_url":"https://api.github.com/users/Bareflank/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bareflank/subscriptions","organizations_url":"https://api.github.com/users/Bareflank/orgs","repos_url":"https://api.github.com/users/Bareflank/repos","events_url":"https://api.github.com/users/Bareflank/events{/privacy}","received_events_url":"https://api.github.com/users/Bareflank/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Bareflank/extended_apis","description":"Intel's VT-x / VT-d APIs for the Bareflank hypervisor","fork":false,"url":"https://api.github.com/repos/Bareflank/extended_apis","forks_url":"https://api.github.com/repos/Bareflank/extended_apis/forks","keys_url":"https://api.github.com/repos/Bareflank/extended_apis/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Bareflank/extended_apis/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Bareflank/extended_apis/teams","hooks_url":"https://api.github.com/repos/Bareflank/extended_apis/hooks","issue_events_url":"https://api.github.com/repos/Bareflank/extended_apis/issues/events{/number}","events_url":"https://api.github.com/repos/Bareflank/extended_apis/events","assignees_url":"https://api.github.com/repos/Bareflank/extended_apis/assignees{/user}","branches_url":"https://api.github.com/repos/Bareflank/extended_apis/branches{/branch}","tags_url":"https://api.github.com/repos/Bareflank/extended_apis/tags","blobs_url":"https://api.github.com/repos/Bareflank/extended_apis/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Bareflank/extended_apis/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Bareflank/extended_apis/git/refs{/sha}","trees_url":"https://api.github.com/repos/Bareflank/extended_apis/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Bareflank/extended_apis/statuses/{sha}","languages_url":"https://api.github.com/repos/Bareflank/extended_apis/languages","stargazers_url":"https://api.github.com/repos/Bareflank/extended_apis/stargazers","contributors_url":"https://api.github.com/repos/Bareflank/extended_apis/contributors","subscribers_url":"https://api.github.com/repos/Bareflank/extended_apis/subscribers","subscription_url":"https://api.github.com/repos/Bareflank/extended_apis/subscription","commits_url":"https://api.github.com/repos/Bareflank/extended_apis/commits{/sha}","git_commits_url":"https://api.github.com/repos/Bareflank/extended_apis/git/commits{/sha}","comments_url":"https://api.github.com/repos/Bareflank/extended_apis/comments{/number}","issue_comment_url":"https://api.github.com/repos/Bareflank/extended_apis/issues/comments{/number}","contents_url":"https://api.github.com/repos/Bareflank/extended_apis/contents/{+path}","compare_url":"https://api.github.com/repos/Bareflank/extended_apis/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Bareflank/extended_apis/merges","archive_url":"https://api.github.com/repos/Bareflank/extended_apis/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Bareflank/extended_apis/downloads","issues_url":"https://api.github.com/repos/Bareflank/extended_apis/issues{/number}","pulls_url":"https://api.github.com/repos/Bareflank/extended_apis/pulls{/number}","milestones_url":"https://api.github.com/repos/Bareflank/extended_apis/milestones{/number}","notifications_url":"https://api.github.com/repos/Bareflank/extended_apis/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Bareflank/extended_apis/labels{/name}","releases_url":"https://api.github.com/repos/Bareflank/extended_apis/releases{/id}","deployments_url":"https://api.github.com/repos/Bareflank/extended_apis/deployments","created_at":"2016-07-30T12:43:49Z","updated_at":"2018-05-30T01:41:35Z","pushed_at":"2018-06-01T20:37:46Z","git_url":"git://github.com/Bareflank/extended_apis.git","ssh_url":"git@github.com:Bareflank/extended_apis.git","clone_url":"https://github.com/Bareflank/extended_apis.git","svn_url":"https://github.com/Bareflank/extended_apis","homepage":"","size":1023,"stargazers_count":33,"watchers_count":33,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":16,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"lgpl-2.1","name":"GNU Lesser General Public License v2.1","spdx_id":"LGPL-2.1","url":"https://api.github.com/licenses/lgpl-2.1","node_id":"MDc6TGljZW5zZTEx"},"forks":16,"open_issues":2,"watchers":33,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91"},"html":{"href":"https://github.com/Bareflank/extended_apis/pull/91"},"issue":{"href":"https://api.github.com/repos/Bareflank/extended_apis/issues/91"},"comments":{"href":"https://api.github.com/repos/Bareflank/extended_apis/issues/91/comments"},"review_comments":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91/comments"},"review_comment":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Bareflank/extended_apis/pulls/91/commits"},"statuses":{"href":"https://api.github.com/repos/Bareflank/extended_apis/statuses/5a8fcb1948d06f59a2ca982c1300016c6364fa19"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"JaredWright"}}