|
4 | 4 | * Author: Fuad Tabba <[email protected]>
|
5 | 5 | */
|
6 | 6 |
|
| 7 | +#include <linux/irqchip/arm-gic-v3.h> |
| 8 | + |
7 | 9 | #include <asm/kvm_asm.h>
|
8 | 10 | #include <asm/kvm_fixed_config.h>
|
9 | 11 | #include <asm/kvm_mmu.h>
|
@@ -303,6 +305,17 @@ static bool pvm_access_id_aarch64(struct kvm_vcpu *vcpu,
|
303 | 305 | return true;
|
304 | 306 | }
|
305 | 307 |
|
| 308 | +static bool pvm_gic_read_sre(struct kvm_vcpu *vcpu, |
| 309 | + struct sys_reg_params *p, |
| 310 | + const struct sys_reg_desc *r) |
| 311 | +{ |
| 312 | + /* pVMs only support GICv3. 'nuf said. */ |
| 313 | + if (!p->is_write) |
| 314 | + p->regval = ICC_SRE_EL1_DIB | ICC_SRE_EL1_DFB | ICC_SRE_EL1_SRE; |
| 315 | + |
| 316 | + return true; |
| 317 | +} |
| 318 | + |
306 | 319 | /* Mark the specified system register as an AArch32 feature id register. */
|
307 | 320 | #define AARCH32(REG) { SYS_DESC(REG), .access = pvm_access_id_aarch32 }
|
308 | 321 |
|
@@ -386,7 +399,10 @@ static const struct sys_reg_desc pvm_sys_reg_descs[] = {
|
386 | 399 |
|
387 | 400 | /* Limited Ordering Regions Registers are restricted. */
|
388 | 401 |
|
389 |
| - /* GIC CPU Interface registers are restricted. */ |
| 402 | + HOST_HANDLED(SYS_ICC_SGI1R_EL1), |
| 403 | + HOST_HANDLED(SYS_ICC_ASGI1R_EL1), |
| 404 | + HOST_HANDLED(SYS_ICC_SGI0R_EL1), |
| 405 | + { SYS_DESC(SYS_ICC_SRE_EL1), .access = pvm_gic_read_sre, }, |
390 | 406 |
|
391 | 407 | HOST_HANDLED(SYS_CCSIDR_EL1),
|
392 | 408 | HOST_HANDLED(SYS_CLIDR_EL1),
|
|
0 commit comments