mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-08-05 18:25:05 +00:00
hypervisor: passthru 0x64 port to SOS
On ICL notebook, it uses legacy keyboard interface for the integrated keyboard. Signed-off-by: Zide Chen <zide.chen@intel.com>
This commit is contained in:
parent
b7cce16403
commit
07546bdc28
@ -120,14 +120,16 @@ static void reset_host(void)
|
|||||||
/**
|
/**
|
||||||
* @pre vcpu != NULL && vm != NULL
|
* @pre vcpu != NULL && vm != NULL
|
||||||
*/
|
*/
|
||||||
static bool handle_reset_reg_read(struct acrn_vm *vm, struct acrn_vcpu *vcpu, __unused uint16_t addr,
|
static bool handle_reset_reg_read(struct acrn_vm *vm, struct acrn_vcpu *vcpu, uint16_t addr, size_t bytes)
|
||||||
__unused size_t bytes)
|
|
||||||
{
|
{
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
if (is_postlaunched_vm(vm)) {
|
if (is_postlaunched_vm(vm)) {
|
||||||
/* re-inject to DM */
|
/* re-inject to DM */
|
||||||
ret = false;
|
ret = false;
|
||||||
|
} else {
|
||||||
|
if (is_sos_vm(vm) && (bytes == 1U) && (addr == 0x64)) {
|
||||||
|
vcpu->req.reqs.pio.value = (uint32_t)pio_read8(addr);
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
* - keyboard control/status register 0x64: ACRN doesn't expose kbd controller to the guest.
|
* - keyboard control/status register 0x64: ACRN doesn't expose kbd controller to the guest.
|
||||||
@ -136,6 +138,7 @@ static bool handle_reset_reg_read(struct acrn_vm *vm, struct acrn_vcpu *vcpu, __
|
|||||||
*/
|
*/
|
||||||
vcpu->req.reqs.pio.value = ~0U;
|
vcpu->req.reqs.pio.value = ~0U;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -171,10 +174,18 @@ static bool handle_common_reset_reg_write(struct acrn_vm *vm, bool reset)
|
|||||||
/**
|
/**
|
||||||
* @pre vm != NULL
|
* @pre vm != NULL
|
||||||
*/
|
*/
|
||||||
static bool handle_kb_write(struct acrn_vm *vm, __unused uint16_t addr, size_t bytes, uint32_t val)
|
static bool handle_kb_write(struct acrn_vm *vm, uint16_t addr, size_t bytes, uint32_t val)
|
||||||
{
|
{
|
||||||
/* ignore commands other than system reset */
|
bool ret = true;
|
||||||
return handle_common_reset_reg_write(vm, ((bytes == 1U) && (val == 0xfeU)));
|
|
||||||
|
/* passthru none reset commands. */
|
||||||
|
if (is_sos_vm(vm) && (val != 0xfe) && (bytes == 1U)) {
|
||||||
|
pio_write8((uint8_t)val, addr);
|
||||||
|
} else {
|
||||||
|
ret = handle_common_reset_reg_write(vm, ((bytes == 1U) && (val == 0xfeU)));
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user