Skip to content

Commit 11f5633

Browse files
committed
Merge tag 'kvm-riscv-6.8-2' of https://github.com/kvm-riscv/linux into HEAD
KVM/riscv changes for 6.8 part #2 - Zbc extension support for Guest/VM - Scalar crypto extensions support for Guest/VM - Vector crypto extensions support for Guest/VM - Zfh[min] extensions support for Guest/VM - Zihintntl extension support for Guest/VM - Zvfh[min] extensions support for Guest/VM - Zfa extension support for Guest/VM
2 parents 3f5198c + 4d0e8f9 commit 11f5633

File tree

3 files changed

+189
-0
lines changed

3 files changed

+189
-0
lines changed

arch/riscv/include/uapi/asm/kvm.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,33 @@ enum KVM_RISCV_ISA_EXT_ID {
139139
KVM_RISCV_ISA_EXT_ZIHPM,
140140
KVM_RISCV_ISA_EXT_SMSTATEEN,
141141
KVM_RISCV_ISA_EXT_ZICOND,
142+
KVM_RISCV_ISA_EXT_ZBC,
143+
KVM_RISCV_ISA_EXT_ZBKB,
144+
KVM_RISCV_ISA_EXT_ZBKC,
145+
KVM_RISCV_ISA_EXT_ZBKX,
146+
KVM_RISCV_ISA_EXT_ZKND,
147+
KVM_RISCV_ISA_EXT_ZKNE,
148+
KVM_RISCV_ISA_EXT_ZKNH,
149+
KVM_RISCV_ISA_EXT_ZKR,
150+
KVM_RISCV_ISA_EXT_ZKSED,
151+
KVM_RISCV_ISA_EXT_ZKSH,
152+
KVM_RISCV_ISA_EXT_ZKT,
153+
KVM_RISCV_ISA_EXT_ZVBB,
154+
KVM_RISCV_ISA_EXT_ZVBC,
155+
KVM_RISCV_ISA_EXT_ZVKB,
156+
KVM_RISCV_ISA_EXT_ZVKG,
157+
KVM_RISCV_ISA_EXT_ZVKNED,
158+
KVM_RISCV_ISA_EXT_ZVKNHA,
159+
KVM_RISCV_ISA_EXT_ZVKNHB,
160+
KVM_RISCV_ISA_EXT_ZVKSED,
161+
KVM_RISCV_ISA_EXT_ZVKSH,
162+
KVM_RISCV_ISA_EXT_ZVKT,
163+
KVM_RISCV_ISA_EXT_ZFH,
164+
KVM_RISCV_ISA_EXT_ZFHMIN,
165+
KVM_RISCV_ISA_EXT_ZIHINTNTL,
166+
KVM_RISCV_ISA_EXT_ZVFH,
167+
KVM_RISCV_ISA_EXT_ZVFHMIN,
168+
KVM_RISCV_ISA_EXT_ZFA,
142169
KVM_RISCV_ISA_EXT_MAX,
143170
};
144171

arch/riscv/kvm/vcpu_onereg.c

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,42 @@ static const unsigned long kvm_isa_ext_arr[] = {
4242
KVM_ISA_EXT_ARR(SVPBMT),
4343
KVM_ISA_EXT_ARR(ZBA),
4444
KVM_ISA_EXT_ARR(ZBB),
45+
KVM_ISA_EXT_ARR(ZBC),
46+
KVM_ISA_EXT_ARR(ZBKB),
47+
KVM_ISA_EXT_ARR(ZBKC),
48+
KVM_ISA_EXT_ARR(ZBKX),
4549
KVM_ISA_EXT_ARR(ZBS),
50+
KVM_ISA_EXT_ARR(ZFA),
51+
KVM_ISA_EXT_ARR(ZFH),
52+
KVM_ISA_EXT_ARR(ZFHMIN),
4653
KVM_ISA_EXT_ARR(ZICBOM),
4754
KVM_ISA_EXT_ARR(ZICBOZ),
4855
KVM_ISA_EXT_ARR(ZICNTR),
4956
KVM_ISA_EXT_ARR(ZICOND),
5057
KVM_ISA_EXT_ARR(ZICSR),
5158
KVM_ISA_EXT_ARR(ZIFENCEI),
59+
KVM_ISA_EXT_ARR(ZIHINTNTL),
5260
KVM_ISA_EXT_ARR(ZIHINTPAUSE),
5361
KVM_ISA_EXT_ARR(ZIHPM),
62+
KVM_ISA_EXT_ARR(ZKND),
63+
KVM_ISA_EXT_ARR(ZKNE),
64+
KVM_ISA_EXT_ARR(ZKNH),
65+
KVM_ISA_EXT_ARR(ZKR),
66+
KVM_ISA_EXT_ARR(ZKSED),
67+
KVM_ISA_EXT_ARR(ZKSH),
68+
KVM_ISA_EXT_ARR(ZKT),
69+
KVM_ISA_EXT_ARR(ZVBB),
70+
KVM_ISA_EXT_ARR(ZVBC),
71+
KVM_ISA_EXT_ARR(ZVFH),
72+
KVM_ISA_EXT_ARR(ZVFHMIN),
73+
KVM_ISA_EXT_ARR(ZVKB),
74+
KVM_ISA_EXT_ARR(ZVKG),
75+
KVM_ISA_EXT_ARR(ZVKNED),
76+
KVM_ISA_EXT_ARR(ZVKNHA),
77+
KVM_ISA_EXT_ARR(ZVKNHB),
78+
KVM_ISA_EXT_ARR(ZVKSED),
79+
KVM_ISA_EXT_ARR(ZVKSH),
80+
KVM_ISA_EXT_ARR(ZVKT),
5481
};
5582

