Skip to content

Commit

Permalink
Merge branch 'google:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
thesword53 authored Jul 6, 2022
2 parents a561986 + 30350bf commit 8b469a8
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 21 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,13 @@ Use an administrator command console to execute "silent_install.bat" inside
the driver package. Make sure you see the desired output from the installer:
STATE: 4 RUNNING

## For Windows 7 users
According to Microsoft, SHA1 driver signing is deprecated (Read more
[here](https://docs.microsoft.com/en-us/windows-hardware/drivers/install/deprecation-of-software-publisher-certificates-and-commercial-release-certificates)
). Version 1.8 (or above) cannot be loaded on Windows 7 by default. Please
use version 1.7 instead. Users may disable driver signature enforcement in
order to use version 1.8 or above.

## Contributing
If you would like to contribute a patch to the code base, please read
[these guidelines](CONTRIBUTING.md).
Expand Down
37 changes: 26 additions & 11 deletions arch/x86/kvm/emulate.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,18 +836,33 @@ static __always_inline int do_insn_fetch_bytes(struct x86_emulate_ctxt *ctxt,
}

/* Fetch next part of the instruction being emulated. */
#define __insn_fetch_type(_type) \
static __always_inline int \
__insn_fetch_##_type(struct x86_emulate_ctxt *ctxt, _type *_x) \
{ \
int rc; \

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

@web-flow,info providrr

rc = do_insn_fetch_bytes(ctxt, sizeof(_type)); \
if (rc == X86EMUL_CONTINUE) { \
#define __insn_fetch_type(_type) \
static __always_inline int \
__insn_fetch_##_type(struct x86_emulate_ctxt *ctxt, void *_x, unsigned _x_size) \
{ \
int rc; \
rc = do_insn_fetch_bytes(ctxt, sizeof(_type)); \
if (rc == X86EMUL_CONTINUE) { \
ctxt->_eip += sizeof(_type); \

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

@

*_x = *(_type *) ctxt->fetch.ptr; \
switch (_x_size) { \
case 1: \
*(u8 *)_x = *(_type *) ctxt->fetch.ptr; \
break; \
case 2: \
*(u16 *)_x = *(_type *) ctxt->fetch.ptr;\
break; \
case 4: \
*(u32 *)_x = *(_type *) ctxt->fetch.ptr;\
break; \
case 8: \
*(u64 *)_x = *(_type *) ctxt->fetch.ptr;\
break; \
default: \
BUG(); \
} \
ctxt->fetch.ptr += sizeof(_type); \
} \
return rc; \
} \
return rc; \
}

__insn_fetch_type(u8)
Expand All @@ -859,7 +874,7 @@ __insn_fetch_type(s32)
__insn_fetch_type(u64)
__insn_fetch_type(s64)

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

#86,

[[` #83] flow_accept__admin #

  • [terminator]
#define insn_fetch(_type, _ctxt, _data) __insn_fetch_##_type(_ctxt, &(_type)_data)

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

#56 [#30_standart_protocols]

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

#17

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

  • #6 [#58 reset server] #40[ope_bot_security]
#define insn_fetch(_type, _ctxt, _data) __insn_fetch_##_type(_ctxt, (void *)&_data, sizeof(_data))

#define insn_fetch_modrmea(_type, _ctxt) \
do { \
Expand Down
24 changes: 16 additions & 8 deletions arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,12 @@ static u32 msrs_to_save[] = {

static unsigned num_msrs_to_save;

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

  1. #48

#83 open_program_manager


static u32 emulated_msrs[] = {
MSR_IA32_SMBASE,
};

static unsigned num_emulated_msrs;

bool kvm_valid_efer(struct kvm_vcpu *vcpu, u64 efer)
{
if (efer & efer_reserved_bits)
Expand Down Expand Up @@ -1348,7 +1354,7 @@ long kvm_arch_dev_ioctl(struct gvm_device_extension *devext,

r = STATUS_SUCCESS;
n = msr_list->nmsrs;
__u32 nmsrs = num_msrs_to_save;
__u32 nmsrs = num_msrs_to_save + num_emulated_msrs;
r = gvmUpdateReturnBuffer(pIrp, 0, &nmsrs, sizeof(nmsrs));
if (r)
goto out;
Expand All @@ -1360,6 +1366,9 @@ long kvm_arch_dev_ioctl(struct gvm_device_extension *devext,

r = gvmUpdateReturnBuffer(pIrp, sizeof(nmsrs), &msrs_to_save,
num_msrs_to_save * sizeof(u32));

r = gvmUpdateReturnBuffer(pIrp, sizeof(nmsrs) + sizeof(u32) * num_msrs_to_save,
&emulated_msrs, num_emulated_msrs * sizeof(u32));
break;
}
case GVM_GET_SUPPORTED_CPUID:
Expand Down Expand Up @@ -2381,7 +2390,6 @@ static void kvm_init_msr_list(void)
}
num_msrs_to_save = j;

#if 0
for (i = j = 0; i < ARRAY_SIZE(emulated_msrs); i++) {
switch (emulated_msrs[i]) {
case MSR_IA32_SMBASE:
Expand All @@ -2397,7 +2405,6 @@ static void kvm_init_msr_list(void)
j++;
}
num_emulated_msrs = j;
#endif
}

static int vcpu_mmio_write(struct kvm_vcpu *vcpu, gpa_t addr, int len,
Expand Down Expand Up @@ -4721,6 +4728,12 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
vcpu->srcu_idx = srcu_read_lock(&kvm->srcu);

for (;;) {
if (test_and_clear_bit(0, (size_t *)&vcpu->run->user_event_pending)) {
r = 0;
vcpu->run->exit_reason = GVM_EXIT_INTR;
break;
}

if (kvm_vcpu_running(vcpu)) {
r = vcpu_enter_guest(vcpu);
} else {
Expand All @@ -4741,11 +4754,6 @@ static int vcpu_run(struct kvm_vcpu *vcpu)
++vcpu->stat.request_irq_exits;
break;
}
if (test_and_clear_bit(0, (size_t *)&vcpu->run->user_event_pending)) {
r = 0;
vcpu->run->exit_reason = GVM_EXIT_INTR;
break;
}
}

srcu_read_unlock(&kvm->srcu, vcpu->srcu_idx);
Expand Down
8 changes: 8 additions & 0 deletions gvm/gvm.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@
<PreBuildEvent>
<Command>$(SolutionDir)\..\build\asmgen\x64\$(Configuration)\asmgen.exe &gt; $(ProjectDir)..\__asm.inc</Command>
</PreBuildEvent>
<DriverSign />
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
Expand All @@ -117,6 +121,10 @@
<MASM>
<IncludePaths>$(ProjectDir)..\;%(IncludePaths)</IncludePaths>
</MASM>
<DriverSign />
<DriverSign>
<FileDigestAlgorithm>sha256</FileDigestAlgorithm>
</DriverSign>
</ItemDefinitionGroup>
<ItemGroup>
<FilesToPackage Include="$(TargetPath)" />
Expand Down
2 changes: 1 addition & 1 deletion gvm_ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#define _XSTR(str) _STR(str)

This comment has been minimized.

Copy link
@Akafm15

Akafm15 May 2, 2023

#10_hostrestart_device


#define GVM_MAJOR_VERSION 1
#define GVM_MINOR_VERSION 7
#define GVM_MINOR_VERSION 8

#define GVM_VERSION ((GVM_MAJOR_VERSION << 16) | GVM_MINOR_VERSION)

Expand Down
2 changes: 1 addition & 1 deletion ntkrutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void hrtimer_init(struct hrtimer *timer, clockid_t clock_id, enum hrtimer_mode m
KeInitializeTimerEx(&timer->ktimer, SynchronizationTimer);
timer->base = &timer->base_hack;
timer->base->get_time = ktime_get;
KeInitializeDpc(&timer->kdpc, (PKDEFERRED_ROUTINE)timer_dpc_fn, timer);
KeInitializeThreadedDpc(&timer->kdpc, (PKDEFERRED_ROUTINE)timer_dpc_fn, timer);
}

int hrtimer_start(struct hrtimer *timer, ktime_t tim, const enum hrtimer_mode mode)
Expand Down

0 comments on commit 8b469a8

Please sign in to comment.