Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
qemu
提交
bbef882c
Q
qemu
项目概览
openeuler
/
qemu
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
Q
qemu
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
bbef882c
编写于
12月 12, 2012
作者:
M
Michael S. Tsirkin
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
msi: add API to get notified about pending bit poll
Update all users. Signed-off-by:
N
Michael S. Tsirkin
<
mst@redhat.com
>
上级
812d2594
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
4 deletion
+21
-4
hw/pci/msix.c
hw/pci/msix.c
+12
-1
hw/pci/msix.h
hw/pci/msix.h
+2
-1
hw/pci/pci.h
hw/pci/pci.h
+4
-0
hw/vfio_pci.c
hw/vfio_pci.c
+1
-1
hw/virtio-pci.c
hw/virtio-pci.c
+2
-1
未找到文件。
hw/pci/msix.c
浏览文件 @
bbef882c
...
...
@@ -191,6 +191,11 @@ static uint64_t msix_pba_mmio_read(void *opaque, hwaddr addr,
unsigned
size
)
{
PCIDevice
*
dev
=
opaque
;
if
(
dev
->
msix_vector_poll_notifier
)
{
unsigned
vector_start
=
addr
*
8
;
unsigned
vector_end
=
MIN
(
addr
+
size
*
8
,
dev
->
msix_entries_nr
);
dev
->
msix_vector_poll_notifier
(
dev
,
vector_start
,
vector_end
);
}
return
pci_get_long
(
dev
->
msix_pba
+
addr
);
}
...
...
@@ -513,7 +518,8 @@ static void msix_unset_notifier_for_vector(PCIDevice *dev, unsigned int vector)
int
msix_set_vector_notifiers
(
PCIDevice
*
dev
,
MSIVectorUseNotifier
use_notifier
,
MSIVectorReleaseNotifier
release_notifier
)
MSIVectorReleaseNotifier
release_notifier
,
MSIVectorPollNotifier
poll_notifier
)
{
int
vector
,
ret
;
...
...
@@ -521,6 +527,7 @@ int msix_set_vector_notifiers(PCIDevice *dev,
dev
->
msix_vector_use_notifier
=
use_notifier
;
dev
->
msix_vector_release_notifier
=
release_notifier
;
dev
->
msix_vector_poll_notifier
=
poll_notifier
;
if
((
dev
->
config
[
dev
->
msix_cap
+
MSIX_CONTROL_OFFSET
]
&
(
MSIX_ENABLE_MASK
|
MSIX_MASKALL_MASK
))
==
MSIX_ENABLE_MASK
)
{
...
...
@@ -531,6 +538,9 @@ int msix_set_vector_notifiers(PCIDevice *dev,
}
}
}
if
(
dev
->
msix_vector_poll_notifier
)
{
dev
->
msix_vector_poll_notifier
(
dev
,
0
,
dev
->
msix_entries_nr
);
}
return
0
;
undo:
...
...
@@ -557,4 +567,5 @@ void msix_unset_vector_notifiers(PCIDevice *dev)
}
dev
->
msix_vector_use_notifier
=
NULL
;
dev
->
msix_vector_release_notifier
=
NULL
;
dev
->
msix_vector_poll_notifier
=
NULL
;
}
hw/pci/msix.h
浏览文件 @
bbef882c
...
...
@@ -36,6 +36,7 @@ void msix_reset(PCIDevice *dev);
int
msix_set_vector_notifiers
(
PCIDevice
*
dev
,
MSIVectorUseNotifier
use_notifier
,
MSIVectorReleaseNotifier
release_notifier
);
MSIVectorReleaseNotifier
release_notifier
,
MSIVectorPollNotifier
poll_notifier
);
void
msix_unset_vector_notifiers
(
PCIDevice
*
dev
);
#endif
hw/pci/pci.h
浏览文件 @
bbef882c
...
...
@@ -187,6 +187,9 @@ typedef void (*PCIINTxRoutingNotifier)(PCIDevice *dev);
typedef
int
(
*
MSIVectorUseNotifier
)(
PCIDevice
*
dev
,
unsigned
int
vector
,
MSIMessage
msg
);
typedef
void
(
*
MSIVectorReleaseNotifier
)(
PCIDevice
*
dev
,
unsigned
int
vector
);
typedef
void
(
*
MSIVectorPollNotifier
)(
PCIDevice
*
dev
,
unsigned
int
vector_start
,
unsigned
int
vector_end
);
struct
PCIDevice
{
DeviceState
qdev
;
...
...
@@ -271,6 +274,7 @@ struct PCIDevice {
/* MSI-X notifiers */
MSIVectorUseNotifier
msix_vector_use_notifier
;
MSIVectorReleaseNotifier
msix_vector_release_notifier
;
MSIVectorPollNotifier
msix_vector_poll_notifier
;
};
void
pci_register_bar
(
PCIDevice
*
pci_dev
,
int
region_num
,
...
...
hw/vfio_pci.c
浏览文件 @
bbef882c
...
...
@@ -698,7 +698,7 @@ static void vfio_enable_msix(VFIODevice *vdev)
vdev
->
interrupt
=
VFIO_INT_MSIX
;
if
(
msix_set_vector_notifiers
(
&
vdev
->
pdev
,
vfio_msix_vector_use
,
vfio_msix_vector_release
))
{
vfio_msix_vector_release
,
NULL
))
{
error_report
(
"vfio: msix_set_vector_notifiers failed
\n
"
);
}
...
...
hw/virtio-pci.c
浏览文件 @
bbef882c
...
...
@@ -637,7 +637,8 @@ static int virtio_pci_set_guest_notifiers(DeviceState *d, bool assign)
msix_nr_vectors_allocated
(
&
proxy
->
pci_dev
));
r
=
msix_set_vector_notifiers
(
&
proxy
->
pci_dev
,
kvm_virtio_pci_vector_use
,
kvm_virtio_pci_vector_release
);
kvm_virtio_pci_vector_release
,
NULL
);
if
(
r
<
0
)
{
goto
assign_error
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录