5683
static unsigned long kvm_riscv_vcpu_base2isa_ext(unsigned long base_ext)
@@ -92,13 +119,40 @@ static bool kvm_riscv_vcpu_isa_disable_allowed(unsigned long ext)
92119
case KVM_RISCV_ISA_EXT_SVNAPOT:
93120
case KVM_RISCV_ISA_EXT_ZBA:
94121
case KVM_RISCV_ISA_EXT_ZBB:
122+
case KVM_RISCV_ISA_EXT_ZBC:
123+
case KVM_RISCV_ISA_EXT_ZBKB:
124+
case KVM_RISCV_ISA_EXT_ZBKC:
125+
case KVM_RISCV_ISA_EXT_ZBKX:
95126
case KVM_RISCV_ISA_EXT_ZBS:
127+
case KVM_RISCV_ISA_EXT_ZFA:
128+
case KVM_RISCV_ISA_EXT_ZFH:
129+
case KVM_RISCV_ISA_EXT_ZFHMIN:
96130
case KVM_RISCV_ISA_EXT_ZICNTR:
97131
case KVM_RISCV_ISA_EXT_ZICOND:
98132
case KVM_RISCV_ISA_EXT_ZICSR:
99133
case KVM_RISCV_ISA_EXT_ZIFENCEI:
134+
case KVM_RISCV_ISA_EXT_ZIHINTNTL:
100135
case KVM_RISCV_ISA_EXT_ZIHINTPAUSE:
101136
case KVM_RISCV_ISA_EXT_ZIHPM:
137+
case KVM_RISCV_ISA_EXT_ZKND:
138+
case KVM_RISCV_ISA_EXT_ZKNE:
139+
case KVM_RISCV_ISA_EXT_ZKNH:
140+
case KVM_RISCV_ISA_EXT_ZKR:
141+
case KVM_RISCV_ISA_EXT_ZKSED:
142+
case KVM_RISCV_ISA_EXT_ZKSH:
143+
case KVM_RISCV_ISA_EXT_ZKT:
144+
case KVM_RISCV_ISA_EXT_ZVBB:
145+
case KVM_RISCV_ISA_EXT_ZVBC:
146+
case KVM_RISCV_ISA_EXT_ZVFH:
147+
case KVM_RISCV_ISA_EXT_ZVFHMIN:
148+
case KVM_RISCV_ISA_EXT_ZVKB:
149+
case KVM_RISCV_ISA_EXT_ZVKG:
150+
case KVM_RISCV_ISA_EXT_ZVKNED:
151+
case KVM_RISCV_ISA_EXT_ZVKNHA:
152+
case KVM_RISCV_ISA_EXT_ZVKNHB:
153+
case KVM_RISCV_ISA_EXT_ZVKSED:
154+
case KVM_RISCV_ISA_EXT_ZVKSH:
155+
case KVM_RISCV_ISA_EXT_ZVKT:
102156
return false;
103157
/* Extensions which can be disabled using Smstateen */
104158
case KVM_RISCV_ISA_EXT_SSAIA:

