Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

module design for vioapic #8741

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

haiwei-li
Copy link
Contributor

No description provided.

Move the closing markers in the '#define .. #endif' to match the opening
markers.

Tracked-On: projectacrn#8665
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
This patch is to:
* Trim trailing whitespaces
* Use macro and add comments
* Add lock around `reset_one_vioapic()`

Tracked-On: projectacrn#8740
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
@haiwei-li
Copy link
Contributor Author

@shiqingg pls help to review. Thanks!

@yuhuanX
Copy link

yuhuanX commented Oct 8, 2024

@haiwei-li , hypervisor/build/dm/vioapic.o
dm/vioapic.c:193:3: error: expected identifier or ‘(’ before ‘/’ token
193 | */
| ^
dm/vioapic.c:248:3: error: expected identifier or ‘(’ before ‘/’ token
248 | */
| ^
dm/vioapic.c:110:1: error: ‘vioapic_set_pinstate’ defined but not used [-Werror=unused-function]
110 | vioapic_set_pinstate(struct acrn_single_vioapic *vioapic, uint32_t pin, uint32_t level)
| ^~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors

GAI Tooling Notice: These contents may have been developed with support from one
or more generative artificial intelligence solutions.

This patch is to add doxygen style comments for some elements in
vp-dm_vioapic module.

Tracked-On: projectacrn#8665
Signed-off-by: Haiwei Li <haiwei.li@intel.com>
#define RTBL_RO_BITS ((uint32_t)0x00004000U | (uint32_t)0x00001000U) /*Remote IRR and Delivery Status bits*/

#define DBG_LEVEL_VIOAPIC 6U
#define ACRN_IOAPIC_VERSION 0x11U

/**
* @brief The default definition of a RTE.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value of a virtual RTE ?

* And for every virtual I/O APIC:
* - Per spec, it initializes every redirection table entry (RTE) to the default value which is 0x0001000000000000. And
* it masks the interrupt by setting the 'mask' (bit 16).
* - It registers the MMIO emulation handler for all the registers and remove the EPT mapping for the registers address
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explicitly call out the handler vioapic_mmio_access_handler?

*
* @return None
*
* @pre vm != NULL
* @pre vm->arch_vm.vioapics != NULL
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vm->arch_vm.vioapics is not a pointer

@@ -120,5 +143,6 @@ struct acrn_single_vioapic *vgsi_to_vioapic_and_vpin(const struct acrn_vm *vm, u
/**
* @}
*/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls help remove the out-of-date documentation of vioapic_set_irqline_lock and vioapic_set_irqline_nolock in vioapic.h. Thanks.

reset_one_vioapic(&vioapics->vioapic_array[vioapic_index]);
spinlock_irqrestore_release(&(vioapics->vioapic_array[vioapic_index].lock), rflags);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pls create a separate PR for this lock change. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants