* [Qemu-devel] [PULL 0/2] target-mips queue @ 2017-07-11 15:16 Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 1/2] target/mips: fix msa copy_[s|u]_df rd = 0 corner case Yongbok Kim ` (2 more replies) 0 siblings, 3 replies; 4+ messages in thread From: Yongbok Kim @ 2017-07-11 15:16 UTC (permalink / raw) To: qemu-devel The following changes since commit b5ed2e11ef39a308dcbef46f66774557b4a41fce: build: disable Xen on ARM (2017-07-11 11:23:47 +0100) are available in the git repository at: git://github.com/yongbok/upstream-qemu.git tags/mips-20170711 for you to fetch changes up to 9768e2abf7ca3ef181f7cec134d7305c1643f78a: mips/malta: load the initrd at the end of the low memory (2017-07-11 15:06:34 +0100) ---------------------------------------------------------------- MIPS patches 2017-07-11 Changes: * Fix MSA copy_[s|u]_df corner case of rd = 0 * Update malta to load the initrd at the end of the low memory ---------------------------------------------------------------- Aurelien Jarno (1): mips/malta: load the initrd at the end of the low memory Miodrag Dinic (1): target/mips: fix msa copy_[s|u]_df rd = 0 corner case hw/mips/mips_malta.c | 5 +++-- target/mips/translate.c | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) -- 2.7.4 ^ permalink raw reply [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 1/2] target/mips: fix msa copy_[s|u]_df rd = 0 corner case 2017-07-11 15:16 [Qemu-devel] [PULL 0/2] target-mips queue Yongbok Kim @ 2017-07-11 15:16 ` Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 2/2] mips/malta: load the initrd at the end of the low memory Yongbok Kim 2017-07-13 12:38 ` [Qemu-devel] [PULL 0/2] target-mips queue Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Yongbok Kim @ 2017-07-11 15:16 UTC (permalink / raw) To: qemu-devel; +Cc: Miodrag Dinic From: Miodrag Dinic <miodrag.dinic@imgtec.com> This patch fixes the msa copy_[s|u]_df instruction emulation when the destination register rd is zero. Without this patch the zero register would get clobbered, which should never happen because it is supposed to be hardwired to 0. Fix this corner case by explicitly checking rd = 0 and effectively making these instructions emulation no-op in that case. Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Acked-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com> --- target/mips/translate.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/target/mips/translate.c b/target/mips/translate.c index 559f8fe..befb87f 100644 --- a/target/mips/translate.c +++ b/target/mips/translate.c @@ -18712,10 +18712,14 @@ static void gen_msa_elm_df(CPUMIPSState *env, DisasContext *ctx, uint32_t df, #endif switch (MASK_MSA_ELM(ctx->opcode)) { case OPC_COPY_S_df: - gen_helper_msa_copy_s_df(cpu_env, tdf, twd, tws, tn); + if (likely(wd != 0)) { + gen_helper_msa_copy_s_df(cpu_env, tdf, twd, tws, tn); + } break; case OPC_COPY_U_df: - gen_helper_msa_copy_u_df(cpu_env, tdf, twd, tws, tn); + if (likely(wd != 0)) { + gen_helper_msa_copy_u_df(cpu_env, tdf, twd, tws, tn); + } break; case OPC_INSERT_df: gen_helper_msa_insert_df(cpu_env, tdf, twd, tws, tn); -- 2.7.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* [Qemu-devel] [PULL 2/2] mips/malta: load the initrd at the end of the low memory 2017-07-11 15:16 [Qemu-devel] [PULL 0/2] target-mips queue Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 1/2] target/mips: fix msa copy_[s|u]_df rd = 0 corner case Yongbok Kim @ 2017-07-11 15:16 ` Yongbok Kim 2017-07-13 12:38 ` [Qemu-devel] [PULL 0/2] target-mips queue Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Yongbok Kim @ 2017-07-11 15:16 UTC (permalink / raw) To: qemu-devel; +Cc: Aurelien Jarno From: Aurelien Jarno <aurelien@aurel32.net> Currently the malta board is loading the initrd just after the kernel. This doesn't work for kaslr enabled kernels, as the initrd ends-up being overwritten. Move the initrd at the end of the low memory, that should leave a sufficient gap for kaslr. Signed-off-by: Aurelien Jarno <aurelien@aurel32.net> Tested-by: Yongbok Kim <yongbok.kim@imgtec.com> Signed-off-by: Yongbok Kim <yongbok.kim@imgtec.com> --- hw/mips/mips_malta.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/mips/mips_malta.c b/hw/mips/mips_malta.c index 95cdabb..dad2f37 100644 --- a/hw/mips/mips_malta.c +++ b/hw/mips/mips_malta.c @@ -841,8 +841,9 @@ static int64_t load_kernel (void) if (loaderparams.initrd_filename) { initrd_size = get_image_size (loaderparams.initrd_filename); if (initrd_size > 0) { - initrd_offset = (kernel_high + ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; - if (initrd_offset + initrd_size > ram_size) { + initrd_offset = (loaderparams.ram_low_size - initrd_size + - ~INITRD_PAGE_MASK) & INITRD_PAGE_MASK; + if (kernel_high >= initrd_offset) { fprintf(stderr, "qemu: memory too small for initial ram disk '%s'\n", loaderparams.initrd_filename); -- 2.7.4 ^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PULL 0/2] target-mips queue 2017-07-11 15:16 [Qemu-devel] [PULL 0/2] target-mips queue Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 1/2] target/mips: fix msa copy_[s|u]_df rd = 0 corner case Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 2/2] mips/malta: load the initrd at the end of the low memory Yongbok Kim @ 2017-07-13 12:38 ` Peter Maydell 2 siblings, 0 replies; 4+ messages in thread From: Peter Maydell @ 2017-07-13 12:38 UTC (permalink / raw) To: Yongbok Kim; +Cc: QEMU Developers On 11 July 2017 at 16:16, Yongbok Kim <yongbok.kim@imgtec.com> wrote: > The following changes since commit b5ed2e11ef39a308dcbef46f66774557b4a41fce: > > build: disable Xen on ARM (2017-07-11 11:23:47 +0100) > > are available in the git repository at: > > git://github.com/yongbok/upstream-qemu.git tags/mips-20170711 > > for you to fetch changes up to 9768e2abf7ca3ef181f7cec134d7305c1643f78a: > > mips/malta: load the initrd at the end of the low memory (2017-07-11 15:06:34 +0100) > > ---------------------------------------------------------------- > MIPS patches 2017-07-11 > > Changes: > * Fix MSA copy_[s|u]_df corner case of rd = 0 > * Update malta to load the initrd at the end of the low memory > > ---------------------------------------------------------------- > > Aurelien Jarno (1): > mips/malta: load the initrd at the end of the low memory > > Miodrag Dinic (1): > target/mips: fix msa copy_[s|u]_df rd = 0 corner case > > hw/mips/mips_malta.c | 5 +++-- > target/mips/translate.c | 8 ++++++-- > 2 files changed, 9 insertions(+), 4 deletions(-) Applied, thanks. -- PMM ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-07-13 12:38 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-07-11 15:16 [Qemu-devel] [PULL 0/2] target-mips queue Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 1/2] target/mips: fix msa copy_[s|u]_df rd = 0 corner case Yongbok Kim 2017-07-11 15:16 ` [Qemu-devel] [PULL 2/2] mips/malta: load the initrd at the end of the low memory Yongbok Kim 2017-07-13 12:38 ` [Qemu-devel] [PULL 0/2] target-mips queue Peter Maydell
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).