tools/testing/selftests/kvm/riscv/get-reg-list.c

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,42 @@ bool filter_reg(__u64 reg)
4949
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_SVPBMT:
5050
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBA:
5151
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBB:
52+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBC:
53+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBKB:
54+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBKC:
55+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBKX:
5256
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZBS:
57+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFA:
58+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFH:
59+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZFHMIN:
5360
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZICBOM:
5461
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZICBOZ:
5562
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZICNTR:
5663
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZICOND:
5764
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZICSR:
5865
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZIFENCEI:
66+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZIHINTNTL:
5967
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZIHINTPAUSE:
6068
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZIHPM:
69+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKND:
70+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKNE:
71+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKNH:
72+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKR:
73+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKSED:
74+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKSH:
75+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZKT:
76+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVBB:
77+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVBC:
78+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVFH:
79+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVFHMIN:
80+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKB:
81+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKG:
82+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKNED:
83+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKNHA:
84+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKNHB:
85+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKSED:
86+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKSH:
87+
case KVM_REG_RISCV_ISA_EXT | KVM_REG_RISCV_ISA_SINGLE | KVM_RISCV_ISA_EXT_ZVKT:
6188
/*
6289
* Like ISA_EXT registers, SBI_EXT registers are only visible when the
6390
* host supports them and disabling them does not affect the visibility
@@ -394,15 +421,42 @@ static const char *isa_ext_single_id_to_str(__u64 reg_off)
394421
KVM_ISA_EXT_ARR(SVPBMT),
395422
KVM_ISA_EXT_ARR(ZBA),
396423
KVM_ISA_EXT_ARR(ZBB),
424+
KVM_ISA_EXT_ARR(ZBC),
425+
KVM_ISA_EXT_ARR(ZBKB),
426+
KVM_ISA_EXT_ARR(ZBKC),
427+
KVM_ISA_EXT_ARR(ZBKX),
397428
KVM_ISA_EXT_ARR(ZBS),
429+
KVM_ISA_EXT_ARR(ZFA),
430+
KVM_ISA_EXT_ARR(ZFH),
431+
KVM_ISA_EXT_ARR(ZFHMIN),
398432
KVM_ISA_EXT_ARR(ZICBOM),
399433
KVM_ISA_EXT_ARR(ZICBOZ),
400434
KVM_ISA_EXT_ARR(ZICNTR),
401435
KVM_ISA_EXT_ARR(ZICOND),
402436
KVM_ISA_EXT_ARR(ZICSR),
403437
KVM_ISA_EXT_ARR(ZIFENCEI),
438+
KVM_ISA_EXT_ARR(ZIHINTNTL),
404439
KVM_ISA_EXT_ARR(ZIHINTPAUSE),
405440
KVM_ISA_EXT_ARR(ZIHPM),
441+
KVM_ISA_EXT_ARR(ZKND),
442+
KVM_ISA_EXT_ARR(ZKNE),
443+
KVM_ISA_EXT_ARR(ZKNH),
444+
KVM_ISA_EXT_ARR(ZKR),
445+
KVM_ISA_EXT_ARR(ZKSED),
446+
KVM_ISA_EXT_ARR(ZKSH),
447+
KVM_ISA_EXT_ARR(ZKT),
448+
KVM_ISA_EXT_ARR(ZVBB),
449+
KVM_ISA_EXT_ARR(ZVBC),
450+
KVM_ISA_EXT_ARR(ZVFH),
451+
KVM_ISA_EXT_ARR(ZVFHMIN),
452+
KVM_ISA_EXT_ARR(ZVKB),
453+
KVM_ISA_EXT_ARR(ZVKG),
454+
KVM_ISA_EXT_ARR(ZVKNED),
455+
KVM_ISA_EXT_ARR(ZVKNHA),
456+
KVM_ISA_EXT_ARR(ZVKNHB),
457+
KVM_ISA_EXT_ARR(ZVKSED),
458+
KVM_ISA_EXT_ARR(ZVKSH),
459+
KVM_ISA_EXT_ARR(ZVKT),
406460
};
407461

408462
if (reg_off >= ARRAY_SIZE(kvm_isa_ext_reg_name))
@@ -888,15 +942,42 @@ KVM_ISA_EXT_SIMPLE_CONFIG(svnapot, SVNAPOT);
888942
KVM_ISA_EXT_SIMPLE_CONFIG(svpbmt, SVPBMT);
889943
KVM_ISA_EXT_SIMPLE_CONFIG(zba, ZBA);
890944
KVM_ISA_EXT_SIMPLE_CONFIG(zbb, ZBB);
945+
KVM_ISA_EXT_SIMPLE_CONFIG(zbc, ZBC);
946+
KVM_ISA_EXT_SIMPLE_CONFIG(zbkb, ZBKB);
947+
KVM_ISA_EXT_SIMPLE_CONFIG(zbkc, ZBKC);
948+
KVM_ISA_EXT_SIMPLE_CONFIG(zbkx, ZBKX);
891949
KVM_ISA_EXT_SIMPLE_CONFIG(zbs, ZBS);
950+
KVM_ISA_EXT_SIMPLE_CONFIG(zfa, ZFA);
951+
KVM_ISA_EXT_SIMPLE_CONFIG(zfh, ZFH);
952+
KVM_ISA_EXT_SIMPLE_CONFIG(zfhmin, ZFHMIN);
892953
KVM_ISA_EXT_SUBLIST_CONFIG(zicbom, ZICBOM);
893954
KVM_ISA_EXT_SUBLIST_CONFIG(zicboz, ZICBOZ);
894955
KVM_ISA_EXT_SIMPLE_CONFIG(zicntr, ZICNTR);
895956
KVM_ISA_EXT_SIMPLE_CONFIG(zicond, ZICOND);
896957
KVM_ISA_EXT_SIMPLE_CONFIG(zicsr, ZICSR);
897958
KVM_ISA_EXT_SIMPLE_CONFIG(zifencei, ZIFENCEI);
959+
KVM_ISA_EXT_SIMPLE_CONFIG(zihintntl, ZIHINTNTL);
898960
KVM_ISA_EXT_SIMPLE_CONFIG(zihintpause, ZIHINTPAUSE);
899961
KVM_ISA_EXT_SIMPLE_CONFIG(zihpm, ZIHPM);
962+
KVM_ISA_EXT_SIMPLE_CONFIG(zknd, ZKND);
963+
KVM_ISA_EXT_SIMPLE_CONFIG(zkne, ZKNE);
964+
KVM_ISA_EXT_SIMPLE_CONFIG(zknh, ZKNH);
965+
KVM_ISA_EXT_SIMPLE_CONFIG(zkr, ZKR);
966+
KVM_ISA_EXT_SIMPLE_CONFIG(zksed, ZKSED);
967+
KVM_ISA_EXT_SIMPLE_CONFIG(zksh, ZKSH);
968+
KVM_ISA_EXT_SIMPLE_CONFIG(zkt, ZKT);
969+
KVM_ISA_EXT_SIMPLE_CONFIG(zvbb, ZVBB);
970+
KVM_ISA_EXT_SIMPLE_CONFIG(zvbc, ZVBC);
971+
KVM_ISA_EXT_SIMPLE_CONFIG(zvfh, ZVFH);
972+
KVM_ISA_EXT_SIMPLE_CONFIG(zvfhmin, ZVFHMIN);
973+
KVM_ISA_EXT_SIMPLE_CONFIG(zvkb, ZVKB);
974+
KVM_ISA_EXT_SIMPLE_CONFIG(zvkg, ZVKG);
975+
KVM_ISA_EXT_SIMPLE_CONFIG(zvkned, ZVKNED);
976+
KVM_ISA_EXT_SIMPLE_CONFIG(zvknha, ZVKNHA);
977+
KVM_ISA_EXT_SIMPLE_CONFIG(zvknhb, ZVKNHB);
978+
KVM_ISA_EXT_SIMPLE_CONFIG(zvksed, ZVKSED);
979+
KVM_ISA_EXT_SIMPLE_CONFIG(zvksh, ZVKSH);
980+
KVM_ISA_EXT_SIMPLE_CONFIG(zvkt, ZVKT);
900981

901982
struct vcpu_reg_list *vcpu_configs[] = {
902983
&config_sbi_base,
@@ -914,14 +995,41 @@ struct vcpu_reg_list *vcpu_configs[] = {
914995
&config_svpbmt,
915996
&config_zba,
916997
&config_zbb,
998+
&config_zbc,
999+
&config_zbkb,
1000+
&config_zbkc,
1001+
&config_zbkx,
9171002
&config_zbs,
1003+
&config_zfa,
1004+
&config_zfh,
1005+
&config_zfhmin,
9181006
&config_zicbom,
9191007
&config_zicboz,
9201008
&config_zicntr,
9211009
&config_zicond,
9221010
&config_zicsr,
9231011
&config_zifencei,
1012+
&config_zihintntl,
9241013
&config_zihintpause,
9251014
&config_zihpm,
1015+
&config_zknd,
1016+
&config_zkne,
1017+
&config_zknh,
1018+
&config_zkr,
1019+
&config_zksed,
1020+
&config_zksh,
1021+
&config_zkt,
1022+
&config_zvbb,
1023+
&config_zvbc,
1024+
&config_zvfh,
1025+
&config_zvfhmin,
1026+
&config_zvkb,
1027+
&config_zvkg,
1028+
&config_zvkned,
1029+
&config_zvknha,
1030+
&config_zvknhb,
1031+
&config_zvksed,
1032+
&config_zvksh,
1033+
&config_zvkt,
9261034
};
9271035
int vcpu_configs_n = ARRAY_SIZE(vcpu_configs);

0 commit comments

Comments
 (0)