Skip to content

Commit

Permalink
cosmetic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
wbenny committed Jan 27, 2019
1 parent 658bc37 commit c032e36
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 14 deletions.
1 change: 0 additions & 1 deletion src/hvpp/hvpp/lib/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ class device
{ (void)(buffer); (void)(buffer_size); (void)(bytes_read); return error_code_t{}; }

virtual error_code_t on_write(void* buffer, size_t buffer_size, size_t& bytes_written) noexcept

{ (void)(buffer); (void)(buffer_size); (void)(bytes_written); return error_code_t{}; }

virtual error_code_t on_ioctl(void* buffer, size_t buffer_size, uint32_t code) noexcept
Expand Down
7 changes: 4 additions & 3 deletions src/hvpp/hvpp/lib/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ make_ioctl_code_windows(
uint32_t size
) noexcept
{
//
// "Size" isn't part of the IOCTL code on Windows.
//
(void)(size);

//
Expand Down Expand Up @@ -65,8 +68,6 @@ make_ioctl_code_linux(
uint32_t size
) noexcept
{
(void)size;

//
// Took from Linux source code (include/uapi/asm-generic/ioctl.h).
//
Expand Down Expand Up @@ -97,7 +98,7 @@ make_ioctl_code(
#elif __linux__
return make_ioctl_code_linux(id, access, size);
#else
#error Unsupported architecture!
#error Unsupported operating system!
#endif
}

Expand Down
6 changes: 3 additions & 3 deletions src/hvpp/hvpp/lib/win32/cr3_guard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ ia32::cr3_t kernel_cr3(ia32::cr3_t cr3) noexcept
if (cr3.pcid == PCID_KERNEL)
{
//
// CR3 already contains such PML4, which allows us to
// CR3 already contains such PML4, that allows us to
// access kernel-mode address space. We can just reuse
// it.
//
Expand Down Expand Up @@ -77,8 +77,8 @@ ia32::cr3_t kernel_cr3(ia32::cr3_t cr3) noexcept
// field.
//
// Note that although this still relies on undocumented KPROCESS
// structure fields, the position of "DirectoryTableBase" field
// didn't ever change, so let's be confident and just use it.
// structure fields, the offset of the "DirectoryTableBase" field
// never changed, so let's be confident and just use it.
//
#if 0
hvpp_assert(cr3.pcid == PCID_USER);
Expand Down
8 changes: 4 additions & 4 deletions src/hvpp/hvpp/vcpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ auto vcpu_t::initialize(vmexit_handler& handler) noexcept -> error_code_t
// in the vcpu.asm file. If they are ever changed, the static_assert
// should be hint to fix them in the vcpu.asm as well.
//
constexpr intptr_t VCPU_RSP = offsetof(vcpu_t, stack_) + sizeof(vcpu_t::stack_);
constexpr intptr_t VCPU_OFFSET = -0x8000; // -vcpu_stack_size
constexpr intptr_t VCPU_LAUNCH_CONTEXT_OFFSET = 0;
constexpr intptr_t VCPU_EXIT_CONTEXT_OFFSET = 144; // sizeof(context);
constexpr intptr_t VCPU_RSP = offsetof(vcpu_t, stack_) + sizeof(vcpu_t::stack_);
constexpr intptr_t VCPU_OFFSET = -0x8000; // -vcpu_stack_size
constexpr intptr_t VCPU_LAUNCH_CONTEXT_OFFSET = 0;
constexpr intptr_t VCPU_EXIT_CONTEXT_OFFSET = 144; // sizeof(context);

static_assert(VCPU_RSP + VCPU_OFFSET == offsetof(vcpu_t, stack_));
static_assert(VCPU_RSP + VCPU_LAUNCH_CONTEXT_OFFSET == offsetof(vcpu_t, guest_context_));
Expand Down
3 changes: 0 additions & 3 deletions src/hvpp/hvpp/vmexit/vmexit_passthrough.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -865,9 +865,6 @@ void vmexit_passthrough_handler::handle_ldtr_tr_access(vcpu_t& vp) noexcept

void vmexit_passthrough_handler::handle_ept_violation(vcpu_t& vp) noexcept
{
//
// TODO
//
handle_fallback(vp);
}

Expand Down

0 comments on commit c032e36

Please sign in to comment.