Message ID | 20190926183808.11630-7-julien.grall@arm.com |
---|---|
State | Superseded |
Headers | show |
Series | xen/arm: XSA-201 and XSA-263 fixes | expand |
Julien Grall writes: > At the moment, ARCH_PATCH_INSN_SIZE is defined in the header > livepatch.h. However, this is also used in the alternative code. > > Rather than including livepatch.h just for using the define, move it in > the header insn.h which seems more suitable. > > Signed-off-by: Julien Grall <julien.grall@arm.com> Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
On 9/26/19 7:38 PM, Julien Grall wrote: > At the moment, ARCH_PATCH_INSN_SIZE is defined in the header > livepatch.h. However, this is also used in the alternative code. > > Rather than including livepatch.h just for using the define, move it in > the header insn.h which seems more suitable. > Reviewed-by: Ross Lagerwall <ross.lagerwall@citrix.com>
On Thu, 26 Sep 2019, Julien Grall wrote: > At the moment, ARCH_PATCH_INSN_SIZE is defined in the header > livepatch.h. However, this is also used in the alternative code. > > Rather than including livepatch.h just for using the define, move it in > the header insn.h which seems more suitable. > > Signed-off-by: Julien Grall <julien.grall@arm.com> Acked-by: Stefano Stabellini <sstabellini@kernel.org> > --- > xen/arch/arm/alternative.c | 2 -- > xen/include/asm-arm/insn.h | 3 +++ > xen/include/asm-arm/livepatch.h | 4 +--- > 3 files changed, 4 insertions(+), 5 deletions(-) > > diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c > index 52ed7edf69..237c4e5642 100644 > --- a/xen/arch/arm/alternative.c > +++ b/xen/arch/arm/alternative.c > @@ -30,8 +30,6 @@ > #include <asm/byteorder.h> > #include <asm/cpufeature.h> > #include <asm/insn.h> > -/* XXX: Move ARCH_PATCH_INSN_SIZE out of livepatch.h */ > -#include <asm/livepatch.h> > #include <asm/page.h> > > /* Override macros from asm/page.h to make them work with mfn_t */ > diff --git a/xen/include/asm-arm/insn.h b/xen/include/asm-arm/insn.h > index 3489179826..19277212e1 100644 > --- a/xen/include/asm-arm/insn.h > +++ b/xen/include/asm-arm/insn.h > @@ -11,6 +11,9 @@ > # error "unknown ARM variant" > #endif > > +/* On ARM32,64 instructions are always 4 bytes long. */ > +#define ARCH_PATCH_INSN_SIZE 4 > + > #endif /* !__ARCH_ARM_INSN */ > /* > * Local variables: > diff --git a/xen/include/asm-arm/livepatch.h b/xen/include/asm-arm/livepatch.h > index 6bca79deb9..026af5e7dc 100644 > --- a/xen/include/asm-arm/livepatch.h > +++ b/xen/include/asm-arm/livepatch.h > @@ -7,9 +7,7 @@ > #define __XEN_ARM_LIVEPATCH_H__ > > #include <xen/sizes.h> /* For SZ_* macros. */ > - > -/* On ARM32,64 instructions are always 4 bytes long. */ > -#define ARCH_PATCH_INSN_SIZE 4 > +#include <asm/insn.h> > > /* > * The va of the hypervisor .text region. We need this as the > -- > 2.11.0 >
diff --git a/xen/arch/arm/alternative.c b/xen/arch/arm/alternative.c index 52ed7edf69..237c4e5642 100644 --- a/xen/arch/arm/alternative.c +++ b/xen/arch/arm/alternative.c @@ -30,8 +30,6 @@ #include <asm/byteorder.h> #include <asm/cpufeature.h> #include <asm/insn.h> -/* XXX: Move ARCH_PATCH_INSN_SIZE out of livepatch.h */ -#include <asm/livepatch.h> #include <asm/page.h> /* Override macros from asm/page.h to make them work with mfn_t */ diff --git a/xen/include/asm-arm/insn.h b/xen/include/asm-arm/insn.h index 3489179826..19277212e1 100644 --- a/xen/include/asm-arm/insn.h +++ b/xen/include/asm-arm/insn.h @@ -11,6 +11,9 @@ # error "unknown ARM variant" #endif +/* On ARM32,64 instructions are always 4 bytes long. */ +#define ARCH_PATCH_INSN_SIZE 4 + #endif /* !__ARCH_ARM_INSN */ /* * Local variables: diff --git a/xen/include/asm-arm/livepatch.h b/xen/include/asm-arm/livepatch.h index 6bca79deb9..026af5e7dc 100644 --- a/xen/include/asm-arm/livepatch.h +++ b/xen/include/asm-arm/livepatch.h @@ -7,9 +7,7 @@ #define __XEN_ARM_LIVEPATCH_H__ #include <xen/sizes.h> /* For SZ_* macros. */ - -/* On ARM32,64 instructions are always 4 bytes long. */ -#define ARCH_PATCH_INSN_SIZE 4 +#include <asm/insn.h> /* * The va of the hypervisor .text region. We need this as the
At the moment, ARCH_PATCH_INSN_SIZE is defined in the header livepatch.h. However, this is also used in the alternative code. Rather than including livepatch.h just for using the define, move it in the header insn.h which seems more suitable. Signed-off-by: Julien Grall <julien.grall@arm.com> --- xen/arch/arm/alternative.c | 2 -- xen/include/asm-arm/insn.h | 3 +++ xen/include/asm-arm/livepatch.h | 4 +--- 3 files changed, 4 insertions(+), 5 deletions(-)