x86/mm: Fix typo in comment on top of page_lock
PATCH 1/1 x86/mm: Fix typo in comment on top of page_lock
--- xen/arch/x86/mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
xen/arch/x86/mm.c +1 -1
@@ -2003,7 +2003,7 @@ static int free_l4_table(struct page_info *page)* 2. We never call _put_page_type() on a page while holding its page lock. * * Add a check to debug builds to catch any violations of these -* assumpitons. +* assumptions. * * NB that if we find valid, safe reasons to hold two page locks at * once, these checks will need to be adjusted.
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
PATCH 1/1 xen: passthrough/amd: Remove unused function guest_iommu_set_base
The function is unused and could potentially lead a to trigger the BUG_ON() in p2m_change_type_one if misused as the p2m type is not sanitized.
So remove it.
--- xen/drivers/passthrough/amd/iommu_guest.c | 23 ----------------------- xen/include/asm-x86/hvm/svm/amd-iommu-proto.h | 1 - 2 files changed, 24 deletions(-)
xen/drivers/passthrough/amd/iommu_guest.c +0 -23
@@ -805,29 +805,6 @@ static int guest_iommu_mmio_write(struct vcpu *v, unsigned long addr,return X86EMUL_OKAY ; } -int guest_iommu_set_base (struct domain *d,uint64_t base) -{ -p2m_type_t t; -struct guest_iommu *iommu =domain_iommu (d); - -if ( !iommu ) -return -EACCES ; - - iommu->mmio_base = base; - base >>=PAGE_SHIFT ; - -for (int i =0 ; i <IOMMU_MMIO_PAGE_NR ; i++ ) - { -unsigned long gfn = base + i; - -get_gfn_query (d, gfn, &t); -p2m_change_type_one (d, gfn, t, p2m_mmio_dm); -put_gfn (d, gfn); - } - -return 0 ; -} -/* Initialize mmio read only bits */ static void guest_iommu_reg_init (struct guest_iommu *iommu) {
xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +0 -1
@@ -142,7 +142,6 @@ void guest_iommu_add_ppr_log(struct domain *d, u32 entry[]);void guest_iommu_add_event_log (struct domain *d,u32 entry[]);int guest_iommu_init (struct domain * d);void guest_iommu_destroy (struct domain *d); -int guest_iommu_set_base (struct domain *d,uint64_t base);static inline u32 get_field_from_reg_u32 (u32 reg_value,u32 mask,u32 shift) {
Signature · 7 lines
2.11.0 _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Re: [PATCH] xen: passthrough/amd: Remove unused function guest_iommu_set_base
Hi,
Hmmm, I mistakenly resent this patch. Please ignore this version and review <[email protected]>
Sorry for the noise.
Cheers,
Quoted 59 lines · Julien Grall
The function is unused and could potentially lead a to trigger the
BUG_ON()inp2m_change_type_oneif misused as the p2m type is not sanitized.So remove it.
Signed-off-by Julien Grall <[email protected]>--- xen/drivers/passthrough/amd/iommu_guest.c | 23 ----------------------- xen/include/asm-x86/hvm/svm/amd-iommu-proto.h | 1 - 2 files changed, 24 deletions(-)xen/drivers/passthrough/amd/iommu_guest.c +0
-23@@ -805,29 +805,6 @@ static int guest_iommu_mmio_write(struct vcpu *v, unsigned long addr,return X86EMUL_OKAY ; } -int guest_iommu_set_base (struct domain *d,uint64_t base) -{ -p2m_type_t t; -struct guest_iommu *iommu =domain_iommu (d); - -if ( !iommu ) -return -EACCES ; - - iommu->mmio_base = base; - base >>=PAGE_SHIFT ; - -for (int i =0 ; i <IOMMU_MMIO_PAGE_NR ; i++ ) - { -unsigned long gfn = base + i; - -get_gfn_query (d, gfn, &t); -p2m_change_type_one (d, gfn, t, p2m_mmio_dm); -put_gfn (d, gfn); - } - -return 0 ; -} -/* Initialize mmio read only bits */ static void guest_iommu_reg_init (struct guest_iommu *iommu) {xen/include/asm-x86/hvm/svm/amd-iommu-proto.h +0
-1@@ -142,7 +142,6 @@ void guest_iommu_add_ppr_log(struct domain *d, u32 entry[]);void guest_iommu_add_event_log (struct domain *d,u32 entry[]);int guest_iommu_init (struct domain * d);void guest_iommu_destroy (struct domain *d); -int guest_iommu_set_base (struct domain *d,uint64_t base);static inline u32 get_field_from_reg_u32 (u32 reg_value,u32 mask,u32 shift) {
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Julien Grall <[email protected]> 03/20/19 12:21 AM >>>
Signed-off-by Julien Grall <[email protected]>
xen/arch/x86/mm.c static int free_l4_table(struct page_info *page) · line 2006
Quoted 8 lines
xen/arch/x86/mm.c +1
-1@@ -2003,7 +2003,7 @@ static int free_l4_table(struct page_info *page)* 2. We never call _put_page_type() on a page while holding its page lock. * * Add a check to debug builds to catch any violations of these -* assumpitons. +* assumptions.
Would you mind also doing away with the unnecessary line split at the same time? The sentence fits on a single line without going to or beyond 80 characters.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel
Hi,
Quoted 5 lines · Jan Beulich
Quoted 2 lines
Quoted 1 line
Quoted 1 line
Julien Grall <[email protected]> 03/20/19 12:21 AM >>>
Signed-off-by Julien Grall <[email protected]>Acked-by Jan Beulich <[email protected]>
Quoted 11 lines
xen/arch/x86/mm.c static int free_l4_table(struct page_info *page) · line 2006
Quoted 8 lines
xen/arch/x86/mm.c +1
-1@@ -2003,7 +2003,7 @@ static int free_l4_table(struct page_info *page)* 2. We never call _put_page_type() on a page while holding its page lock. * * Add a check to debug builds to catch any violations of these -* assumpitons. +* assumptions. Would you mind also doing away with the unnecessary line split at the same time? The sentence fits on a single line without going to or beyond 80 characters.
Sure. I have removed the line split and committed the patch.
Cheers,
Signature · 6 lines
Julien Grall _______________________________________________ Xen-devel mailing list [email protected] https://lists.xenproject.org/mailman/listinfo/xen-devel