Skip to content

Commit 96c852c

Browse files
committed
kvm: selftests: Do not indent with spaces
Some indentation with spaces crept in, likely due to terminal-based cut and paste. Clean it up. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent fa68118 commit 96c852c

File tree

6 files changed

+61
-59
lines changed

6 files changed

+61
-59
lines changed

tools/testing/selftests/kvm/include/x86_64/processor.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,14 +368,14 @@ bool is_amd_cpu(void);
368368

369369
static inline unsigned int x86_family(unsigned int eax)
370370
{
371-
unsigned int x86;
371+
unsigned int x86;
372372

373-
x86 = (eax >> 8) & 0xf;
373+
x86 = (eax >> 8) & 0xf;
374374

375-
if (x86 == 0xf)
376-
x86 += (eax >> 20) & 0xff;
375+
if (x86 == 0xf)
376+
x86 += (eax >> 20) & 0xff;
377377

378-
return x86;
378+
return x86;
379379
}
380380

381381
static inline unsigned int x86_model(unsigned int eax)

tools/testing/selftests/kvm/lib/kvm_util.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,9 +499,11 @@ void kvm_vm_get_dirty_log(struct kvm_vm *vm, int slot, void *log)
499499
void kvm_vm_clear_dirty_log(struct kvm_vm *vm, int slot, void *log,
500500
uint64_t first_page, uint32_t num_pages)
501501
{
502-
struct kvm_clear_dirty_log args = { .dirty_bitmap = log, .slot = slot,
503-
.first_page = first_page,
504-
.num_pages = num_pages };
502+
struct kvm_clear_dirty_log args = {
503+
.dirty_bitmap = log, .slot = slot,
504+
.first_page = first_page,
505+
.num_pages = num_pages
506+
};
505507
int ret;
506508

507509
ret = ioctl(vm->fd, KVM_CLEAR_DIRTY_LOG, &args);

tools/testing/selftests/kvm/lib/x86_64/processor.c

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,25 +1144,25 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
11441144
list = malloc(sizeof(*list) + nmsrs * sizeof(list->indices[0]));
11451145
list->nmsrs = nmsrs;
11461146
r = ioctl(vm->kvm_fd, KVM_GET_MSR_INDEX_LIST, list);
1147-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MSR_INDEX_LIST, r: %i",
1148-
r);
1147+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MSR_INDEX_LIST, r: %i",
1148+
r);
11491149

11501150
state = malloc(sizeof(*state) + nmsrs * sizeof(state->msrs.entries[0]));
11511151
r = ioctl(vcpu->fd, KVM_GET_VCPU_EVENTS, &state->events);
1152-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_VCPU_EVENTS, r: %i",
1153-
r);
1152+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_VCPU_EVENTS, r: %i",
1153+
r);
11541154

11551155
r = ioctl(vcpu->fd, KVM_GET_MP_STATE, &state->mp_state);
1156-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MP_STATE, r: %i",
1157-
r);
1156+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_MP_STATE, r: %i",
1157+
r);
11581158

11591159
r = ioctl(vcpu->fd, KVM_GET_REGS, &state->regs);
1160-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_REGS, r: %i",
1161-
r);
1160+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_REGS, r: %i",
1161+
r);
11621162

11631163
r = vcpu_save_xsave_state(vm, vcpu, state);
1164-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_XSAVE, r: %i",
1165-
r);
1164+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_XSAVE, r: %i",
1165+
r);
11661166

11671167
if (kvm_check_cap(KVM_CAP_XCRS)) {
11681168
r = ioctl(vcpu->fd, KVM_GET_XCRS, &state->xcrs);
@@ -1171,30 +1171,30 @@ struct kvm_x86_state *vcpu_save_state(struct kvm_vm *vm, uint32_t vcpuid)
11711171
}
11721172

11731173
r = ioctl(vcpu->fd, KVM_GET_SREGS, &state->sregs);
1174-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_SREGS, r: %i",
1175-
r);
1174+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_SREGS, r: %i",
1175+
r);
11761176

11771177
if (nested_size) {
11781178
state->nested.size = sizeof(state->nested_);
11791179
r = ioctl(vcpu->fd, KVM_GET_NESTED_STATE, &state->nested);
11801180
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_NESTED_STATE, r: %i",
1181-
r);
1181+
r);
11821182
TEST_ASSERT(state->nested.size <= nested_size,
1183-
"Nested state size too big, %i (KVM_CHECK_CAP gave %i)",
1184-
state->nested.size, nested_size);
1183+
"Nested state size too big, %i (KVM_CHECK_CAP gave %i)",
1184+
state->nested.size, nested_size);
11851185
} else
11861186
state->nested.size = 0;
11871187

11881188
state->msrs.nmsrs = nmsrs;
11891189
for (i = 0; i < nmsrs; i++)
11901190
state->msrs.entries[i].index = list->indices[i];
11911191
r = ioctl(vcpu->fd, KVM_GET_MSRS, &state->msrs);
1192-
TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
1193-
r, r == nmsrs ? -1 : list->indices[r]);
1192+
TEST_ASSERT(r == nmsrs, "Unexpected result from KVM_GET_MSRS, r: %i (failed MSR was 0x%x)",
1193+
r, r == nmsrs ? -1 : list->indices[r]);
11941194

11951195
r = ioctl(vcpu->fd, KVM_GET_DEBUGREGS, &state->debugregs);
1196-
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_DEBUGREGS, r: %i",
1197-
r);
1196+
TEST_ASSERT(r == 0, "Unexpected result from KVM_GET_DEBUGREGS, r: %i",
1197+
r);
11981198

11991199
free(list);
12001200
return state;
@@ -1207,7 +1207,7 @@ void vcpu_load_state(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_x86_state *s
12071207

12081208
r = ioctl(vcpu->fd, KVM_SET_SREGS, &state->sregs);
12091209
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_SREGS, r: %i",
1210-
r);
1210+
r);
12111211

12121212
r = ioctl(vcpu->fd, KVM_SET_MSRS, &state->msrs);
12131213
TEST_ASSERT(r == state->msrs.nmsrs,
@@ -1222,28 +1222,28 @@ void vcpu_load_state(struct kvm_vm *vm, uint32_t vcpuid, struct kvm_x86_state *s
12221222

12231223
r = ioctl(vcpu->fd, KVM_SET_XSAVE, state->xsave);
12241224
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_XSAVE, r: %i",
1225-
r);
1225+
r);
12261226

12271227
r = ioctl(vcpu->fd, KVM_SET_VCPU_EVENTS, &state->events);
1228-
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_VCPU_EVENTS, r: %i",
1229-
r);
1228+
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_VCPU_EVENTS, r: %i",
1229+
r);
12301230

12311231
r = ioctl(vcpu->fd, KVM_SET_MP_STATE, &state->mp_state);
1232-
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_MP_STATE, r: %i",
1233-
r);
1232+
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_MP_STATE, r: %i",
1233+
r);
12341234

12351235
r = ioctl(vcpu->fd, KVM_SET_DEBUGREGS, &state->debugregs);
1236-
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_DEBUGREGS, r: %i",
1237-
r);
1236+
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_DEBUGREGS, r: %i",
1237+
r);
12381238

12391239
r = ioctl(vcpu->fd, KVM_SET_REGS, &state->regs);
1240-
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_REGS, r: %i",
1241-
r);
1240+
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_REGS, r: %i",
1241+
r);
12421242

12431243
if (state->nested.size) {
12441244
r = ioctl(vcpu->fd, KVM_SET_NESTED_STATE, &state->nested);
12451245
TEST_ASSERT(r == 0, "Unexpected result from KVM_SET_NESTED_STATE, r: %i",
1246-
r);
1246+
r);
12471247
}
12481248
}
12491249

tools/testing/selftests/kvm/x86_64/tsc_msrs_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ static void run_vcpu(struct kvm_vm *vm, uint32_t vcpuid, int stage)
7777
switch (get_ucall(vm, vcpuid, &uc)) {
7878
case UCALL_SYNC:
7979
TEST_ASSERT(!strcmp((const char *)uc.args[0], "hello") &&
80-
uc.args[1] == stage + 1, "Stage %d: Unexpected register values vmexit, got %lx",
81-
stage + 1, (ulong)uc.args[1]);
80+
uc.args[1] == stage + 1, "Stage %d: Unexpected register values vmexit, got %lx",
81+
stage + 1, (ulong)uc.args[1]);
8282
return;
8383
case UCALL_DONE:
8484
return;

tools/testing/selftests/kvm/x86_64/vmx_close_while_nested_test.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ static struct kvm_vm *vm;
3030
static void l2_guest_code(void)
3131
{
3232
/* Exit to L0 */
33-
asm volatile("inb %%dx, %%al"
34-
: : [port] "d" (PORT_L0_EXIT) : "rax");
33+
asm volatile("inb %%dx, %%al"
34+
: : [port] "d" (PORT_L0_EXIT) : "rax");
3535
}
3636

3737
static void l1_guest_code(struct vmx_pages *vmx_pages)

tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,20 @@ static struct kvm_vm *vm;
4646
#define MIN_STEAL_TIME 50000
4747

4848
struct pvclock_vcpu_time_info {
49-
u32 version;
50-
u32 pad0;
51-
u64 tsc_timestamp;
52-
u64 system_time;
53-
u32 tsc_to_system_mul;
54-
s8 tsc_shift;
55-
u8 flags;
56-
u8 pad[2];
49+
u32 version;
50+
u32 pad0;
51+
u64 tsc_timestamp;
52+
u64 system_time;
53+
u32 tsc_to_system_mul;
54+
s8 tsc_shift;
55+
u8 flags;
56+
u8 pad[2];
5757
} __attribute__((__packed__)); /* 32 bytes */
5858

5959
struct pvclock_wall_clock {
60-
u32 version;
61-
u32 sec;
62-
u32 nsec;
60+
u32 version;
61+
u32 sec;
62+
u32 nsec;
6363
} __attribute__((__packed__));
6464

6565
struct vcpu_runstate_info {
@@ -74,11 +74,11 @@ struct arch_vcpu_info {
7474
};
7575

7676
struct vcpu_info {
77-
uint8_t evtchn_upcall_pending;
78-
uint8_t evtchn_upcall_mask;
79-
unsigned long evtchn_pending_sel;
80-
struct arch_vcpu_info arch;
81-
struct pvclock_vcpu_time_info time;
77+
uint8_t evtchn_upcall_pending;
78+
uint8_t evtchn_upcall_mask;
79+
unsigned long evtchn_pending_sel;
80+
struct arch_vcpu_info arch;
81+
struct pvclock_vcpu_time_info time;
8282
}; /* 64 bytes (x86) */
8383

8484
struct shared_info {
@@ -493,7 +493,7 @@ int main(int argc, char *argv[])
493493

494494
vm_ts.tv_sec = wc->sec;
495495
vm_ts.tv_nsec = wc->nsec;
496-
TEST_ASSERT(wc->version && !(wc->version & 1),
496+
TEST_ASSERT(wc->version && !(wc->version & 1),
497497
"Bad wallclock version %x", wc->version);
498498
TEST_ASSERT(cmp_timespec(&min_ts, &vm_ts) <= 0, "VM time too old");
499499
TEST_ASSERT(cmp_timespec(&max_ts, &vm_ts) >= 0, "VM time too new");

0 commit comments

Comments
 (0)