mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-23 09:47:44 +00:00
config_tools: support vUART Timer pCPU configuration
This patch is to allow user to pin vUART timer to specific pCPU via ACRN config tool. User can configure by setting "vUART timer pCPU ID" under Hypervisor->Advanced Parameters. Tracked-On: #8648 Signed-off-by: Haiwei Li <haiwei.li@intel.com>
This commit is contained in:
@@ -47,6 +47,9 @@ static void init_debug_post(uint16_t pcpu_id)
|
||||
if (pcpu_id == BSP_CPU_ID) {
|
||||
/* Initialize the shell */
|
||||
shell_init();
|
||||
}
|
||||
|
||||
if (pcpu_id == VUART_TIMER_CPU) {
|
||||
console_setup_timer();
|
||||
}
|
||||
|
||||
|
@@ -211,7 +211,7 @@ void console_setup_timer(void)
|
||||
}
|
||||
|
||||
/* When lapic-pt is enabled for a vcpu working on the pcpu hosting
|
||||
* console timer (currently BSP), we utilize vm-exits to drive the console.
|
||||
* console timer, we utilize vm-exits to drive the console.
|
||||
*
|
||||
* Note that currently this approach will result in a laggy shell when
|
||||
* the number of VM-exits/second is low (which is mostly true when lapic-pt is
|
||||
@@ -222,8 +222,7 @@ void console_vmexit_callback(struct acrn_vcpu *vcpu)
|
||||
static uint64_t prev_tsc = 0;
|
||||
uint64_t tsc;
|
||||
|
||||
/* console_setup_timer is called on BSP only. */
|
||||
if ((pcpuid_from_vcpu(vcpu) == BSP_CPU_ID) && (is_lapic_pt_enabled(vcpu))) {
|
||||
if ((pcpuid_from_vcpu(vcpu) == VUART_TIMER_CPU) && (is_lapic_pt_enabled(vcpu))) {
|
||||
tsc = cpu_ticks();
|
||||
if (tsc - prev_tsc > (TICKS_PER_MS * CONSOLE_KICK_TIMER_TIMEOUT)) {
|
||||
console_timer_callback(NULL);
|
||||
@@ -234,10 +233,14 @@ void console_vmexit_callback(struct acrn_vcpu *vcpu)
|
||||
|
||||
void suspend_console(void)
|
||||
{
|
||||
del_timer(&console_timer);
|
||||
if (VUART_TIMER_CPU == BSP_CPU_ID) {
|
||||
del_timer(&console_timer);
|
||||
}
|
||||
}
|
||||
|
||||
void resume_console(void)
|
||||
{
|
||||
console_setup_timer();
|
||||
if (VUART_TIMER_CPU == BSP_CPU_ID) {
|
||||
console_setup_timer();
|
||||
}
|
||||
}
|
||||
|
@@ -34,6 +34,7 @@
|
||||
|
||||
#define RX_BUF_SIZE CONFIG_VUART_RX_BUF_SIZE
|
||||
#define TX_BUF_SIZE CONFIG_VUART_TX_BUF_SIZE
|
||||
#define VUART_TIMER_CPU CONFIG_VUART_TIMER_PCPU
|
||||
#define INVAILD_VUART_IDX 0xFFU
|
||||
|
||||
#define COM1_BASE 0x3F8U
|
||||
|
Reference in New Issue
Block a user