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
dragonball: introduce pci msi/msix interrupt #8662
Conversation
79f7ac8
to
4c03bde
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @studychao! I don't have enough time to go through your code, leaving msix.rs unreviewed. I'll review the rest part later. Here is some comments.
@@ -18,3 +18,7 @@ log = "0.4.14" | |||
downcast-rs = "1.2.0" | |||
byteorder = "1.4.3" | |||
thiserror = "1" | |||
vm-memory = "0.9.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please upgrade vm-memory to 0.10.0 to keep consistent with others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I found dbs_acpi's vm-memory is still 0.9.0. Do we upgrade that as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
vm-memory in pci part is upgraded.
dbs_acpi part will be taken care in later PR.
impl MsiCap { | ||
/// Create a new PCI MSI capability structure. | ||
pub fn new(next: u8, mut msg_ctl: u16) -> Self { | ||
let cap_id_next = (next as u16) << 8 | PciCapabilityID::MessageSignalledInterrupts as u16; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: PciCapabilityID
-> PciCapabilityId
// Safe to unwrap() because we have just enabled interrupt successfully. | ||
let group = intr_manager.get_group().unwrap(); | ||
for idx in 0..self.num_enabled_vectors() { | ||
if (self.mask_bits >> idx) & 0x1 != 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use VECTOR_MASK_BIT = 0x1
as aforementioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed.
) -> std::io::Result<()> { | ||
if self.enabled() { | ||
for idx in 0..self.num_enabled_vectors() { | ||
match ((self.mask_bits >> idx) & 0x1, (mask >> idx) & 0x1) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use VECTOR_MASK_BIT
?
let group = intr_manager.get_group().unwrap(); | ||
group.unmask(idx as InterruptIndex)?; | ||
} | ||
_ => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add some debug level logs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
debug log added.
4c03bde
to
2f8d858
Compare
@justxuewei hi, I have updated the PR according to your suggestion. Please take a look. |
37b9384
to
0afd77a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lgtm, thanks @studychao!
/test |
0afd77a
to
0aed0ca
Compare
/test |
/test-arm |
0aed0ca
to
819ec45
Compare
/test |
/test-s390x |
introduce msi/msix mod to maintain information for PCI Message Signalled Interrupt Extended Capability. It will be initialized when parsing pci configuration space and used when getting interrupt capabilities. fixes: kata-containers#8661 Signed-off-by: Gerry Liu <gerry@linux.alibaba.com> Signed-off-by: Zizheng Bian <zizheng.bian@linux.alibaba.com> Signed-off-by: Shifang Feng <fengshifang@linux.alibaba.com> Signed-off-by: Yang Su <yang.su@linux.alibaba.com> Signed-off-by: Zha Bin <zhabin@linux.alibaba.com> Signed-off-by: Xin Lin <jingshan@linux.alibaba.com> Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
819ec45
to
8cf3bce
Compare
/test |
introduce msi/msix mod to maintain information for PCI Message Signalled Interrupt Extended Capability. It will be initialized when parsing pci configuration space and used when getting interrupt capabilities.
fixes: #8661
Signed-off-by: Gerry Liu gerry@linux.alibaba.com
Signed-off-by: Zizheng Bian zizheng.bian@linux.alibaba.com
Signed-off-by: Shifang Feng fengshifang@linux.alibaba.com
Signed-off-by: Yang Su yang.su@linux.alibaba.com
Signed-off-by: Zha Bin zhabin@linux.alibaba.com
Signed-off-by: Xin Lin jingshan@linux.alibaba.com
Signed-off-by: Chao Wu chaowu@linux.alibaba.com
v2