xen,kdump: handle pv domain in paddr_vmcoreinfo_note()
Subsystems (2)
Juergen Gross
maintainerPATCH 1/1 xen,kdump: handle pv domain in paddr_vmcoreinfo_note()
For kdump to work correctly it needs the physical address of vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.
paddr_vmcoreinfo_note() is meant to do the translation via __pa() only, but being attributed "weak" it can be replaced easily in Xen case.
---
This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.
--- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
arch/x86/xen/mmu.c +13 -0
@@ -49,6 +49,9 @@#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/crash_dump.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif #include <trace/events/xen.h>
@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note); +} +#endif /* CONFIG_KEXEC_CORE */
Signature · 1 line
2.10.2
Boris Ostrovsky
reviewerRe: [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
Quoted 32 lines · Juergen Gross
For kdump to work correctly it needs the physical address of
vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.
paddr_vmcoreinfo_note()is meant to do the translation via__pa()only, but being attributed "weak" it can be replaced easily in Xen case.Signed-off-by Juergen Gross <[email protected]>---
This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.--- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/x86/xen/mmu.c +3
-0@@ -49,6 +49,9 @@#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/crash_dump.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif #include <trace/events/xen.h> @@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ;
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 10 lines
arch/x86/xen/mmu.c +8
-0}EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);
Why not __pa_symbol(), just like in the weak version?
-boris
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2918
Quoted 2 lines
arch/x86/xen/mmu.c +2
-0+} +#endif /* CONFIG_KEXEC_CORE */
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Boris Ostrovsky
reviewerQuoted 32 lines · Juergen Gross
For kdump to work correctly it needs the physical address of
vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.
paddr_vmcoreinfo_note()is meant to do the translation via__pa()only, but being attributed "weak" it can be replaced easily in Xen case.Signed-off-by Juergen Gross <[email protected]>---
This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.--- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/x86/xen/mmu.c +3
-0@@ -49,6 +49,9 @@#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/crash_dump.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif #include <trace/events/xen.h> @@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ;
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 10 lines
arch/x86/xen/mmu.c +8
-0}EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);
Why not __pa_symbol(), just like in the weak version?
-boris
Quoted 2 lines
arch/x86/xen/mmu.c +2
-0+} +#endif /* CONFIG_KEXEC_CORE */
Juergen Gross
maintainerQuoted 31 lines · Boris Ostrovsky
Quoted 30 lines · Juergen Gross
For kdump to work correctly it needs the physical address of
vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.
paddr_vmcoreinfo_note()is meant to do the translation via__pa()only, but being attributed "weak" it can be replaced easily in Xen case.Signed-off-by Juergen Gross <[email protected]>---
This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.--- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/x86/xen/mmu.c +3
-0@@ -49,6 +49,9 @@#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/crash_dump.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif #include <trace/events/xen.h>
Quoted 14 lines
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 12 lines
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);Why not
__pa_symbol(), just like in the weak version?
Hmm, you are right. This patch originated from a 4.4 based one.
Juergen
Juergen Gross
maintainerRe: [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
In reply to Boris OstrovskyQuoted 31 lines · Boris Ostrovsky
Quoted 30 lines · Juergen Gross
For kdump to work correctly it needs the physical address of
vmcoreinfo_note. When running as dom0 this means the virtual address has to be translated to the related machine address.
paddr_vmcoreinfo_note()is meant to do the translation via__pa()only, but being attributed "weak" it can be replaced easily in Xen case.Signed-off-by Juergen Gross <[email protected]>---
This patch needs to be rebased on top of Vitaly's series to split pv- and hvm-code. I'll do this as soon as his series is in the Xen tree in its final form.--- arch/x86/xen/mmu.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)arch/x86/xen/mmu.c +3
-0@@ -49,6 +49,9 @@#include <linux/memblock.h> #include <linux/seq_file.h> #include <linux/crash_dump.h> +#ifdef CONFIG_KEXEC_CORE +#include <linux/kexec.h> +#endif #include <trace/events/xen.h>
Quoted 14 lines
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 12 lines
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);Why not
__pa_symbol(), just like in the weak version?
Hmm, you are right. This patch originated from a 4.4 based one.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Re: [Xen-devel] [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
In reply to Juergen Grossarch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 30.03.17 at 16:18, <[email protected]> wrote:
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);
I don't think you need the double cast here.
This being placed in x86 code is correct only as long as the assumption is correct that no other architecture will allow for PV guests. And this being placed in Xen code is correct only as long as the assumption is true that no other hypervisors will allow for PV guests.
Jan
Re: [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
In reply to Juergen Grossarch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 30.03.17 at 16:18, <[email protected]> wrote:
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);
I don't think you need the double cast here.
This being placed in x86 code is correct only as long as the assumption is correct that no other architecture will allow for PV guests. And this being placed in Xen code is correct only as long as the assumption is true that no other hypervisors will allow for PV guests.
Jan
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
A message that is not in the archive (sent off-list or not yet received): [email protected]
Juergen Gross
maintainerRe: [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
Quoted 16 lines · Jan Beulich
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 30.03.17 at 16:18, <[email protected]> wrote:
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);I don't think you need the double cast here.
Quoted 5 lines
This being placed in x86 code is correct only as long as the assumption is correct that no other architecture will allow for PV guests. And this being placed in Xen code is correct only as long as the assumption is true that no other hypervisors will allow for PV guests.
With virt_to_machine() defined in arch/x86/include/asm/xen/page.h I think changing any of those assumptions will require major work.
Juergen
_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
Juergen Gross
maintainerRe: [Xen-devel] [PATCH] xen, kdump: handle pv domain in paddr_vmcoreinfo_note()
In reply to a message not in the archiveQuoted 16 lines · Jan Beulich
arch/x86/xen/mmu.c int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, · line 2916
Quoted 13 lines
Quoted 1 line
Quoted 1 line · On 30.03.17 at 16:18, <[email protected]> wrote:
arch/x86/xen/mmu.c +8
-0@@ -2903,3 +2906,13 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma,return -EINVAL ; }EXPORT_SYMBOL_GPL (xen_unmap_domain_gfn_range); + +#ifdef CONFIG_KEXEC_CORE +phys_addr_t paddr_vmcoreinfo_note (void ) +{ +if (xen_pv_domain ()) +return virt_to_machine (&vmcoreinfo_note).maddr; +else +return __pa ((unsigned long )(char *)&vmcoreinfo_note);I don't think you need the double cast here.
Quoted 5 lines
This being placed in x86 code is correct only as long as the assumption is correct that no other architecture will allow for PV guests. And this being placed in Xen code is correct only as long as the assumption is true that no other hypervisors will allow for PV guests.
With virt_to_machine() defined in arch/x86/include/asm/xen/page.h I think changing any of those assumptions will require major work.
Juergen