[gem5-dev] Change in gem5/gem5[master]: base: change logger exit behavior
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23683 ) Change subject: base: change logger exit behavior .. base: change logger exit behavior Under the old behavior, googletest tests with failing statements throw an empty exception and then abort. The behavior causes a problem in death/exit tests caused by fatal statements since the googletest interface is designed to either catch an exception or die. The googletest interface does not provide a method to catch an exception and then die. With the googletest interface, you'd end up with something resembling the following: statement which fails: Obj obj_fail_in_constructor(); googletest: ASSERT_ANY_THROW(Obj obj_fail_in_constructor()); ASSERT_EXIT(Obj obj_fail_in_constructor(), ""); The ASSERT_ANY_THROW does not work in isolation because the constructor fails immediately after the exception is handled by the API. The ASSERT_EXIT does not work in isolation because the exception surfaces immediately before the exit. The changeset simplifies the logger's exit_helper method to just directly call the stdlib exit instead of tunneling into the googletest logger's exit method. It avoids the empty exception being thrown. The result allows ASSERT_EXIT to be called within googletest death tests to handle gem5's fatal calls. Change-Id: Ifdd1769e398feea3f9ff06b88037d26398b32ee1 --- M src/base/gtest/logging.cc M src/base/logging.cc M src/base/logging.hh 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/src/base/gtest/logging.cc b/src/base/gtest/logging.cc index 92d2602..3139d66 100644 --- a/src/base/gtest/logging.cc +++ b/src/base/gtest/logging.cc @@ -35,14 +35,6 @@ namespace { -// This custom exception type will help prevent fatal exceptions from being -// caught by other code in gem5 and let them escape to the gtest framework. -// Unfortunately that results in a somewhat confusing message about an unknown -// exception being thrown after the panic/fatal message has been printed, but -// there will at least be some indication what went wrong. -struct GTestException -{}; - class GTestLogger : public Logger { public: @@ -63,8 +55,6 @@ { ADD_FAILURE_AT(loc.file, loc.line) << s; } -// Throw an exception to escape down to the gtest framework. -void exit() override { throw GTestException(); } }; GTestExitLogger panicLogger("panic: "); diff --git a/src/base/logging.cc b/src/base/logging.cc index adc3deb..6205a95 100644 --- a/src/base/logging.cc +++ b/src/base/logging.cc @@ -73,17 +73,8 @@ } }; -class FatalLogger : public ExitLogger -{ - public: -using ExitLogger::ExitLogger; - - protected: -void exit() override { ::exit(1); } -}; - ExitLogger panicLogger("panic: "); -FatalLogger fatalLogger("fatal: "); +ExitLogger fatalLogger("fatal: "); NormalLogger warnLogger("warn: "); NormalLogger infoLogger("info: "); NormalLogger hackLogger("hack: "); diff --git a/src/base/logging.hh b/src/base/logging.hh index 7040037..f3f413b 100644 --- a/src/base/logging.hh +++ b/src/base/logging.hh @@ -121,13 +121,12 @@ // This helper is necessary since noreturn isn't inherited by virtual // functions, and gcc will get mad if a function calls panic and then // doesn't return. -void exit_helper() M5_ATTR_NORETURN { exit(); ::abort(); } +void exit_helper() M5_ATTR_NORETURN { exit(1); } protected: bool enabled; virtual void log(const Loc , std::string s) = 0; -virtual void exit() { /* Fall through to the abort in exit_helper. */ } const char *prefix; }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23683 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdd1769e398feea3f9ff06b88037d26398b32ee1 Gerrit-Change-Number: 23683 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: cpu, sim-se: move error checks in syscall methods
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/23240 ) Change subject: cpu,sim-se: move error checks in syscall methods .. cpu,sim-se: move error checks in syscall methods There is a check on a global flag denoting that the simulator has been configured to run in fullsystem mode. The check is conducted at runtime during calls to syscall methods. The high-level models are checking the flag when the check could be conducted further down the call chain (nearer to the actual Process invocation). Moving the checks should result in less copy-pasta as new models are developed. It might be argued that the checks should stay in place since an error would detected earlier; that may be true, but the error would be the same and the simulation should fail in either case. This arrangement requires fewer lines of code. The changeset also changes the check into a fatal error instead of a panic since usage (in fs mode) should result in immediate corruption. Change-Id: If387e27f166ac1374f3fe8b7befe3546e69adba7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23240 Reviewed-by: Giacomo Travaglini Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/cpu/minor/exec_context.hh M src/cpu/o3/dyn_inst_impl.hh M src/cpu/o3/thread_state.hh M src/cpu/simple/exec_context.hh M src/cpu/simple_thread.hh 5 files changed, 3 insertions(+), 10 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved Giacomo Travaglini: Looks good to me, but someone else must approve kokoro: Regressions pass diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh index 87787f0..66e313e 100644 --- a/src/cpu/minor/exec_context.hh +++ b/src/cpu/minor/exec_context.hh @@ -389,9 +389,6 @@ void syscall(int64_t callnum, Fault *fault) override { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode.\n"); - thread.syscall(callnum, fault); } diff --git a/src/cpu/o3/dyn_inst_impl.hh b/src/cpu/o3/dyn_inst_impl.hh index fbeb3c2..22d89ec 100644 --- a/src/cpu/o3/dyn_inst_impl.hh +++ b/src/cpu/o3/dyn_inst_impl.hh @@ -45,7 +45,6 @@ #include "base/cp_annotate.hh" #include "cpu/o3/dyn_inst.hh" -#include "sim/full_system.hh" #include "debug/O3PipeView.hh" template @@ -195,9 +194,6 @@ void BaseO3DynInst::syscall(int64_t callnum, Fault *fault) { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode.\n"); - // HACK: check CPU's nextPC before and after syscall. If it // changes, update this instruction's nextPC because the syscall // must have changed the nextPC. diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh index a4a1233..a0c3a81 100644 --- a/src/cpu/o3/thread_state.hh +++ b/src/cpu/o3/thread_state.hh @@ -150,6 +150,7 @@ /** Handles the syscall. */ void syscall(int64_t callnum, Fault *fault) { +fatal_if(FullSystem, "System call emulation is unavailable!"); process->syscall(callnum, tc, fault); } diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index 91f7ec5..4d26dfe 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -499,9 +499,6 @@ void syscall(int64_t callnum, Fault *fault) override { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode."); - thread->syscall(callnum, fault); } diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index f25e622..387e745 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -66,6 +66,7 @@ #include "mem/request.hh" #include "sim/byteswap.hh" #include "sim/eventq.hh" +#include "sim/full_system.hh" #include "sim/process.hh" #include "sim/serialize.hh" #include "sim/system.hh" @@ -610,6 +611,7 @@ void syscall(int64_t callnum, Fault *fault) override { +fatal_if(FullSystem, "System call emulation is unavailable!"); process->syscall(callnum, this, fault); } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23240 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If387e27f166ac1374f3fe8b7befe3546e69adba7 Gerrit-Change-Number: 23240 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: cpu, sim-se: move error checks in syscall methods
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23240 ) Change subject: cpu,sim-se: move error checks in syscall methods .. cpu,sim-se: move error checks in syscall methods There is a check on a global flag denoting that the simulator has been configured to run in fullsystem mode. The check is conducted at runtime during calls to syscall methods. The high-level models are checking the flag when the check could be conducted further down the call chain (nearer to the actual Process invocation). Moving the checks should result in less copy-pasta as new models are developed. It might be argued that the checks should stay in place since an error would detected earlier; that may be true, but the error would be the same and the simulation should fail in either case. This arrangement requires fewer lines of code. The changeset also changes the check into a fatal error instead of a panic since usage (in fs mode) should result in immediate corruption. Change-Id: If387e27f166ac1374f3fe8b7befe3546e69adba7 --- M src/cpu/minor/exec_context.hh M src/cpu/o3/dyn_inst_impl.hh M src/cpu/o3/thread_state.hh M src/cpu/simple/exec_context.hh M src/cpu/simple_thread.hh 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/src/cpu/minor/exec_context.hh b/src/cpu/minor/exec_context.hh index 87787f0..66e313e 100644 --- a/src/cpu/minor/exec_context.hh +++ b/src/cpu/minor/exec_context.hh @@ -389,9 +389,6 @@ void syscall(int64_t callnum, Fault *fault) override { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode.\n"); - thread.syscall(callnum, fault); } diff --git a/src/cpu/o3/dyn_inst_impl.hh b/src/cpu/o3/dyn_inst_impl.hh index fbeb3c2..22d89ec 100644 --- a/src/cpu/o3/dyn_inst_impl.hh +++ b/src/cpu/o3/dyn_inst_impl.hh @@ -45,7 +45,6 @@ #include "base/cp_annotate.hh" #include "cpu/o3/dyn_inst.hh" -#include "sim/full_system.hh" #include "debug/O3PipeView.hh" template @@ -195,9 +194,6 @@ void BaseO3DynInst::syscall(int64_t callnum, Fault *fault) { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode.\n"); - // HACK: check CPU's nextPC before and after syscall. If it // changes, update this instruction's nextPC because the syscall // must have changed the nextPC. diff --git a/src/cpu/o3/thread_state.hh b/src/cpu/o3/thread_state.hh index a4a1233..a0c3a81 100644 --- a/src/cpu/o3/thread_state.hh +++ b/src/cpu/o3/thread_state.hh @@ -150,6 +150,7 @@ /** Handles the syscall. */ void syscall(int64_t callnum, Fault *fault) { +fatal_if(FullSystem, "System call emulation is unavailable!"); process->syscall(callnum, tc, fault); } diff --git a/src/cpu/simple/exec_context.hh b/src/cpu/simple/exec_context.hh index 91f7ec5..4d26dfe 100644 --- a/src/cpu/simple/exec_context.hh +++ b/src/cpu/simple/exec_context.hh @@ -499,9 +499,6 @@ void syscall(int64_t callnum, Fault *fault) override { -if (FullSystem) -panic("Syscall emulation isn't available in FS mode."); - thread->syscall(callnum, fault); } diff --git a/src/cpu/simple_thread.hh b/src/cpu/simple_thread.hh index f25e622..387e745 100644 --- a/src/cpu/simple_thread.hh +++ b/src/cpu/simple_thread.hh @@ -66,6 +66,7 @@ #include "mem/request.hh" #include "sim/byteswap.hh" #include "sim/eventq.hh" +#include "sim/full_system.hh" #include "sim/process.hh" #include "sim/serialize.hh" #include "sim/system.hh" @@ -610,6 +611,7 @@ void syscall(int64_t callnum, Fault *fault) override { +fatal_if(FullSystem, "System call emulation is unavailable!"); process->syscall(callnum, this, fault); } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23240 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If387e27f166ac1374f3fe8b7befe3546e69adba7 Gerrit-Change-Number: 23240 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: replace memstate api with regions
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23146 ) Change subject: sim-se: replace memstate api with regions .. sim-se: replace memstate api with regions This changeset uses the region abstraction instead of using memstate to track special beginning and end values for code regions. Change-Id: Ife486cc61aeaf2f9a741ff93b8c5a283108d307b --- M src/arch/alpha/process.cc M src/arch/x86/process.cc M src/sim/SConscript A src/sim/mem_state.cc M src/sim/mem_state.hh M src/sim/process.cc M src/sim/process.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 9 files changed, 135 insertions(+), 109 deletions(-) diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 3147695..d2f9731 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -54,21 +54,14 @@ objFile) { fatal_if(params->useArchPT, "Arch page tables not implemented."); -Addr brk_point = roundUp(image.maxAddr(), PageBytes); -// Set up stack. On Alpha, stack goes below the image. -Addr stack_base = image.minAddr() - (409600 + 4096); +MemState::Regions regs(regions(image)); -// Set up region for mmaps. -Addr mmap_end = 0x1; +Addr base = image.minAddr() - 0x63000; +regs["stack"] = {base, base + PageBytes, 0x63000, PageBytes}; +regs["mmap"] = {0x1, 0x1 + PageBytes, MaxAddr, PageBytes}; -Addr max_stack_size = 8 * 1024 * 1024; - -// Set pointer for next thread stack. Reserve 8M for main stack. -Addr next_thread_stack_base = stack_base - max_stack_size; - -memState = make_shared(brk_point, stack_base, max_stack_size, - next_thread_stack_base, mmap_end); +memState = make_shared(regs); } void diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index 09ff71f..40f1c89 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -136,14 +136,10 @@ vsyscallPage.vtimeOffset = 0x400; vsyscallPage.vgettimeofdayOffset = 0x0; -Addr brk_point = roundUp(image.maxAddr(), PageBytes); -Addr stack_base = 0x7000ULL; -Addr max_stack_size = 8 * 1024 * 1024; -Addr next_thread_stack_base = stack_base - max_stack_size; -Addr mmap_end = 0x77FFF000ULL; - -memState = make_shared(brk_point, stack_base, max_stack_size, - next_thread_stack_base, mmap_end); +MemState::Regions regs(regions(image)); +regs["stack"] = {0x7000, 0x7FFFE000, 0x80, PageBytes}; +regs["mmap"] = {0x77FFF000, 0x77FFE000, MaxAddr, PageBytes}; +memState = make_shared(regs); } void @@ -175,14 +171,10 @@ vsyscallPage.vsyscallOffset = 0x400; vsyscallPage.vsysexitOffset = 0x410; -Addr brk_point = roundUp(image.maxAddr(), PageBytes); -Addr stack_base = _gdtStart; -Addr max_stack_size = 8 * 1024 * 1024; -Addr next_thread_stack_base = stack_base - max_stack_size; -Addr mmap_end = 0xB7FFF000ULL; - -memState = make_shared(brk_point, stack_base, max_stack_size, - next_thread_stack_base, mmap_end); +MemState::Regions regs(regions(image)); +regs["stack"] = {0xD000, 0xC000, 0x80, PageBytes}; +regs["mmap"] = {0xB7FFF000, 0xB7FFE000, MaxAddr, PageBytes}; +memState = make_shared(regs); } SyscallDesc* @@ -945,14 +937,15 @@ aux_padding + frame_size; -Addr stack_base = memState->getStackBase(); +auto = memState->regions["stack"]; +Addr stack_base = region.base(); Addr stack_min = stack_base - space_needed; stack_min = roundDown(stack_min, align); -unsigned stack_size = stack_base - stack_min; +Addr stack_size = stack_base - stack_min; stack_size = roundUp(stack_size, pageSize); -memState->setStackSize(stack_size); +Addr num_pages = stack_size / pageSize; // map memory Addr stack_end = roundDown(stack_base - stack_size, pageSize); @@ -1033,7 +1026,7 @@ tc->pcState(getStartPC()); // Align the "stack_min" to a page boundary. -memState->setStackMin(roundDown(stack_min, pageSize)); +region.expand(num_pages); } void diff --git a/src/sim/SConscript b/src/sim/SConscript index d35787f..9a141c8 100644 --- a/src/sim/SConscript +++ b/src/sim/SConscript @@ -91,6 +91,7 @@ Source('syscall_desc.cc') Source('region.cc') GTest('region.test', 'region.test.cc', 'region.cc') +Source('mem_state.cc') if env['TARGET_ISA'] != 'x86': Source('microcode_rom.cc') diff --git a/src/sim/mem_state.cc b/src/sim/mem_state.cc new file mode 100644 index 000..ed91231 --- /dev/null +++ b/src/sim/mem_state.cc @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017-2019 Advanced Micro Devices, Inc. + * All
[gem5-dev] Change in gem5/gem5[master]: base: add features to MemoryImage::Segment
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23145 ) Change subject: base: add features to MemoryImage::Segment .. base: add features to MemoryImage::Segment This changeset adds some helper methods to Segment to allow usage of standard algorithms in a subsequent changeset. The following changeset needs to be able to sort and partition the segments. Change-Id: I8a481c69b5ec142ee36b6884c009f32d12b411e0 --- M src/base/loader/elf_object.cc M src/base/loader/memory_image.hh 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index bbaa27b..69038a3 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -258,7 +258,7 @@ auto name = std::to_string(seg_num); image.addSegment({ name, phdr.p_paddr, imageData, - phdr.p_offset, phdr.p_filesz }); + phdr.p_offset, phdr.p_filesz, phdr.p_flags }); Addr uninitialized = phdr.p_memsz - phdr.p_filesz; if (uninitialized) { // There may be parts of a segment which aren't included in the @@ -266,7 +266,8 @@ // data to take up the extra space. This should be zeroed when // loaded into memory. image.addSegment({ name + "(uninitialized)", - phdr.p_paddr + phdr.p_filesz, uninitialized }); + phdr.p_paddr + phdr.p_filesz, uninitialized, + phdr.p_flags}); } const Addr file_start = phdr.p_offset; diff --git a/src/base/loader/memory_image.hh b/src/base/loader/memory_image.hh index a10daba..ce91e94 100644 --- a/src/base/loader/memory_image.hh +++ b/src/base/loader/memory_image.hh @@ -51,17 +51,19 @@ struct Segment { Segment(const std::string &_name, Addr _base, -const uint8_t *_data, size_t _size) : -name(_name), base(_base), data(_data), size(_size) +const uint8_t *_data, size_t _size, unsigned _flags = 0) : +name(_name), base(_base), data(_data), size(_size), flags(_flags) {} -Segment(const std::string &_name, Addr _base, size_t _size) : -name(_name), base(_base), size(_size) +Segment(const std::string &_name, Addr _base, size_t _size, +unsigned _flags = 0) : +name(_name), base(_base), size(_size), flags(_flags) {} Segment(const std::string &_name, Addr _base, -const ImageFileDataPtr &_ifd, Addr offset, size_t _size) : -ifd(_ifd), name(_name), base(_base), size(_size) +const ImageFileDataPtr &_ifd, Addr offset, size_t _size, +unsigned _flags = 0) : +ifd(_ifd), name(_name), base(_base), size(_size), flags(_flags) { panic_if(offset + size > ifd->len(), "Segment outside the bounds of the image data"); @@ -72,11 +74,15 @@ Segment(_name, 0, _ifd, 0, _ifd->len()) {} +bool executable() const { return flags & 0x1; } +bool operator <(const Segment& o) const { return base < o.base; } + ImageFileDataPtr ifd; std::string name; Addr base = 0; const uint8_t *data = nullptr; size_t size = 0; +unsigned flags; }; MemoryImage() {} -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23145 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I8a481c69b5ec142ee36b6884c009f32d12b411e0 Gerrit-Change-Number: 23145 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se, tests: Add Region class and basic tests
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23143 ) Change subject: sim-se,tests: Add Region class and basic tests .. sim-se,tests: Add Region class and basic tests The Region class encapsulates address information for regions of the process address space. For instance, it can be used to represent the stack, data, and heap areas. Change-Id: Ib8c1616c7a63392cac1d8fc9f14ed0c141755cf7 --- M src/sim/SConscript A src/sim/region.cc A src/sim/region.hh A src/sim/region.test.cc 4 files changed, 559 insertions(+), 0 deletions(-) diff --git a/src/sim/SConscript b/src/sim/SConscript index aacdb34..d35787f 100644 --- a/src/sim/SConscript +++ b/src/sim/SConscript @@ -89,6 +89,8 @@ Source('pseudo_inst.cc') Source('syscall_emul.cc') Source('syscall_desc.cc') +Source('region.cc') +GTest('region.test', 'region.test.cc', 'region.cc') if env['TARGET_ISA'] != 'x86': Source('microcode_rom.cc') diff --git a/src/sim/region.cc b/src/sim/region.cc new file mode 100644 index 000..79095fd --- /dev/null +++ b/src/sim/region.cc @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2019 Advanced Micro Devices, Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer; + * redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution; + * neither the name of the copyright holders nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * Author: Brandon Potter + */ + +#include "sim/region.hh" + +#include +#include + +Region::Region() +{ +_valid = false; +} + +Region::Region(Addr b, Addr c, Addr m, Addr p) +: _max(m), _pagesize(p) +{ +/** + * The interface expects base and cursor to be page aligned. + */ +if (b % _pagesize || c % _pagesize) +_valid = false; + +/** + * The interface expects base and cursor to be different values. + * If the values are the same, the class cannot know which direction + * the region should expand. + */ +if (b == c) +_valid = false; + +/** + * Determine which direction the region should expand. + */ +_up = c > b; + +/** + * Normalize the start and end addresses for the AddrRange class. + * Note: this does not alter either Region::base or Region::cursor since + * b and c are just temporaries on the call stack. + */ +if (!_up) +std::swap(b, c); + +_range = std::unique_ptr(new AddrRange(b, c)); +} + +Region::Region(const Region& other) +{ +_up = other._up; +_max = other._max; +_range = std::unique_ptr(new AddrRange(*other._range)); +_valid = other._valid; +_pagesize = other._pagesize; +} + +Region& +Region::operator=(Region other) +{ +swap(*this, other); +return *this; +} + +void +swap(Region , Region ) +{ +std::swap(l._up, r._up); +std::swap(l._max, r._max); +std::swap(l._range, r._range); +std::swap(l._valid, r._valid); +std::swap(l._pagesize, r._pagesize); +} + +Addr +Region::base() const +{ +return _up ? _range->start() : _range->end(); +} + +void +Region::base(Addr b) +{ +Region temp(b, cursor(), _max, _pagesize); +swap(*this, temp); +} + +Addr +Region::cursor() const +{ +return _up ? _range->end() : _range->start(); +} + +void +Region::cursor(Addr c) +{ +Region temp(base(), c, _max, _pagesize); +swap(*this, temp); +} + +Addr +Region::size() const +{ +return _range->size(); +} + +Addr +Region::max() const +{ +return _max; +} + +bool +Region::max(Addr m) +{ +/** + * Avoid setting max when the current alloca
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove serialize methods from memstate
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/23144 ) Change subject: sim-se: remove serialize methods from memstate .. sim-se: remove serialize methods from memstate Change-Id: I198103a9d8730faefd472cde7cafdb984634261c --- M src/sim/mem_state.hh M src/sim/process.cc 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/sim/mem_state.hh b/src/sim/mem_state.hh index ca07a64..03a7197 100644 --- a/src/sim/mem_state.hh +++ b/src/sim/mem_state.hh @@ -31,8 +31,6 @@ #ifndef SRC_SIM_MEM_STATE_HH #define SRC_SIM_MEM_STATE_HH -#include "sim/serialize.hh" - /** * This class holds the memory state for the Process class and all of its * derived, architecture-specific children. @@ -47,7 +45,7 @@ * pointer interface because two process can potentially share their virtual * address space if certain options are passed into the clone(2). */ -class MemState : public Serializable +class MemState { public: MemState(Addr brk_point, Addr stack_base, Addr max_stack_size, @@ -89,29 +87,6 @@ void setNextThreadStackBase(Addr ntsb) { _nextThreadStackBase = ntsb; } void setMmapEnd(Addr mmap_end) { _mmapEnd = mmap_end; } -void -serialize(CheckpointOut ) const override -{ -paramOut(cp, "brkPoint", _brkPoint); -paramOut(cp, "stackBase", _stackBase); -paramOut(cp, "stackSize", _stackSize); -paramOut(cp, "maxStackSize", _maxStackSize); -paramOut(cp, "stackMin", _stackMin); -paramOut(cp, "nextThreadStackBase", _nextThreadStackBase); -paramOut(cp, "mmapEnd", _mmapEnd); -} -void -unserialize(CheckpointIn ) override -{ -paramIn(cp, "brkPoint", _brkPoint); -paramIn(cp, "stackBase", _stackBase); -paramIn(cp, "stackSize", _stackSize); -paramIn(cp, "maxStackSize", _maxStackSize); -paramIn(cp, "stackMin", _stackMin); -paramIn(cp, "nextThreadStackBase", _nextThreadStackBase); -paramIn(cp, "mmapEnd", _mmapEnd); -} - private: Addr _brkPoint; Addr _stackBase; diff --git a/src/sim/process.cc b/src/sim/process.cc index db013ae..bc9f289 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -401,7 +401,6 @@ void Process::serialize(CheckpointOut ) const { -memState->serialize(cp); pTable->serialize(cp); /** * Checkpoints for file descriptors currently do not work. Need to @@ -414,7 +413,6 @@ void Process::unserialize(CheckpointIn ) { -memState->unserialize(cp); pTable->unserialize(cp); /** * Checkpoints for file descriptors currently do not work. Need to -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/23144 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I198103a9d8730faefd472cde7cafdb984634261c Gerrit-Change-Number: 23144 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: cpu-o3, tests: add page boundary access test
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/22303 ) Change subject: cpu-o3,tests: add page boundary access test .. cpu-o3,tests: add page boundary access test The O3 model supports unaligned accesses across page boundaries. This changeset provides a stress test for the feature. Other benchmarks exercise it, but their coverage is spotty. This test does nothing else except poke bytes which straddle page boundaries. Change-Id: Ic20c2862bcb7af7be091030c12916ba499db10c7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22303 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- A tests/test-progs/page-access-wrap/Makefile A tests/test-progs/page-access-wrap/page-access-wrap.cpp 2 files changed, 87 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/tests/test-progs/page-access-wrap/Makefile b/tests/test-progs/page-access-wrap/Makefile new file mode 100644 index 000..41e7a18 --- /dev/null +++ b/tests/test-progs/page-access-wrap/Makefile @@ -0,0 +1,20 @@ + +CPP := g++ + +TEST_OBJS := page-access-wrap.o +TEST_PROGS := $(TEST_OBJS:.o=) + +# Rules == + +.PHONY: default clean + +default: $(TEST_PROGS) + +clean: + $(RM) $(TEST_OBJS) $(TEST_PROGS) + +$(TEST_PROGS): $(TEST_OBJS) + $(CPP) -static -o $@ $@.o + +%.o: %.c Makefile + $(CPP) -c -o $@ $*.c -msse3 diff --git a/tests/test-progs/page-access-wrap/page-access-wrap.cpp b/tests/test-progs/page-access-wrap/page-access-wrap.cpp new file mode 100644 index 000..d4cc75e --- /dev/null +++ b/tests/test-progs/page-access-wrap/page-access-wrap.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 Advanced Micro Devices, Inc. + * All rights reserved. + * + * For use for simulation and test purposes only + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Brandon Potter + */ + +#include + +#include +#include +#include +#include + +int main(void) +{ +uint64_t page_size = 0x1000; +uint64_t num_pages = 0x1; +uint64_t length = page_size * num_pages; + +void *raw = mmap(NULL, length, PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); +uint8_t *mem = reinterpret_cast(raw); + +srand(0xABCD); + +uint64_t last_byte = page_size - 1; +uint64_t page_boundaries = num_pages - 1; + +for (int i = 0; i < 2000; i++) { +uint64_t random_boundary = rand() % page_boundaries; +uint64_t boundary_offset = random_boundary * page_size; +uint64_t boundary_last_byte = boundary_offset + last_byte; +uint32_t *poke = reinterpret_cast(mem + boundary_last_byte); +printf("%p\n", poke); +uint32_t value = *poke; +} + +return 0; +} -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22303 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic20c2862bcb7af7be091030c12916ba499db10c7 Gerrit-Change-Number: 22303 Gerrit-PatchSet: 4 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Bobby R. Bruce Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Ger
[gem5-dev] Change in gem5/gem5[master]: cpu-o3: bugfix for partial faults in x86
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/22283 ) Change subject: cpu-o3: bugfix for partial faults in x86 .. cpu-o3: bugfix for partial faults in x86 The c58cb8c9 changeset broke some code related to checking consistency model guarantees (found in X86 benchmarks). This changeset adds some documentation to the code and obviates the problem. Change-Id: Ied9c6b0b1d237538efe4beb2f97ef76248ce2746 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22283 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Brandon Potter --- M src/cpu/o3/lsq_impl.hh 1 file changed, 25 insertions(+), 1 deletion(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/cpu/o3/lsq_impl.hh b/src/cpu/o3/lsq_impl.hh index c2d5e90..d7dc618 100644 --- a/src/cpu/o3/lsq_impl.hh +++ b/src/cpu/o3/lsq_impl.hh @@ -1152,13 +1152,37 @@ return ( (LSQRequest::_requests[0]->getPaddr() & blockMask) == blockAddr); } +/** + * Caches may probe into the load-store queue to enforce memory ordering + * guarantees. This method supports probes by providing a mechanism to compare + * snoop messages with requests tracked by the load-store queue. + * + * Consistency models must enforce ordering constraints. TSO, for instance, + * must prevent memory reorderings except stores which are reordered after + * loads. The reordering restrictions negatively impact performance by + * cutting down on memory level parallelism. However, the core can regain + * performance by generating speculative loads. Speculative loads may issue + * without affecting correctness if precautions are taken to handle invalid + * memory orders. The load queue must squash under memory model violations. + * Memory model violations may occur when block ownership is granted to + * another core or the block cannot be accurately monitored by the load queue. + */ template bool LSQ::SplitDataRequest::isCacheBlockHit(Addr blockAddr, Addr blockMask) { bool is_hit = false; for (auto : _requests) { -if ((r->getPaddr() & blockMask) == blockAddr) { + /** +* The load-store queue handles partial faults which complicates this +* method. Physical addresses must be compared between requests and +* snoops. Some requests will not have a valid physical address, since +* partial faults may have outstanding translations. Therefore, the +* existence of a valid request address must be checked before +* comparing block hits. We assume no pipeline squash is needed if a +* valid request address does not exist. +*/ +if (r->hasPaddr() && (r->getPaddr() & blockMask) == blockAddr) { is_hit = true; break; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22283 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ied9c6b0b1d237538efe4beb2f97ef76248ce2746 Gerrit-Change-Number: 22283 Gerrit-PatchSet: 4 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Giacomo Gabrielli Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-CC: Andreas Sandberg Gerrit-CC: Bradford Beckmann Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: cpu-o3, tests: add page boundary access test
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/22303 ) Change subject: cpu-o3,tests: add page boundary access test .. cpu-o3,tests: add page boundary access test The O3 model supports unaligned accesses across page boundaries. This changeset provides a stress test for the feature. Other benchmarks exercise it, but their coverage is spotty. This test does nothing else except poke bytes which straddle page boundaries. Change-Id: Ic20c2862bcb7af7be091030c12916ba499db10c7 --- A tests/test-progs/page-access-wrap/Makefile A tests/test-progs/page-access-wrap/page-access-wrap.cpp 2 files changed, 87 insertions(+), 0 deletions(-) diff --git a/tests/test-progs/page-access-wrap/Makefile b/tests/test-progs/page-access-wrap/Makefile new file mode 100644 index 000..41e7a18 --- /dev/null +++ b/tests/test-progs/page-access-wrap/Makefile @@ -0,0 +1,20 @@ + +CPP := g++ + +TEST_OBJS := page-access-wrap.o +TEST_PROGS := $(TEST_OBJS:.o=) + +# Rules == + +.PHONY: default clean + +default: $(TEST_PROGS) + +clean: + $(RM) $(TEST_OBJS) $(TEST_PROGS) + +$(TEST_PROGS): $(TEST_OBJS) + $(CPP) -static -o $@ $@.o + +%.o: %.c Makefile + $(CPP) -c -o $@ $*.c -msse3 diff --git a/tests/test-progs/page-access-wrap/page-access-wrap.cpp b/tests/test-progs/page-access-wrap/page-access-wrap.cpp new file mode 100644 index 000..d4cc75e --- /dev/null +++ b/tests/test-progs/page-access-wrap/page-access-wrap.cpp @@ -0,0 +1,67 @@ +/* + * Copyright (c) 2019 Advanced Micro Devices, Inc. + * All rights reserved. + * + * For use for simulation and test purposes only + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * 3. Neither the name of the copyright holder nor the names of its + * contributors may be used to endorse or promote products derived from this + * software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" + * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE + * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + * Authors: Brandon Potter + */ + +#include + +#include +#include +#include +#include + +int main(void) +{ +uint64_t page_size = 0x1000; +uint64_t num_pages = 0x1; +uint64_t length = page_size * num_pages; + +void *raw = mmap(NULL, length, PROT_WRITE, MAP_ANON|MAP_PRIVATE, -1, 0); +uint8_t *mem = reinterpret_cast(raw); + +srand(0xABCD); + +uint64_t last_byte = page_size - 1; +uint64_t page_boundaries = num_pages - 1; + +for (int i = 0; i < 2000; i++) { +uint64_t random_boundary = rand() % page_boundaries; +uint64_t boundary_offset = random_boundary * page_size; +uint64_t boundary_last_byte = boundary_offset + last_byte; +uint32_t *poke = reinterpret_cast(mem + boundary_last_byte); +printf("%p\n", poke); +uint32_t value = *poke; +} + +return 0; +} -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22303 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic20c2862bcb7af7be091030c12916ba499db10c7 Gerrit-Change-Number: 22303 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: cpu-o3: bugfix for c58cb8c9
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/22283 ) Change subject: cpu-o3: bugfix for c58cb8c9 .. cpu-o3: bugfix for c58cb8c9 The partial faults changeset broken some code related to checking consistency model guarantees (found in X86 benchmarks). This changeset adds some documentation to the code and obviates the problem. Change-Id: Ied9c6b0b1d237538efe4beb2f97ef76248ce2746 --- M src/cpu/o3/lsq_impl.hh 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/cpu/o3/lsq_impl.hh b/src/cpu/o3/lsq_impl.hh index c2d5e90..d7dc618 100644 --- a/src/cpu/o3/lsq_impl.hh +++ b/src/cpu/o3/lsq_impl.hh @@ -1152,13 +1152,37 @@ return ( (LSQRequest::_requests[0]->getPaddr() & blockMask) == blockAddr); } +/** + * Caches may probe into the load-store queue to enforce memory ordering + * guarantees. This method supports probes by providing a mechanism to compare + * snoop messages with requests tracked by the load-store queue. + * + * Consistency models must enforce ordering constraints. TSO, for instance, + * must prevent memory reorderings except stores which are reordered after + * loads. The reordering restrictions negatively impact performance by + * cutting down on memory level parallelism. However, the core can regain + * performance by generating speculative loads. Speculative loads may issue + * without affecting correctness if precautions are taken to handle invalid + * memory orders. The load queue must squash under memory model violations. + * Memory model violations may occur when block ownership is granted to + * another core or the block cannot be accurately monitored by the load queue. + */ template bool LSQ::SplitDataRequest::isCacheBlockHit(Addr blockAddr, Addr blockMask) { bool is_hit = false; for (auto : _requests) { -if ((r->getPaddr() & blockMask) == blockAddr) { + /** +* The load-store queue handles partial faults which complicates this +* method. Physical addresses must be compared between requests and +* snoops. Some requests will not have a valid physical address, since +* partial faults may have outstanding translations. Therefore, the +* existence of a valid request address must be checked before +* comparing block hits. We assume no pipeline squash is needed if a +* valid request address does not exist. +*/ +if (r->hasPaddr() && (r->getPaddr() & blockMask) == blockAddr) { is_hit = true; break; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/22283 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ied9c6b0b1d237538efe4beb2f97ef76248ce2746 Gerrit-Change-Number: 22283 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: base, tests: Change assumption about AddrRange size
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/21939 ) Change subject: base,tests: Change assumption about AddrRange size .. base,tests: Change assumption about AddrRange size This changeset fixes an off-by-one error in the size method. An empty AddrRange (i.e. start and end are equal) would return a size of 1 even though the end is non-inclusive (according to doxygen comments). The changeset also adds two unit tests. Change-Id: I4bed6e633a4693bd6eaea7624f7f83d1b1165b10 --- M src/base/addr_range.hh M src/base/addr_range.test.cc 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/base/addr_range.hh b/src/base/addr_range.hh index cda6ccf..63647c6 100644 --- a/src/base/addr_range.hh +++ b/src/base/addr_range.hh @@ -281,7 +281,7 @@ */ Addr size() const { -return (_end - _start + 1) >> masks.size(); +return (_end - _start) >> masks.size(); } /** diff --git a/src/base/addr_range.test.cc b/src/base/addr_range.test.cc index 54eb198..3bef430 100644 --- a/src/base/addr_range.test.cc +++ b/src/base/addr_range.test.cc @@ -42,6 +42,18 @@ #include "base/addr_range.hh" #include "base/bitfield.hh" +TEST(AddrRange, ValidRange) +{ +AddrRange r; +EXPECT_FALSE(r.valid()); +} + +TEST(AddrRange, EmptyRange) +{ +AddrRange r(0x0, 0x0); +EXPECT_EQ(0, r.size()); +} + TEST(AddrRangeComp, AddrRangeIsSubset) { AddrRange r, r1, r2; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/21939 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4bed6e633a4693bd6eaea7624f7f83d1b1165b10 Gerrit-Change-Number: 21939 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: Fix invalid delete of params on clone
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/18068 ) Change subject: sim-se: Fix invalid delete of params on clone .. sim-se: Fix invalid delete of params on clone The params pointer is kept by the SimObject and should not be deleted until gem5 exits. Added a to do to remember this object is leaked. Change-Id: I46cc23a09e4e9b6bc2fdcd961148324c41820815 Signed-off-by: Jason Lowe-Power Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18068 Tested-by: kokoro Maintainer: Brandon Potter Reviewed-by: Brandon Potter --- M src/sim/syscall_emul.hh 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved Jason Lowe-Power: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 130791d..fb6e9a1 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1562,7 +1562,9 @@ pp->useArchPT = p->useArchPT; pp->kvmInSE = p->kvmInSE; Process *cp = pp->create(); -delete pp; +// TODO: there is no way to know when the Process SimObject is done with +// the params pointer. Both the params pointer (pp) and the process +// pointer (cp) are normally managed in python and are never cleaned up. Process *owner = ctc->getProcessPtr(); ctc->setProcessPtr(cp); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18068 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I46cc23a09e4e9b6bc2fdcd961148324c41820815 Gerrit-Change-Number: 18068 Gerrit-PatchSet: 6 Gerrit-Owner: Jason Lowe-Power Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: rename Process::setpgid member
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/20008 ) Change subject: sim-se: rename Process::setpgid member .. sim-se: rename Process::setpgid member The getter methods to access these types of members do not have a 'get' string in the method names. To make the interface a bit more consistent, remove the 'set' part of the member name. Change-Id: I04c56bd9d9feb1cf68ff50a1152083ea57ea7c62 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/20008 Reviewed-by: Anthony Gutierrez Maintainer: Brandon Potter Tested-by: kokoro --- M src/sim/process.hh M src/sim/syscall_emul.cc 2 files changed, 3 insertions(+), 3 deletions(-) Approvals: Anthony Gutierrez: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/process.hh b/src/sim/process.hh index 23ed6d6..ae23de4 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -87,8 +87,8 @@ inline uint64_t pid() { return _pid; } inline uint64_t ppid() { return _ppid; } inline uint64_t pgid() { return _pgid; } +inline void pgid(uint64_t pgid) { _pgid = pgid; } inline uint64_t tgid() { return _tgid; } -inline void setpgid(uint64_t pgid) { _pgid = pgid; } const char *progName() const { return executable.c_str(); } diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 088dcbc..f2f4f27 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -1001,7 +1001,7 @@ return -EINVAL; if (pid == 0) { -process->setpgid(process->pid()); +process->pgid(process->pid()); return 0; } @@ -1020,7 +1020,7 @@ } assert(matched_ph); -matched_ph->setpgid((pgid == 0) ? matched_ph->pid() : pgid); +matched_ph->pgid((pgid == 0) ? matched_ph->pid() : pgid); return 0; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/20008 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I04c56bd9d9feb1cf68ff50a1152083ea57ea7c62 Gerrit-Change-Number: 20008 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: rename Process::setpgid member
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/20008 ) Change subject: sim-se: rename Process::setpgid member .. sim-se: rename Process::setpgid member The getter methods to access these types of members do not have a 'get' string in the method names. To make the interface a bit more consistent, remove the 'set' part of the member name. Change-Id: I04c56bd9d9feb1cf68ff50a1152083ea57ea7c62 --- M src/sim/process.hh M src/sim/syscall_emul.cc 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sim/process.hh b/src/sim/process.hh index 23ed6d6..ae23de4 100644 --- a/src/sim/process.hh +++ b/src/sim/process.hh @@ -87,8 +87,8 @@ inline uint64_t pid() { return _pid; } inline uint64_t ppid() { return _ppid; } inline uint64_t pgid() { return _pgid; } +inline void pgid(uint64_t pgid) { _pgid = pgid; } inline uint64_t tgid() { return _tgid; } -inline void setpgid(uint64_t pgid) { _pgid = pgid; } const char *progName() const { return executable.c_str(); } diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 088dcbc..f2f4f27 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -1001,7 +1001,7 @@ return -EINVAL; if (pid == 0) { -process->setpgid(process->pid()); +process->pgid(process->pid()); return 0; } @@ -1020,7 +1020,7 @@ } assert(matched_ph); -matched_ph->setpgid((pgid == 0) ? matched_ph->pid() : pgid); +matched_ph->pgid((pgid == 0) ? matched_ph->pid() : pgid); return 0; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/20008 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I04c56bd9d9feb1cf68ff50a1152083ea57ea7c62 Gerrit-Change-Number: 20008 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: minor refactor for ProcessParams::create
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/19949 ) Change subject: sim-se: minor refactor for ProcessParams::create .. sim-se: minor refactor for ProcessParams::create Remove the nullptr initialization and change the message for object file failure. Change-Id: I14b80b47b65893c55810e7f715c1b8fc643c5125 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19949 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/sim/process.cc 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/process.cc b/src/sim/process.cc index 735933d..224152a 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -529,8 +529,6 @@ Process * ProcessParams::create() { -Process *process = nullptr; - // If not specified, set the executable parameter equal to the // simulated system's zeroth command line parameter if (executable == "") { @@ -538,9 +536,9 @@ } ObjectFile *obj_file = createObjectFile(executable); -fatal_if(!obj_file, "Can't load object file %s", executable); +fatal_if(!obj_file, "Cannot load object file %s.", executable); -process = ObjectFile::tryLoaders(this, obj_file); +Process *process = ObjectFile::tryLoaders(this, obj_file); fatal_if(!process, "Unknown error creating process object."); return process; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19949 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I14b80b47b65893c55810e7f715c1b8fc643c5125 Gerrit-Change-Number: 19949 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove unused parameter
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/19948 ) Change subject: sim-se: remove unused parameter .. sim-se: remove unused parameter The init function which processes invoke on their page tables has a thread context pointer parameter. The parameter is not used by the code so remove it. Change-Id: Ic4766fbc105d81c1c9ee4b5c0f428497dff2ab30 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19948 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/mem/multi_level_page_table.hh M src/mem/page_table.hh M src/sim/process.cc 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/mem/multi_level_page_table.hh b/src/mem/multi_level_page_table.hh index f517eaf..df0d785 100644 --- a/src/mem/multi_level_page_table.hh +++ b/src/mem/multi_level_page_table.hh @@ -202,7 +202,7 @@ ~MultiLevelPageTable() {} void -initState(ThreadContext* tc) override +initState() override { if (shared) return; diff --git a/src/mem/page_table.hh b/src/mem/page_table.hh index 03e18c2..9d2e3e3 100644 --- a/src/mem/page_table.hh +++ b/src/mem/page_table.hh @@ -99,7 +99,7 @@ // flag which marks the page table as shared among software threads bool shared; -virtual void initState(ThreadContext* tc) {}; +virtual void initState() {}; // for DPRINTF compatibility const std::string name() const { return _name; } diff --git a/src/sim/process.cc b/src/sim/process.cc index 3a39dbe..735933d 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -282,7 +282,7 @@ // mark this context as active so it will start ticking. tc->activate(); -pTable->initState(tc); +pTable->initState(); } DrainState -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19948 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic4766fbc105d81c1c9ee4b5c0f428497dff2ab30 Gerrit-Change-Number: 19948 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: minor refactor for ProcessParams::create
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/19949 ) Change subject: sim-se: minor refactor for ProcessParams::create .. sim-se: minor refactor for ProcessParams::create Remove the nullptr initialization and change the message for object file failure. Change-Id: I14b80b47b65893c55810e7f715c1b8fc643c5125 --- M src/sim/process.cc 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/sim/process.cc b/src/sim/process.cc index 735933d..224152a 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -529,8 +529,6 @@ Process * ProcessParams::create() { -Process *process = nullptr; - // If not specified, set the executable parameter equal to the // simulated system's zeroth command line parameter if (executable == "") { @@ -538,9 +536,9 @@ } ObjectFile *obj_file = createObjectFile(executable); -fatal_if(!obj_file, "Can't load object file %s", executable); +fatal_if(!obj_file, "Cannot load object file %s.", executable); -process = ObjectFile::tryLoaders(this, obj_file); +Process *process = ObjectFile::tryLoaders(this, obj_file); fatal_if(!process, "Unknown error creating process object."); return process; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19949 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I14b80b47b65893c55810e7f715c1b8fc643c5125 Gerrit-Change-Number: 19949 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove unused parameter
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/19948 ) Change subject: sim-se: remove unused parameter .. sim-se: remove unused parameter The init function which processes invoke on their page tables has a thread context pointer parameter. The parameter is not used by the code so remove it. Change-Id: Ic4766fbc105d81c1c9ee4b5c0f428497dff2ab30 --- M src/mem/multi_level_page_table.hh M src/mem/page_table.hh M src/sim/process.cc 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mem/multi_level_page_table.hh b/src/mem/multi_level_page_table.hh index f517eaf..df0d785 100644 --- a/src/mem/multi_level_page_table.hh +++ b/src/mem/multi_level_page_table.hh @@ -202,7 +202,7 @@ ~MultiLevelPageTable() {} void -initState(ThreadContext* tc) override +initState() override { if (shared) return; diff --git a/src/mem/page_table.hh b/src/mem/page_table.hh index 03e18c2..9d2e3e3 100644 --- a/src/mem/page_table.hh +++ b/src/mem/page_table.hh @@ -99,7 +99,7 @@ // flag which marks the page table as shared among software threads bool shared; -virtual void initState(ThreadContext* tc) {}; +virtual void initState() {}; // for DPRINTF compatibility const std::string name() const { return _name; } diff --git a/src/sim/process.cc b/src/sim/process.cc index 3a39dbe..735933d 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -282,7 +282,7 @@ // mark this context as active so it will start ticking. tc->activate(); -pTable->initState(tc); +pTable->initState(); } DrainState -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19948 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic4766fbc105d81c1c9ee4b5c0f428497dff2ab30 Gerrit-Change-Number: 19948 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se, tests: add a new sim-se test
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/17112 ) Change subject: sim-se, tests: add a new sim-se test .. sim-se, tests: add a new sim-se test This changeset adds a test to check the redirection features added in faux-filesystem changeset. The test contains a "chdir" system call to "/proc" which should be redirected to "$(gem5-dir)/m5out/fs/proc" (as specified by the config files). After "chdir", the test subsequently outputs the "/proc/cpuinfo" file which should output a configuration of a fake cpu with values set by a Python configuration file. Note, the test will call "clone" once. To avoid a runtime error, make sure that you run this test with "-n2" supplied to the "config/example/se.py" script. Change-Id: I505b046b7a4feddfa93a6ef0f0773ac43078cc94 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17112 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- A tests/test-progs/chdir-print/Makefile A tests/test-progs/chdir-print/README.txt A tests/test-progs/chdir-print/chdir-print.c 3 files changed, 167 insertions(+), 0 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/tests/test-progs/chdir-print/Makefile b/tests/test-progs/chdir-print/Makefile new file mode 100644 index 000..6a357d5 --- /dev/null +++ b/tests/test-progs/chdir-print/Makefile @@ -0,0 +1,20 @@ + +CPP := g++ + +TEST_OBJS := chdir-print.o +TEST_PROGS := $(TEST_OBJS:.o=) + +# Rules == + +.PHONY: default clean + +default: $(TEST_PROGS) + +clean: + $(RM) $(TEST_OBJS) $(TEST_PROGS) + +$(TEST_PROGS): $(TEST_OBJS) + $(CPP) -static -o $@ $@.o + +%.o: %.c Makefile + $(CPP) -c -o $@ $*.c -msse3 diff --git a/tests/test-progs/chdir-print/README.txt b/tests/test-progs/chdir-print/README.txt new file mode 100644 index 000..b1e9213 --- /dev/null +++ b/tests/test-progs/chdir-print/README.txt @@ -0,0 +1,67 @@ +# example test compile and run parameters +# Note: the absolute path to the chdir-print binary should be specified +# in the run command even if running from the same folder. This is needed +# because chdir is executed before triggering a clone for the file read, +# and the cloned process won't be able to find the executable if a relative +# path is provided. + +# compile examples +scons --default=X86 ./build/X86/gem5.opt PROTOCOL=MOESI_hammer +scons --default=X86 ./build/X86/gem5.opt PROTOCOL=MESI_Three_Level + +# run parameters +/build/X86/gem5.opt /configs/example/se.py -c /tests/test-progs/chdir-print/chdir-print -n2 --ruby + + +# example successful output for MESI_Three_Level: + +<...> + + REAL SIMULATION +info: Entering event queue @ 0. Starting simulation... +warn: Replacement policy updates recently became the responsibility of SLICC state machines. Make sure to setMRU() near callbacks in .sm files! +cwd: /proj/research_simu/users/jalsop/gem5-mem_dif_debug/tests/test-progs/chdir-print/ +cwd: /proc + +<...> + +processor : 0 +vendor_id : Generic +cpu family : 0 +model : 0 +model name : Generic +stepping: 0 +cpu MHz : 2000 +cache size: : 2048K +physical id : 0 +siblings: 2 +core id : 0 +cpu cores : 2 +fpu : yes +fpu exception : yes +cpuid level : 1 +wp : yes +flags : fpu +cache alignment : 64 + +processor : 1 +vendor_id : Generic +cpu family : 0 +model : 0 +model name : Generic +stepping: 0 +cpu MHz : 2000 +cache size: : 2048K +physical id : 0 +siblings: 2 +core id : 1 +cpu cores : 2 +fpu : yes +fpu exception : yes +cpuid level : 1 +wp : yes +flags : fpu +cache alignment : 64 + +SUCCESS +Exiting @ tick 2694923000 because exiting with last active thread context diff --git a/tests/test-progs/chdir-print/chdir-print.c b/tests/test-progs/chdir-print/chdir-print.c new file mode 100644 index 000..9fe42cd --- /dev/null +++ b/tests/test-progs/chdir-print/chdir-print.c @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2011-2015 Advanced Micro Devices, Inc. + * All rights reserved. + * + * For use for simulation and test purposes only + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright notice, + * this list of conditi
[gem5-dev] Change in gem5/gem5[master]: sim-se: add new getpgrp system call
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/17111 ) Change subject: sim-se: add new getpgrp system call .. sim-se: add new getpgrp system call This changeset adds new (relatively simple) system call support. The getpgrp call returns a thread context's pgid. Change-Id: I361bdbfb9c01b761ddd5a4923d23f86971f8d614 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17111 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Ayaz Akram --- M src/arch/x86/linux/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 3 files changed, 11 insertions(+), 1 deletion(-) Approvals: Ayaz Akram: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index 9ffde7f..8f669bf 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -373,7 +373,7 @@ /* 108 */ SyscallDesc("getegid", getegidFunc), /* 109 */ SyscallDesc("setpgid", setpgidFunc), /* 110 */ SyscallDesc("getppid", getppidFunc), -/* 111 */ SyscallDesc("getpgrp", unimplementedFunc), +/* 111 */ SyscallDesc("getpgrp", getpgrpFunc), /* 112 */ SyscallDesc("setsid", unimplementedFunc), /* 113 */ SyscallDesc("setreuid", unimplementedFunc), /* 114 */ SyscallDesc("setregid", unimplementedFunc), diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 28e3e3d..088dcbc 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -983,6 +983,13 @@ } SyscallReturn +getpgrpFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +{ +auto process = tc->getProcessPtr(); +return process->pgid(); +} + +SyscallReturn setpgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 875f565..130791d 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -226,6 +226,9 @@ /// Target chown() handler. SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc); +/// Target getpgrpFunc() handler. +SyscallReturn getpgrpFunc(SyscallDesc *desc, int num, ThreadContext *tc); + /// Target setpgid() handler. SyscallReturn setpgidFunc(SyscallDesc *desc, int num, ThreadContext *tc); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17111 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I361bdbfb9c01b761ddd5a4923d23f86971f8d614 Gerrit-Change-Number: 17111 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Ayaz Akram Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: adding pipe2 syscall
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/12310 ) Change subject: sim-se: adding pipe2 syscall .. sim-se: adding pipe2 syscall pipe2 builds on top of the pipe syscall implementation by adding some extra flags for the files (to avoid have to make separate calls to fcntl). Change-Id: I88cf6f1387b9d14e60b33a32db412da9ed93a3e6 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12310 Reviewed-by: Brandon Potter Maintainer: Brandon Potter Tested-by: kokoro --- M src/arch/x86/linux/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 3 files changed, 63 insertions(+), 6 deletions(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index 8a58ee1..9ffde7f 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -483,7 +483,7 @@ /* 218 */ SyscallDesc("set_tid_address", setTidAddressFunc), /* 219 */ SyscallDesc("restart_syscall", unimplementedFunc), /* 220 */ SyscallDesc("semtimedop", unimplementedFunc), -/* 221 */ SyscallDesc("fadvise64", unimplementedFunc), +/* 221 */ SyscallDesc("fadvise64", ignoreFunc), /* 222 */ SyscallDesc("timer_create", unimplementedFunc), /* 223 */ SyscallDesc("timer_settime", unimplementedFunc), /* 224 */ SyscallDesc("timer_gettime", unimplementedFunc), @@ -555,7 +555,7 @@ /* 290 */ SyscallDesc("eventfd2", eventfdFunc), /* 291 */ SyscallDesc("epoll_create1", unimplementedFunc), /* 292 */ SyscallDesc("dup3", unimplementedFunc), -/* 293 */ SyscallDesc("pipe2", unimplementedFunc), +/* 293 */ SyscallDesc("pipe2", pipe2Func), /* 294 */ SyscallDesc("inotify_init1", unimplementedFunc), /* 295 */ SyscallDesc("preadv", unimplementedFunc), /* 296 */ SyscallDesc("pwritev", unimplementedFunc), diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 142292d..28e3e3d 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -866,13 +866,18 @@ } SyscallReturn -pipeImpl(SyscallDesc *desc, int callnum, ThreadContext *tc, bool pseudoPipe) +pipeImpl(SyscallDesc *desc, int callnum, ThreadContext *tc, bool pseudo_pipe, + bool is_pipe2) { Addr tgt_addr = 0; +int flags = 0; auto p = tc->getProcessPtr(); -if (!pseudoPipe) { +if (!pseudo_pipe) { int index = 0; tgt_addr = p->getSyscallArg(tc, index); +if (is_pipe2) { +flags = p->getSyscallArg(tc, index); +} } int sim_fds[2], tgt_fds[2]; @@ -884,10 +889,12 @@ auto rend = PipeFDEntry::EndType::read; auto rpfd = std::make_shared(sim_fds[0], O_WRONLY, rend); tgt_fds[0] = p->fds->allocFD(rpfd); +int sim_fd_rpfd = rpfd->getSimFD(); auto wend = PipeFDEntry::EndType::write; auto wpfd = std::make_shared(sim_fds[1], O_RDONLY, wend); tgt_fds[1] = p->fds->allocFD(wpfd); +int sim_fd_wpfd = wpfd->getSimFD(); /** * Now patch the read object to record the target file descriptor chosen @@ -899,7 +906,7 @@ * Alpha Linux convention for pipe() is that fd[0] is returned as * the return value of the function, and fd[1] is returned in r20. */ -if (pseudoPipe) { +if (pseudo_pipe) { tc->setIntReg(SyscallPseudoReturnReg, tgt_fds[1]); return tgt_fds[0]; } @@ -913,6 +920,45 @@ buf_ptr[0] = tgt_fds[0]; buf_ptr[1] = tgt_fds[1]; tgt_handle.copyOut(tc->getVirtProxy()); + +// pipe2 has additional behavior if flags != 0 +if (is_pipe2 && flags) { +// pipe2 only uses O_NONBLOCK, O_CLOEXEC, and (O_NONBLOCK | O_CLOEXEC) +// if flags set to anything else, return EINVAL +if ((flags != O_CLOEXEC) && (flags != O_NONBLOCK) && +(flags != (O_CLOEXEC | O_NONBLOCK))) { +return -EINVAL; +} + +/* + If O_NONBLOCK is passed in as a flag to pipe2, set O_NONBLOCK file + status flag for two new open file descriptors. +*/ +if (flags & O_NONBLOCK) { +/* + O_NONBLOCK is set when the programmer wants to avoid a separate + call(s) to fcntl in their code, so mirror the fcntl + implementation for handling file descriptors -- rely on host to + maintain file status flags. +*/ +if (fcntl(sim_fd_rpfd, F_SETFL, O_NONBLOCK)) { +return -errno; +} +if (fcntl(sim_fd_wpfd, F_SETFL, O_NONBLOCK)) { +return -errno; +
[gem5-dev] Change in gem5/gem5[master]: sim-se: adding pipe2 syscall
Hello Matt Sinclair, Alexandru Duțu, John Alsop, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12310 to look at the new patch set (#23). Change subject: sim-se: adding pipe2 syscall .. sim-se: adding pipe2 syscall pipe2 builds on top of the pipe syscall implementation by adding some extra flags for the files (to avoid have to make separate calls to fcntl). Change-Id: I88cf6f1387b9d14e60b33a32db412da9ed93a3e6 --- M src/arch/x86/linux/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 3 files changed, 63 insertions(+), 6 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12310 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I88cf6f1387b9d14e60b33a32db412da9ed93a3e6 Gerrit-Change-Number: 12310 Gerrit-PatchSet: 23 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: John Alsop Gerrit-Reviewer: Matt Sinclair Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: small refactor on pipe syscall
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/12308 ) Change subject: sim-se: small refactor on pipe syscall .. sim-se: small refactor on pipe syscall Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12308 Reviewed-by: Brandon Potter Maintainer: Brandon Potter Tested-by: kokoro --- M src/sim/syscall_emul.cc 1 file changed, 7 insertions(+), 4 deletions(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index eaf90ec..142292d 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -868,8 +868,14 @@ SyscallReturn pipeImpl(SyscallDesc *desc, int callnum, ThreadContext *tc, bool pseudoPipe) { -int sim_fds[2], tgt_fds[2]; +Addr tgt_addr = 0; auto p = tc->getProcessPtr(); +if (!pseudoPipe) { +int index = 0; +tgt_addr = p->getSyscallArg(tc, index); +} + +int sim_fds[2], tgt_fds[2]; int pipe_retval = pipe(sim_fds); if (pipe_retval == -1) @@ -898,9 +904,6 @@ return tgt_fds[0]; } -int index = 0; -Addr tgt_addr = p->getSyscallArg(tc, index); - /** * Copy the target file descriptors into buffer space and then copy * the buffer space back into the target address space. -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12308 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 Gerrit-Change-Number: 12308 Gerrit-PatchSet: 23 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: John Alsop Gerrit-Reviewer: Matt Sinclair Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: small refactor on pipe syscall
Hello kokoro, Matt Sinclair, Alexandru Duțu, John Alsop, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12308 to look at the new patch set (#21). Change subject: sim-se: small refactor on pipe syscall .. sim-se: small refactor on pipe syscall Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 --- M src/sim/syscall_emul.cc 1 file changed, 7 insertions(+), 4 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12308 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 Gerrit-Change-Number: 12308 Gerrit-PatchSet: 21 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: John Alsop Gerrit-Reviewer: Matt Sinclair Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: small performance optimization
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/17108 ) Change subject: sim-se: small performance optimization .. sim-se: small performance optimization A local variable was being set inside a loop when it should have been set outside the loop. This changeset moves the variable to the appropriate place. Change-Id: If7655b501bd819c39d35dea4c316b4b9ed3173a2 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17108 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/sim/process.cc 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/process.cc b/src/sim/process.cc index f974fa5..3a39dbe 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -199,8 +199,8 @@ * host file descriptors are also dup'd so that the flags for the * host file descriptor is independent of the other process. */ +std::shared_ptr nfds = np->fds; for (int tgt_fd = 0; tgt_fd < fds->getSize(); tgt_fd++) { -std::shared_ptr nfds = np->fds; std::shared_ptr this_fde = (*fds)[tgt_fd]; if (!this_fde) { nfds->setFDEntry(tgt_fd, nullptr); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17108 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If7655b501bd819c39d35dea4c316b4b9ed3173a2 Gerrit-Change-Number: 17108 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: fstat64 bugfix
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/17110 ) Change subject: sim-se: fstat64 bugfix .. sim-se: fstat64 bugfix The fstat64 system call does an upcast on entries in the file descriptor array to check if the file descriptor has a backing host-filesystem file opened. It does so because it needs to pass the host fd into the fstat call (since we rely on the host filesystem to service filesystem system calls). The upcast was overly specific. This changeset alters the system call to use the most general base class of the file descriptor entries that can satisfy the code. Change-Id: I10daf820257cea4d678ee6917e01e9cc9cd1cf5e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17110 Tested-by: kokoro Maintainer: Brandon Potter Reviewed-by: Jason Lowe-Power --- M src/sim/syscall_emul.hh 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 8a73cb2..e2f2fc2 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1338,7 +1338,7 @@ int tgt_fd = p->getSyscallArg(tc, index); Addr bufPtr = p->getSyscallArg(tc, index); -auto ffdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); +auto ffdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); if (!ffdp) return -EBADF; int sim_fd = ffdp->getSimFD(); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17110 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I10daf820257cea4d678ee6917e01e9cc9cd1cf5e Gerrit-Change-Number: 17110 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add new option to getrlimit syscall
Brandon Potter has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/17109 ) Change subject: sim-se: add new option to getrlimit syscall .. sim-se: add new option to getrlimit syscall The NPROC option was not serviced by the getrlimit syscall. This changeset adds in the necessary code to service the option. Change-Id: I679d3949c3bbb0628188f4e33034028d7726fdcb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17109 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Matt Sinclair --- M src/sim/syscall_emul.hh 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Matt Sinclair: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index d8270fb..8a73cb2 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1970,6 +1970,12 @@ rlp->rlim_max = TheISA::htog(rlp->rlim_max); break; + case OS::TGT_RLIMIT_NPROC: +rlp->rlim_cur = rlp->rlim_max = tc->getSystemPtr()->numContexts(); +rlp->rlim_cur = TheISA::htog(rlp->rlim_cur); +rlp->rlim_max = TheISA::htog(rlp->rlim_max); +break; + default: warn("getrlimit: unimplemented resource %d", resource); return -EINVAL; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17109 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I679d3949c3bbb0628188f4e33034028d7726fdcb Gerrit-Change-Number: 17109 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: John Alsop Gerrit-Reviewer: Matt Sinclair Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add const qualifier to copy funcs
Hello kokoro, Alexandru Duțu, John Alsop, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12302 to look at the new patch set (#23). Change subject: sim-se: add const qualifier to copy funcs .. sim-se: add const qualifier to copy funcs The reference parameters do not need modification access so tack on the const qualifier. Change-Id: I281ba42438fd672b5bfbb1b9f7fb16aa7273d14a --- M src/sim/syscall_emul.hh 1 file changed, 3 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12302 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I281ba42438fd672b5bfbb1b9f7fb16aa7273d14a Gerrit-Change-Number: 12302 Gerrit-PatchSet: 23 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: x86: fix movsd bug on %xmm register
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/19068 ) Change subject: x86: fix movsd bug on %xmm register .. x86: fix movsd bug on %xmm register The movsd instruction should zero out half the register, but does not do it. This changeset adds the necessary microop to the instruction to cause correct behavior. Change-Id: I5278da3634c78a97ed0586f687a36c6dc5a34c60 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19068 Reviewed-by: Anthony Gutierrez Reviewed-by: Michael LeBeane Reviewed-by: Gabe Black Reviewed-by: Jason Lowe-Power Maintainer: Gabe Black Tested-by: kokoro --- M src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Michael LeBeane: Looks good to me, approved Anthony Gutierrez: Looks good to me, approved Gabe Black: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py b/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py index 81dfc7f..13e900d 100644 --- a/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py +++ b/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py @@ -256,13 +256,13 @@ }; def macroop MOVSD_XMM_M { -# Zero xmmh +lfpimm xmmh, 0 ldfp xmml, seg, sib, disp, dataSize=8 }; def macroop MOVSD_XMM_P { rdip t7 -# Zero xmmh +lfpimm xmmh, 0 ldfp xmml, seg, riprel, disp, dataSize=8 }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19068 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I5278da3634c78a97ed0586f687a36c6dc5a34c60 Gerrit-Change-Number: 19068 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Gabe Black Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Michael LeBeane Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: x86: fix movsd bug on %xmm register
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/19068 Change subject: x86: fix movsd bug on %xmm register .. x86: fix movsd bug on %xmm register The movsd instruction should zero out half the register, but does not do it. This changeset adds the necessary microop to the instruction to cause correct behavior. Change-Id: I5278da3634c78a97ed0586f687a36c6dc5a34c60 --- M src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py b/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py index 81dfc7f..13e900d 100644 --- a/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py +++ b/src/arch/x86/isa/insts/simd128/floating_point/data_transfer/move.py @@ -256,13 +256,13 @@ }; def macroop MOVSD_XMM_M { -# Zero xmmh +lfpimm xmmh, 0 ldfp xmml, seg, sib, disp, dataSize=8 }; def macroop MOVSD_XMM_P { rdip t7 -# Zero xmmh +lfpimm xmmh, 0 ldfp xmml, seg, riprel, disp, dataSize=8 }; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19068 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I5278da3634c78a97ed0586f687a36c6dc5a34c60 Gerrit-Change-Number: 19068 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: const for loader's loadSection param
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12301 ) Change subject: sim-se: const for loader's loadSection param .. sim-se: const for loader's loadSection param The port proxy can be declared as a reference to a const proxy rather than just a reference to a proxy. Change-Id: I4640b0c5f33e2334c1e7630131f78607ced40a34 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12301 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Jason Lowe-Power Reviewed-by: Andreas Sandberg --- M src/base/loader/elf_object.cc M src/base/loader/elf_object.hh M src/base/loader/object_file.cc M src/base/loader/object_file.hh 4 files changed, 9 insertions(+), 7 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Andreas Sandberg: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/base/loader/elf_object.cc b/src/base/loader/elf_object.cc index 761fd79..654cb33 100644 --- a/src/base/loader/elf_object.cc +++ b/src/base/loader/elf_object.cc @@ -498,7 +498,8 @@ } bool -ElfObject::loadSections(PortProxy& mem_proxy, Addr addr_mask, Addr offset) +ElfObject::loadSections(const PortProxy& mem_proxy, Addr addr_mask, +Addr offset) { if (!ObjectFile::loadSections(mem_proxy, addr_mask, offset)) return false; diff --git a/src/base/loader/elf_object.hh b/src/base/loader/elf_object.hh index d74ee89..9585684 100644 --- a/src/base/loader/elf_object.hh +++ b/src/base/loader/elf_object.hh @@ -94,7 +94,7 @@ public: virtual ~ElfObject() {} -bool loadSections(PortProxy& mem_proxy, Addr addr_mask = maxAddr, +bool loadSections(const PortProxy& mem_proxy, Addr addr_mask = maxAddr, Addr offset = 0) override; virtual bool loadAllSymbols(SymbolTable *symtab, Addr base = 0, diff --git a/src/base/loader/object_file.cc b/src/base/loader/object_file.cc index 86278e4..ede8922 100644 --- a/src/base/loader/object_file.cc +++ b/src/base/loader/object_file.cc @@ -73,8 +73,8 @@ bool -ObjectFile::loadSection(Section *sec, PortProxy& mem_proxy, Addr addr_mask, -Addr offset) +ObjectFile::loadSection(Section *sec, const PortProxy& mem_proxy, +Addr addr_mask, Addr offset) { if (sec->size != 0) { Addr addr = (sec->baseAddr & addr_mask) + offset; @@ -91,7 +91,8 @@ bool -ObjectFile::loadSections(PortProxy& mem_proxy, Addr addr_mask, Addr offset) +ObjectFile::loadSections(const PortProxy& mem_proxy, Addr addr_mask, + Addr offset) { return (loadSection(, mem_proxy, addr_mask, offset) && loadSection(, mem_proxy, addr_mask, offset) diff --git a/src/base/loader/object_file.hh b/src/base/loader/object_file.hh index 5da7e3c..bd9d626 100644 --- a/src/base/loader/object_file.hh +++ b/src/base/loader/object_file.hh @@ -88,7 +88,7 @@ static const Addr maxAddr = std::numeric_limits::max(); -virtual bool loadSections(PortProxy& mem_proxy, +virtual bool loadSections(const PortProxy& mem_proxy, Addr mask = maxAddr, Addr offset = 0); virtual bool loadAllSymbols(SymbolTable *symtab, Addr base = 0, @@ -129,7 +129,7 @@ Section data; Section bss; -bool loadSection(Section *sec, PortProxy& mem_proxy, Addr mask, +bool loadSection(Section *sec, const PortProxy& mem_proxy, Addr mask, Addr offset = 0); void setGlobalPointer(Addr global_ptr) { globalPtr = global_ptr; } -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12301 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4640b0c5f33e2334c1e7630131f78607ced40a34 Gerrit-Change-Number: 12301 Gerrit-PatchSet: 22 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove comment for code that moved
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12300 ) Change subject: sim-se: remove comment for code that moved .. sim-se: remove comment for code that moved The page table code must have moved from this class, because the comment no longer accurately reflects upon any of the surrounding code. Change-Id: If08a4298c1237a541d9875ddeaf3d3ecfd98e9db Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12300 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/arch/x86/process.hh 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/process.hh b/src/arch/x86/process.hh index 9c2ec65..544d5f6 100644 --- a/src/arch/x86/process.hh +++ b/src/arch/x86/process.hh @@ -60,13 +60,6 @@ class X86Process : public Process { protected: -/** - * Declaration of architectural page table for x86. - * - * These page tables are stored in system memory and respect x86 - * specification. - */ - Addr _gdtStart; Addr _gdtSize; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12300 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If08a4298c1237a541d9875ddeaf3d3ecfd98e9db Gerrit-Change-Number: 12300 Gerrit-PatchSet: 22 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: change syscall function signature
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12299 ) Change subject: sim-se: change syscall function signature .. sim-se: change syscall function signature The system calls had four parameters. One of the parameters is ThreadContext and another is Process. The ThreadContext holds the value of the current process so the Process parameter is redundant since the system call functions already have indirect access. With the old API, it is possible to call into the functions with the wrong supplied Process which could end up being a confusing error. This patch removes the redundancy by forcing access through the ThreadContext field within each system call. Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12299 Reviewed-by: Brandon Potter Maintainer: Brandon Potter Tested-by: kokoro --- M src/arch/alpha/linux/process.cc M src/arch/arm/freebsd/process.cc M src/arch/arm/linux/process.cc M src/arch/mips/linux/process.cc M src/arch/power/linux/process.cc M src/arch/riscv/linux/process.cc M src/arch/sparc/linux/syscalls.cc M src/arch/sparc/solaris/process.cc M src/arch/x86/linux/process.cc M src/gpu-compute/cl_driver.cc M src/gpu-compute/cl_driver.hh M src/sim/emul_driver.hh M src/sim/process.cc M src/sim/syscall_desc.cc M src/sim/syscall_desc.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 17 files changed, 372 insertions(+), 383 deletions(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/alpha/linux/process.cc b/src/arch/alpha/linux/process.cc index cbf45f1..de89410 100644 --- a/src/arch/alpha/linux/process.cc +++ b/src/arch/alpha/linux/process.cc @@ -77,10 +77,10 @@ /// Target uname() handler. static SyscallReturn -unameFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +unameFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; +auto process = tc->getProcessPtr(); TypedBufferArg name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -97,10 +97,10 @@ /// borrowed from Tru64, the subcases that get used appear to be /// different in practice from those used by Tru64 processes. static SyscallReturn -osf_getsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +osf_getsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; +auto process = tc->getProcessPtr(); unsigned op = process->getSyscallArg(tc, index); Addr bufPtr = process->getSyscallArg(tc, index); // unsigned nbytes = process->getSyscallArg(tc, 2); @@ -126,10 +126,10 @@ /// Target osf_setsysinfo() handler. static SyscallReturn -osf_setsysinfoFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +osf_setsysinfoFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; +auto process = tc->getProcessPtr(); unsigned op = process->getSyscallArg(tc, index); Addr bufPtr = process->getSyscallArg(tc, index); // unsigned nbytes = process->getSyscallArg(tc, 2); diff --git a/src/arch/arm/freebsd/process.cc b/src/arch/arm/freebsd/process.cc index ba79eb1..41549ea 100644 --- a/src/arch/arm/freebsd/process.cc +++ b/src/arch/arm/freebsd/process.cc @@ -85,20 +85,18 @@ } // anonymous namespace static SyscallReturn -issetugidFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +issetugidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { - return 0; } static SyscallReturn -sysctlFunc(SyscallDesc *desc, int callnum, Process *process, - ThreadContext *tc) +sysctlFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; uint64_t ret; +auto process = tc->getProcessPtr(); Addr namep = process->getSyscallArg(tc, index); size_t namelen = process->getSyscallArg(tc, index); Addr oldp = process->getSyscallArg(tc, index); diff --git a/src/arch/arm/linux/process.cc b/src/arch/arm/linux/process.cc index cd37c77..1bb7548 100644 --- a/src/arch/arm/linux/process.cc +++ b/src/arch/arm/linux/process.cc @@ -105,10 +105,10 @@ /// Target uname() handler. static SyscallReturn -unameFunc32(SyscallDesc *desc, int callnum, Process *process, -ThreadContext *tc) +unameFunc32(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; +auto process = tc->getProcessPtr(); TypedBufferArg name(process->getSyscallArg(tc, index)); strcpy(name->sysname, "Linux"); @@ -123,10 +123,10 @@ /// Target uname() handler. static SyscallReturn -unameFunc64(SyscallDesc *desc, int callnum, Process *pr
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove /sys from special paths
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12127 ) Change subject: sim-se: remove /sys from special paths .. sim-se: remove /sys from special paths Currently, the open system call implementation in SE mode treats /sys/ as a special path that is opened using a special open handler. The ROC runtime, however, reads several files in /sys/ that are supported via path redirection. Here we remove /sys/ from the special files so that the necessary files may be read via path redirection. Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12127 Reviewed-by: Anthony Gutierrez Reviewed-by: Jason Lowe-Power Maintainer: Anthony Gutierrez Tested-by: kokoro --- M src/kern/linux/linux.cc M src/sim/syscall_emul.hh 2 files changed, 1 insertion(+), 12 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Anthony Gutierrez: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/kern/linux/linux.cc b/src/kern/linux/linux.cc index b71ab30..e499776 100644 --- a/src/kern/linux/linux.cc +++ b/src/kern/linux/linux.cc @@ -55,9 +55,6 @@ } else if (path.compare(0, 11, "/etc/passwd") == 0) { data = Linux::etcPasswd(process, tc); matched = true; -} else if (path.compare(0, 30, "/sys/devices/system/cpu/online") == 0) { -data = Linux::cpuOnline(process, tc); -matched = true; } if (matched) { @@ -90,10 +87,3 @@ return csprintf("gem5-user:x:1000:1000:gem5-user,,,:%s:/bin/bash\n", process->tgtCwd); } - -std::string -Linux::cpuOnline(Process *process, ThreadContext *tc) -{ -return csprintf("0-%d\n", -tc->getSystemPtr()->numContexts() - 1); -} diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index caa4d2c..92fb8bf 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -934,8 +934,7 @@ int sim_fd = -1; std::string used_path; std::vector special_paths = -{ "/proc/meminfo/", "/system/", "/sys/", "/platform/", - "/etc/passwd" }; +{ "/proc/meminfo/", "/system/", "/platform/", "/etc/passwd" }; for (auto entry : special_paths) { if (startswith(path, entry)) { sim_fd = OS::openSpecialFile(abs_path, p, tc); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Gerrit-Change-Number: 12127 Gerrit-PatchSet: 27 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-CC: Bradford Beckmann Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove /sys from special paths
Hello kokoro, Alexandru Duțu, Jason Lowe-Power, John Alsop, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 to look at the new patch set (#25). Change subject: sim-se: remove /sys from special paths .. sim-se: remove /sys from special paths Currently, the open system call implementation in SE mode treats /sys/ as a special path that is opened using a special open handler. The ROC runtime, however, reads several files in /sys/ that are supported via path redirection. Here we remove /sys/ from the special files so that the necessary files may be read via path redirection. Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d --- M src/kern/linux/linux.cc M src/sim/syscall_emul.hh 2 files changed, 1 insertion(+), 12 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Gerrit-Change-Number: 12127 Gerrit-PatchSet: 25 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-CC: Bradford Beckmann Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: config, sim-se: bugfix for 54c77aa0
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/18748 ) Change subject: config, sim-se: bugfix for 54c77aa0 .. config, sim-se: bugfix for 54c77aa0 The NULL ISA does not have some members for the options class which are referenced by the FileSystemConfig code. Create default values for the members so that the simulation does not fail during the configuration phase. Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18748 Reviewed-by: Daniel Carvalho Maintainer: Jason Lowe-Power Maintainer: Brandon Potter Tested-by: kokoro --- M configs/common/FileSystemConfig.py 1 file changed, 17 insertions(+), 3 deletions(-) Approvals: Daniel Carvalho: Looks good to me, approved Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index 8a6da52..e37fbd3 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -60,6 +60,20 @@ procdir = joinpath(fsdir, 'proc') mkdir(procdir) +cpu_clock = '0' +if hasattr(options, 'cpu_clock'): +cpu_clock = options.cpu_clock +cpu_clock = toFrequency(cpu_clock)/mega + +l2_size = '0' +if hasattr(options, 'l2_size'): +l2_size = options.l2_size +l2_size = toMemorySize(l2_size)/kibi + +cacheline_size = '0' +if hasattr(options, 'cacheline_size'): +cacheline_size = options.cacheline_size + for i in xrange(options.num_cpus): one_cpu = 'processor : %d\n' % (i) + \ 'vendor_id : Generic\n' + \ @@ -68,9 +82,9 @@ 'model name : Generic\n' + \ 'stepping: 0\n' + \ 'cpu MHz : %0.3d\n' \ -% (toFrequency(options.cpu_clock)/mega) + \ +% cpu_clock + \ 'cache size: : %dK\n' \ -% (toMemorySize(options.l2_size)/kibi)+ \ +% l2_size + \ 'physical id : 0\n' + \ 'siblings: %s\n' \ % options.num_cpus+ \ @@ -84,7 +98,7 @@ 'wp : yes\n' + \ 'flags : fpu\n' + \ 'cache alignment : %d\n' \ -% options.cacheline_size + \ +% cacheline_size + \ '\n' file_append((procdir, 'cpuinfo'), one_cpu) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18748 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703 Gerrit-Change-Number: 18748 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Daniel Carvalho Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove /sys from special paths
Hello kokoro, Alexandru Duțu, John Alsop, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 to look at the new patch set (#24). Change subject: sim-se: remove /sys from special paths .. sim-se: remove /sys from special paths Currently, the open system call implementation in SE mode treats /sys/ as a special path that is opened using a special open handler. The ROC runtime, however, reads several files in /sys/ that are supported via path redirection. Here we remove /sys/ from the special files so that the necessary files may be read via path redirection. Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d --- M configs/learning_gem5/part3/simple_ruby.py M src/kern/linux/linux.cc M src/sim/syscall_emul.hh 3 files changed, 28 insertions(+), 13 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Gerrit-Change-Number: 12127 Gerrit-PatchSet: 24 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: config, sim-se: bugfix for 54c77aa0
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/18748 Change subject: config, sim-se: bugfix for 54c77aa0 .. config, sim-se: bugfix for 54c77aa0 The NULL ISA does not have some members for the options class which are referenced by the FileSystemConfig code. Create default values for the members so that the simulation does not fail during the configuration phase. Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703 --- M configs/common/FileSystemConfig.py 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index 8a6da52..e37fbd3 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -60,6 +60,20 @@ procdir = joinpath(fsdir, 'proc') mkdir(procdir) +cpu_clock = '0' +if hasattr(options, 'cpu_clock'): +cpu_clock = options.cpu_clock +cpu_clock = toFrequency(cpu_clock)/mega + +l2_size = '0' +if hasattr(options, 'l2_size'): +l2_size = options.l2_size +l2_size = toMemorySize(l2_size)/kibi + +cacheline_size = '0' +if hasattr(options, 'cacheline_size'): +cacheline_size = options.cacheline_size + for i in xrange(options.num_cpus): one_cpu = 'processor : %d\n' % (i) + \ 'vendor_id : Generic\n' + \ @@ -68,9 +82,9 @@ 'model name : Generic\n' + \ 'stepping: 0\n' + \ 'cpu MHz : %0.3d\n' \ -% (toFrequency(options.cpu_clock)/mega) + \ +% cpu_clock + \ 'cache size: : %dK\n' \ -% (toMemorySize(options.l2_size)/kibi)+ \ +% l2_size + \ 'physical id : 0\n' + \ 'siblings: %s\n' \ % options.num_cpus+ \ @@ -84,7 +98,7 @@ 'wp : yes\n' + \ 'flags : fpu\n' + \ 'cache alignment : %d\n' \ -% options.cacheline_size + \ +% cacheline_size + \ '\n' file_append((procdir, 'cpuinfo'), one_cpu) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18748 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie65bf0e5550c964eae42d1df4c36c2c5bc4ea703 Gerrit-Change-Number: 18748 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: Fix FileSystemConfig import
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/18709 ) Change subject: configs: Fix FileSystemConfig import .. configs: Fix FileSystemConfig import Add source to FileSystemConfig import Change-Id: I2cd70a332244cbdc58b1b7c06d589b4339f6e19a Signed-off-by: Daniel R. Carvalho Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18709 Tested-by: kokoro Maintainer: Brandon Potter Maintainer: Jason Lowe-Power Reviewed-by: Jason Lowe-Power --- M configs/ruby/MESI_Three_Level.py M configs/ruby/MOESI_AMD_Base.py M configs/ruby/MOESI_hammer.py 3 files changed, 3 insertions(+), 3 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/configs/ruby/MESI_Three_Level.py b/configs/ruby/MESI_Three_Level.py index 6d6bc89..90e9190 100644 --- a/configs/ruby/MESI_Three_Level.py +++ b/configs/ruby/MESI_Three_Level.py @@ -35,7 +35,7 @@ from m5.defines import buildEnv from Ruby import create_topology, create_directories from Ruby import send_evicts -import FileSystemConfig +from common import FileSystemConfig # # Declare caches used by the protocol diff --git a/configs/ruby/MOESI_AMD_Base.py b/configs/ruby/MOESI_AMD_Base.py index d465083..5c4bbe0 100644 --- a/configs/ruby/MOESI_AMD_Base.py +++ b/configs/ruby/MOESI_AMD_Base.py @@ -38,7 +38,7 @@ from m5.util import addToPath from Ruby import create_topology from Ruby import send_evicts -import FileSystemConfig +from common import FileSystemConfig addToPath('../') diff --git a/configs/ruby/MOESI_hammer.py b/configs/ruby/MOESI_hammer.py index ecac17e..0b04980 100644 --- a/configs/ruby/MOESI_hammer.py +++ b/configs/ruby/MOESI_hammer.py @@ -33,7 +33,7 @@ from m5.defines import buildEnv from Ruby import create_topology, create_directories from Ruby import send_evicts -import FileSystemConfig +from common import FileSystemConfig # # Declare caches used by the protocol -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18709 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I2cd70a332244cbdc58b1b7c06d589b4339f6e19a Gerrit-Change-Number: 18709 Gerrit-PatchSet: 3 Gerrit-Owner: Daniel Carvalho Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: correct statfs inclusion on !linux host
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/18668 ) Change subject: sim-se: correct statfs inclusion on !linux host .. sim-se: correct statfs inclusion on !linux host - Added missing header - Fixed typo on __linux__ macro conditional - s/ifdef/if defined/g for consistency Change-Id: I83b69856e5ec8b23b707642c0e14216cf62db31e Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18668 Reviewed-by: Jason Lowe-Power Reviewed-by: Brandon Potter Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 2 files changed, 9 insertions(+), 6 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 98fbe96..ba84250 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -1039,7 +1039,7 @@ SyscallReturn fallocateFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc) { -#if __linux__ +#if defined(__linux__) int index = 0; int tgt_fd = p->getSyscallArg(tc, index); int mode = p->getSyscallArg(tc, index); diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 91db9ae..caa4d2c 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -59,10 +59,13 @@ /// This file defines objects used to emulate syscalls from the target /// application on the host machine. -#ifdef __linux__ +#if defined(__linux__) #include #include +#else +#include + #endif #ifdef __CYGWIN32__ @@ -778,12 +781,12 @@ return status; } case SIOCGIFFLAGS: -#ifdef __linux__ +#if defined(__linux__) case SIOCGIFINDEX: #endif case SIOCGIFNETMASK: case SIOCGIFADDR: -#ifdef __linux__ +#if defined(__linux__) case SIOCGIFHWADDR: #endif case SIOCGIFMTU: { @@ -1515,7 +1518,7 @@ statfsFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) { -#ifdef __linux__ +#if defined(__linux__) std::string path; int index = 0; @@ -2851,7 +2854,7 @@ SyscallReturn eventfdFunc(SyscallDesc *desc, int num, Process *p, ThreadContext *tc) { -#ifdef __linux__ +#if defined(__linux__) int index = 0; unsigned initval = p->getSyscallArg(tc, index); int in_flags = p->getSyscallArg(tc, index); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18668 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I83b69856e5ec8b23b707642c0e14216cf62db31e Gerrit-Change-Number: 18668 Gerrit-PatchSet: 3 Gerrit-Owner: Andrea Mondelli Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: fix a few bugs/warns from GCC 6
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12126 ) Change subject: sim-se: fix a few bugs/warns from GCC 6 .. sim-se: fix a few bugs/warns from GCC 6 Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12126 Tested-by: kokoro Reviewed-by: Brandon Potter Maintainer: Brandon Potter --- M src/sim/syscall_emul.cc 1 file changed, 3 insertions(+), 6 deletions(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index bfec1f5..98fbe96 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -848,12 +848,6 @@ pipeImpl(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc, bool pseudoPipe) { -Addr tgt_addr = 0; -if (!pseudoPipe) { -int index = 0; -tgt_addr = p->getSyscallArg(tc, index); -} - int sim_fds[2], tgt_fds[2]; int pipe_retval = pipe(sim_fds); @@ -883,6 +877,9 @@ return tgt_fds[0]; } +int index = 0; +Addr tgt_addr = p->getSyscallArg(tc, index); + /** * Copy the target file descriptors into buffer space and then copy * the buffer space back into the target address space. -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12126 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 Gerrit-Change-Number: 12126 Gerrit-PatchSet: 24 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: fix a few bugs/warns from GCC 6
Hello Alexandru Duțu, John Alsop, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12126 to look at the new patch set (#22). Change subject: sim-se: fix a few bugs/warns from GCC 6 .. sim-se: fix a few bugs/warns from GCC 6 Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 --- M src/sim/syscall_emul.cc 1 file changed, 3 insertions(+), 6 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12126 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 Gerrit-Change-Number: 12126 Gerrit-PatchSet: 22 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add eventfd system call
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12125 ) Change subject: sim-se: add eventfd system call .. sim-se: add eventfd system call Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12125 Tested-by: kokoro Reviewed-by: Ciro Santilli Maintainer: Brandon Potter --- M src/arch/x86/linux/process.cc M src/sim/fd_entry.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 4 files changed, 64 insertions(+), 33 deletions(-) Approvals: Ciro Santilli: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index 9e8997a..f19dce3 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -510,13 +510,13 @@ /* 281 */ SyscallDesc("epoll_pwait", unimplementedFunc), /* 282 */ SyscallDesc("signalfd", unimplementedFunc), /* 283 */ SyscallDesc("timerfd_create", unimplementedFunc), -/* 284 */ SyscallDesc("eventfd", unimplementedFunc), +/* 284 */ SyscallDesc("eventfd", eventfdFunc), /* 285 */ SyscallDesc("fallocate", fallocateFunc), /* 286 */ SyscallDesc("timerfd_settime", unimplementedFunc), /* 287 */ SyscallDesc("timerfd_gettime", unimplementedFunc), /* 288 */ SyscallDesc("accept4", unimplementedFunc), /* 289 */ SyscallDesc("signalfd4", unimplementedFunc), -/* 290 */ SyscallDesc("eventfd2", unimplementedFunc), +/* 290 */ SyscallDesc("eventfd2", eventfdFunc), /* 291 */ SyscallDesc("epoll_create1", unimplementedFunc), /* 292 */ SyscallDesc("dup3", unimplementedFunc), /* 293 */ SyscallDesc("pipe2", unimplementedFunc), @@ -882,7 +882,7 @@ /* 320 */ SyscallDesc("utimensat", unimplementedFunc), /* 321 */ SyscallDesc("signalfd", unimplementedFunc), /* 322 */ SyscallDesc("timerfd", unimplementedFunc), -/* 323 */ SyscallDesc("eventfd", unimplementedFunc) +/* 323 */ SyscallDesc("eventfd", eventfdFunc) }; I386LinuxProcess::I386LinuxProcess(ProcessParams * params, ObjectFile *objFile) diff --git a/src/sim/fd_entry.hh b/src/sim/fd_entry.hh index 15e174a..94c874a 100644 --- a/src/sim/fd_entry.hh +++ b/src/sim/fd_entry.hh @@ -80,6 +80,16 @@ : FDEntry(close_on_exec), _flags(flags), _simFD(sim_fd) { } +HBFDEntry(HBFDEntry const& reg, bool close_on_exec = false) +: FDEntry(close_on_exec), _flags(reg._flags), _simFD(reg._simFD) +{ } + +std::shared_ptr +clone() const override +{ +return std::make_shared(*this); +} + int getFlags() const { return _flags; } int getSimFD() const { return _simFD; } diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index a9490fa..bfec1f5 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -57,6 +57,12 @@ using namespace std; using namespace TheISA; +void +warnUnsupportedOS(std::string syscall_name) +{ +warn("Cannot invoke %s on host operating system.", syscall_name); +} + SyscallReturn unimplementedFunc(SyscallDesc *desc, int callnum, Process *process, ThreadContext *tc) @@ -1036,9 +1042,7 @@ SyscallReturn fallocateFunc(SyscallDesc *desc, int callnum, Process *p, ThreadContext *tc) { -#if NO_FALLOCATE -warn("Host OS cannot support calls to fallocate. Ignoring syscall"); -#else +#if __linux__ int index = 0; int tgt_fd = p->getSyscallArg(tc, index); int mode = p->getSyscallArg(tc, index); @@ -1053,8 +1057,11 @@ int result = fallocate(sim_fd, mode, offset, len); if (result < 0) return -errno; -#endif return 0; +#else +warnUnsupportedOS("fallocate"); +return -1; +#endif } SyscallReturn diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 7996027..91db9ae 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -53,26 +53,18 @@ #define NO_STAT64 0 #endif -#if (defined(__APPLE__) || defined(__OpenBSD__) || \ - defined(__FreeBSD__) || defined(__NetBSD__)) -#define NO_STATFS 1 -#else -#define NO_STATFS 0 -#endif - -#if (defined(__APPLE__) || defined(__OpenBSD__) || \ - defined(__FreeBSD__) || defined(__NetBSD__)) -#define NO_FALLOCATE 1 -#else -#define NO_FALLOCATE 0 -#endif - /// /// @file syscall_emul.hh /// /// This file defines objects used to emulate syscalls from the target /// application on the host machine. +#ifdef __linux__ +#include +#include + +#endif + #ifdef __CYGWIN32__ #include @@ -84,14 +76,6 @@ #include #include #include - -#if (NO_STATFS == 0) -#include
[gem5-dev] Change in gem5/gem5[master]: sim-se: add eventfd system call
Hello Ciro Santilli, Alexandru Duțu, John Alsop, Andrea Mondelli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12125 to look at the new patch set (#23). Change subject: sim-se: add eventfd system call .. sim-se: add eventfd system call Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c --- M src/arch/x86/linux/process.cc M src/sim/fd_entry.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 4 files changed, 64 insertions(+), 33 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12125 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c Gerrit-Change-Number: 12125 Gerrit-PatchSet: 23 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Andrea Mondelli Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: John Alsop Gerrit-CC: Andreas Sandberg Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add eventfd system call
Hello Alexandru Duțu, John Alsop, Andrea Mondelli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12125 to look at the new patch set (#22). Change subject: sim-se: add eventfd system call .. sim-se: add eventfd system call Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c --- M src/arch/x86/linux/process.cc M src/sim/fd_entry.hh M src/sim/syscall_emul.hh 3 files changed, 53 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12125 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c Gerrit-Change-Number: 12125 Gerrit-PatchSet: 22 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Andrea Mondelli Gerrit-Reviewer: John Alsop Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: use DPRINTF_SYSCALL for ioctl/wait4
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12124 ) Change subject: sim-se: use DPRINTF_SYSCALL for ioctl/wait4 .. sim-se: use DPRINTF_SYSCALL for ioctl/wait4 Change-Id: I4fbaf1a0653f13ae964a2574cc26bbaac2dc0686 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12124 Maintainer: Brandon Potter Tested-by: kokoro Reviewed-by: Jason Lowe-Power --- M src/sim/syscall_emul.hh 1 file changed, 3 insertions(+), 4 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved Brandon Potter: Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 892d9d7..7996027 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -754,7 +754,7 @@ int tgt_fd = p->getSyscallArg(tc, index); unsigned req = p->getSyscallArg(tc, index); -DPRINTF(SyscallVerbose, "ioctl(%d, 0x%x, ...)\n", tgt_fd, req); +DPRINTF_SYSCALL(Verbose, "ioctl(%d, 0x%x, ...)\n", tgt_fd, req); if (OS::isTtyReq(req)) return -ENOTTY; @@ -2741,10 +2741,9 @@ Addr rusagePtr = p->getSyscallArg(tc, index); if (rusagePtr) -DPRINTFR(SyscallVerbose, - "%d: %s: syscall wait4: rusage pointer provided however " +DPRINTF_SYSCALL(Verbose, "wait4: rusage pointer provided %lx, however " "functionality not supported. Ignoring rusage pointer.\n", - curTick(), tc->getCpuPtr()->name()); + rusagePtr); /** * Currently, wait4 is only implemented so that it will wait for children -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12124 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4fbaf1a0653f13ae964a2574cc26bbaac2dc0686 Gerrit-Change-Number: 12124 Gerrit-PatchSet: 23 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: bugfix for 54c77aa055e
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/18448 ) Change subject: sim-se: bugfix for 54c77aa055e .. sim-se: bugfix for 54c77aa055e 54c77aa055e introduced a bug which manifests as cyclical dependency on a member initialization for the Process class. The current working directory (cwd) parameter is passed into Process to initialize both the target and host versions of the cwd. (The target and host versions may differ if the faux filesystem is used.) The host cwd init invoked methods which rely on the host cwd already being initialized. To avoid the bug, the code will now rely on using the targets cwd version, but will issue checks against the redirect paths. Change-Id: I4ab644a3e00737dbf249f5d6faf20a26ceb04248 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18448 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- M src/sim/process.cc 1 file changed, 15 insertions(+), 18 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/process.cc b/src/sim/process.cc index 10c68fe..d400b5d 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -456,19 +456,16 @@ std::string Process::checkPathRedirect(const std::string ) { -// If the input parameter contains a relative path, convert it. Note, -// the return value for this method should always return an absolute -// path on the host filesystem. The return value will be used to -// open and manipulate the path specified by the input parameter. Since -// all filesystem handling in syscall mode is passed through to the host, -// we deal only with host paths. -auto host_fs_abs_path = absolutePath(filename, true); +// If the input parameter contains a relative path, convert it. +// The target version of the current working directory is fine since +// we immediately convert it using redirect paths into a host version. +auto abs_path = absolutePath(filename, false); for (auto path : system->redirectPaths) { // Search through the redirect paths to see if a starting substring of // our path falls into any buckets which need to redirected. -if (startswith(host_fs_abs_path, path->appPath())) { -std::string tail = host_fs_abs_path.substr(path->appPath().size()); +if (startswith(abs_path, path->appPath())) { +std::string tail = abs_path.substr(path->appPath().size()); // If this path needs to be redirected, search through a list // of targets to see if we can match a valid file (or directory). @@ -486,7 +483,7 @@ } // The path does not need to be redirected. -return host_fs_abs_path; +return abs_path; } void @@ -543,17 +540,17 @@ if (filename.empty() || startswith(filename, "/")) return filename; -// Verify that the current working directories are initialized properly. -// These members should be set initially via params from 'Process.py', -// although they may change over time depending on what the application -// does during simulation. -assert(!tgtCwd.empty()); -assert(!hostCwd.empty()); - // Construct the absolute path given the current working directory for // either the host filesystem or target filesystem. The distinction only // matters if filesystem redirection is utilized in the simulation. -auto path_base = host_filesystem ? hostCwd : tgtCwd; +auto path_base = std::string(); +if (host_filesystem) { +path_base = hostCwd; +assert(!hostCwd.empty()); +} else { +path_base = tgtCwd; +assert(!tgtCwd.empty()); +} // Add a trailing '/' if the current working directory did not have one. normalize(path_base); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18448 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4ab644a3e00737dbf249f5d6faf20a26ceb04248 Gerrit-Change-Number: 18448 Gerrit-PatchSet: 2 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add socket ioctls
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12123 ) Change subject: sim-se: add socket ioctls .. sim-se: add socket ioctls The OpenMPI 1.8.2 runtime needs the ioctl code included in this patch to issue socket operations on the host machine. Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12123 Tested-by: kokoro Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power --- M src/sim/syscall_emul.hh 1 file changed, 57 insertions(+), 10 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 1d14af9..892d9d7 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -78,14 +78,19 @@ #endif #include +#include #include +#include #include #include #include + #if (NO_STATFS == 0) #include + #else #include + #endif #include #include @@ -755,17 +760,59 @@ return -ENOTTY; auto dfdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); -if (!dfdp) -return -EBADF; +if (dfdp) { +EmulatedDriver *emul_driver = dfdp->getDriver(); +if (emul_driver) +return emul_driver->ioctl(p, tc, req); +} -/** - * If the driver is valid, issue the ioctl through it. Otherwise, - * there's an implicit assumption that the device is a TTY type and we - * return that we do not have a valid TTY. - */ -EmulatedDriver *emul_driver = dfdp->getDriver(); -if (emul_driver) -return emul_driver->ioctl(p, tc, req); +auto sfdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); +if (sfdp) { +int status; + +switch (req) { + case SIOCGIFCONF: { +Addr conf_addr = p->getSyscallArg(tc, index); +BufferArg conf_arg(conf_addr, sizeof(ifconf)); +conf_arg.copyIn(tc->getMemProxy()); + +ifconf *conf = (ifconf*)conf_arg.bufferPtr(); +Addr ifc_buf_addr = (Addr)conf->ifc_buf; +BufferArg ifc_buf_arg(ifc_buf_addr, conf->ifc_len); +ifc_buf_arg.copyIn(tc->getMemProxy()); + +conf->ifc_buf = (char*)ifc_buf_arg.bufferPtr(); + +status = ioctl(sfdp->getSimFD(), req, conf_arg.bufferPtr()); +if (status != -1) { +conf->ifc_buf = (char*)ifc_buf_addr; +ifc_buf_arg.copyOut(tc->getMemProxy()); +conf_arg.copyOut(tc->getMemProxy()); +} + +return status; + } + case SIOCGIFFLAGS: +#ifdef __linux__ + case SIOCGIFINDEX: +#endif + case SIOCGIFNETMASK: + case SIOCGIFADDR: +#ifdef __linux__ + case SIOCGIFHWADDR: +#endif + case SIOCGIFMTU: { +Addr req_addr = p->getSyscallArg(tc, index); +BufferArg req_arg(req_addr, sizeof(ifreq)); +req_arg.copyIn(tc->getMemProxy()); + +status = ioctl(sfdp->getSimFD(), req, req_arg.bufferPtr()); +if (status != -1) +req_arg.copyOut(tc->getMemProxy()); +return status; + } +} +} /** * For lack of a better return code, return ENOTTY. Ideally, we should -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12123 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d Gerrit-Change-Number: 12123 Gerrit-PatchSet: 25 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Hoa Nguyen Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: bugfix for 54c77aa055e
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/18448 Change subject: sim-se: bugfix for 54c77aa055e .. sim-se: bugfix for 54c77aa055e 54c77aa055e introduced a bug which manifests as cyclical dependency on a member initialization for the Process class. The current working directory (cwd) parameter is passed into Process to initialize both the target and host versions of the cwd. (The target and host versions may differ if the faux filesystem is used.) The host cwd init invoked methods which rely on the host cwd already being initialized. To avoid the bug, the code will now rely on using the targets cwd version, but will issue checks against the redirect paths. Change-Id: I4ab644a3e00737dbf249f5d6faf20a26ceb04248 --- M src/sim/process.cc 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/src/sim/process.cc b/src/sim/process.cc index 10c68fe..d400b5d 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -456,19 +456,16 @@ std::string Process::checkPathRedirect(const std::string ) { -// If the input parameter contains a relative path, convert it. Note, -// the return value for this method should always return an absolute -// path on the host filesystem. The return value will be used to -// open and manipulate the path specified by the input parameter. Since -// all filesystem handling in syscall mode is passed through to the host, -// we deal only with host paths. -auto host_fs_abs_path = absolutePath(filename, true); +// If the input parameter contains a relative path, convert it. +// The target version of the current working directory is fine since +// we immediately convert it using redirect paths into a host version. +auto abs_path = absolutePath(filename, false); for (auto path : system->redirectPaths) { // Search through the redirect paths to see if a starting substring of // our path falls into any buckets which need to redirected. -if (startswith(host_fs_abs_path, path->appPath())) { -std::string tail = host_fs_abs_path.substr(path->appPath().size()); +if (startswith(abs_path, path->appPath())) { +std::string tail = abs_path.substr(path->appPath().size()); // If this path needs to be redirected, search through a list // of targets to see if we can match a valid file (or directory). @@ -486,7 +483,7 @@ } // The path does not need to be redirected. -return host_fs_abs_path; +return abs_path; } void @@ -543,17 +540,17 @@ if (filename.empty() || startswith(filename, "/")) return filename; -// Verify that the current working directories are initialized properly. -// These members should be set initially via params from 'Process.py', -// although they may change over time depending on what the application -// does during simulation. -assert(!tgtCwd.empty()); -assert(!hostCwd.empty()); - // Construct the absolute path given the current working directory for // either the host filesystem or target filesystem. The distinction only // matters if filesystem redirection is utilized in the simulation. -auto path_base = host_filesystem ? hostCwd : tgtCwd; +auto path_base = std::string(); +if (host_filesystem) { +path_base = hostCwd; +assert(!hostCwd.empty()); +} else { +path_base = tgtCwd; +assert(!tgtCwd.empty()); +} // Add a trailing '/' if the current working directory did not have one. normalize(path_base); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/18448 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4ab644a3e00737dbf249f5d6faf20a26ceb04248 Gerrit-Change-Number: 18448 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: create Proc out files in out dir
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12122 ) Change subject: sim-se: create Proc out files in out dir .. sim-se: create Proc out files in out dir Redirected output files from Process objects were being created in the current directory instead of in the output directory. Change-Id: Ieb6ab5556fbcc811f4f24910da247d4dcdbc71bd Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12122 Reviewed-by: Brandon Potter Maintainer: Brandon Potter Tested-by: kokoro --- M src/sim/fd_array.cc 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/src/sim/fd_array.cc b/src/sim/fd_array.cc index 0600e9f..3b0c587 100644 --- a/src/sim/fd_array.cc +++ b/src/sim/fd_array.cc @@ -43,6 +43,7 @@ #include #include "base/logging.hh" +#include "base/output.hh" #include "params/Process.hh" #include "sim/fd_entry.hh" @@ -311,7 +312,8 @@ int FDArray::openOutputFile(std::string const& filename) const { -return openFile(filename, O_WRONLY | O_CREAT | O_TRUNC, 0664); +return openFile(simout.resolve(filename), +O_WRONLY | O_CREAT | O_TRUNC, 0664); } std::shared_ptr -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12122 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ieb6ab5556fbcc811f4f24910da247d4dcdbc71bd Gerrit-Change-Number: 12122 Gerrit-PatchSet: 24 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: John Alsop Gerrit-Reviewer: kokoro Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: merged ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: faux-filesystem fix w/ ruby in se mode
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12121 ) Change subject: configs: faux-filesystem fix w/ ruby in se mode .. configs: faux-filesystem fix w/ ruby in se mode These changes are needed so that the config scripts can report cache hierarchy information to the faux filesystem. This is useful for the ROCm runtime when it reads psuedofiles from the host filesytem from "/proc". Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12121 Reviewed-by: Brandon Potter Maintainer: Brandon Potter Tested-by: kokoro --- M configs/common/FileSystemConfig.py M configs/ruby/GPU_VIPER.py M configs/ruby/MESI_Three_Level.py M configs/ruby/MOESI_AMD_Base.py M configs/ruby/MOESI_CMP_directory.py M configs/ruby/MOESI_CMP_token.py M configs/ruby/MOESI_hammer.py M configs/ruby/Ruby.py M configs/topologies/BaseTopology.py M configs/topologies/Cluster.py M configs/topologies/MeshDirCorners_XY.py M configs/topologies/Mesh_XY.py 12 files changed, 239 insertions(+), 4 deletions(-) Approvals: Brandon Potter: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py index 561cfe6..8a6da52 100644 --- a/configs/common/FileSystemConfig.py +++ b/configs/common/FileSystemConfig.py @@ -61,7 +61,7 @@ mkdir(procdir) for i in xrange(options.num_cpus): -one_cpu = 'processor : 0\n' + \ +one_cpu = 'processor : %d\n' % (i) + \ 'vendor_id : Generic\n' + \ 'cpu family : 0\n' + \ 'model : 0\n' + \ diff --git a/configs/ruby/GPU_VIPER.py b/configs/ruby/GPU_VIPER.py index 94dcbef..e8e7815 100644 --- a/configs/ruby/GPU_VIPER.py +++ b/configs/ruby/GPU_VIPER.py @@ -499,6 +499,59 @@ cpuCluster.add(cp_cntrl) +# Register CPUs and caches for each CorePair and directory (SE mode only) +if not full_system: +FileSystemConfig.config_filesystem(options) +for i in xrange((options.num_cpus + 1) // 2): +FileSystemConfig.register_cpu(physical_package_id = 0, + core_siblings = \ +xrange(options.num_cpus), + core_id = i*2, + thread_siblings = []) + +FileSystemConfig.register_cpu(physical_package_id = 0, + core_siblings = \ +xrange(options.num_cpus), + core_id = i*2+1, + thread_siblings = []) + +FileSystemConfig.register_cache(level = 0, +idu_type = 'Instruction', +size = options.l1i_size, +line_size = options.cacheline_size, +assoc = options.l1i_assoc, +cpus = [i*2, i*2+1]) + +FileSystemConfig.register_cache(level = 0, +idu_type = 'Data', +size = options.l1d_size, +line_size = options.cacheline_size, +assoc = options.l1d_assoc, +cpus = [i*2]) + +FileSystemConfig.register_cache(level = 0, +idu_type = 'Data', +size = options.l1d_size, +line_size = options.cacheline_size, +assoc = options.l1d_assoc, +cpus = [i*2+1]) + +FileSystemConfig.register_cache(level = 1, +idu_type = 'Unified', +size = options.l2_size, +line_size = options.cacheline_size, +assoc = options.l2_assoc, +cpus = [i*2, i*2+1]) + +for i in range(options.num_dirs): +FileSystemConfig.register_cache(level = 2, +idu_type = 'Unified', +size = options.l3_size, +line_size = options.cach
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Brandon Potter has submitted this change and it was merged. ( https://gem5-review.googlesource.com/c/public/gem5/+/12119 ) Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/12119 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py A src/doc/se-files.txt M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 17 files changed, 755 insertions(+), 94 deletions(-) Approvals: Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/configs/common/FileSystemConfig.py b/configs/common/FileSystemConfig.py new file mode 100644 index 000..561cfe6 --- /dev/null +++ b/configs/common/FileSystemConfig.py @@ -0,0 +1,175 @@ +# Copyright (c) 2015 Advanced Micro Devices, Inc. +# All rights reserved +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer; +# redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution; +# neither the name of the copyright holders nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +# +# Authors: David Hashe + +from __future__ import print_function + +import m5 +from m5.objects import * +from m5.util.convert import * + +import operator, os, platform, getpass +from os import mkdir, makedirs, getpid, listdir, stat, access +from pwd import getpwuid +from os.path import join as joinpath +from os.path import isdir +from shutil import rmtree, copyfile + +def hex_mask(terms): +dec_mask = reduce(operator.or_, [2**i for i in terms], 0) +return "%08x" % dec_mask + +def file_append(path, contents): +with open(joinpath(*path), 'a') as f: +f.write(str(contents)) + +def replace_tree(path): +if isdir(path): +rmtree(path) +mkdir(path) + +def config_filesystem(options): +fsdir = joinpath(m5.options.outdir, 'fs') +replace_tree(fsdir) + +# Set up /proc +procdir = joinpath(fsdir, 'proc') +mkdir(procdir) + +for i in xrange(options.num_cpus): +one_cpu = 'processor : 0\n' + \ + 'vendor_id : Generic\n' + \ + 'cpu family : 0\n' + \ + 'model : 0\n' + \ + 'model name : Generic\n' + \ + 's
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello kokoro, Ciro Santilli, Alexandru Duțu, Anthony Gutierrez, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#21). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py A src/doc/se-files.txt M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 17 files changed, 755 insertions(+), 94 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 21 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello Anthony Gutierrez, Jason Lowe-Power, Alexandru Duțu, kokoro, Ciro Santilli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#19). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py A src/doc/se-files.txt M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 17 files changed, 755 insertions(+), 94 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 19 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: kokoro Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove Process initVirtMem member
Hello John Alsop, Alexandru Duțu, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12304 to look at the new patch set (#20). Change subject: sim-se: remove Process initVirtMem member .. sim-se: remove Process initVirtMem member The MemState class has a reference to a virtual memory proxy that can be used to access the simulated address space. There is no need for the Process class to have a duplicate reference. Remove the Process initVirtMem member and use the one provided in MemState instead. Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 --- M src/arch/alpha/process.cc M src/arch/arm/process.cc M src/arch/mips/process.cc M src/arch/power/process.cc M src/arch/riscv/process.cc M src/arch/sparc/process.cc M src/arch/x86/process.cc M src/sim/process.cc M src/sim/process.hh 9 files changed, 110 insertions(+), 105 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12304 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 Gerrit-Change-Number: 12304 Gerrit-PatchSet: 20 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: John Alsop Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: faux-filesystem fix w/ ruby in se mode
Hello John Alsop, Alexandru Duțu, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12121 to look at the new patch set (#22). Change subject: configs: faux-filesystem fix w/ ruby in se mode .. configs: faux-filesystem fix w/ ruby in se mode These changes are needed so that the config scripts can report cache hierarchy information to the faux filesystem. This is useful for the ROCm runtime when it reads psuedofiles from the host filesytem from "/proc". Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b --- M configs/common/FileSystemConfig.py M configs/ruby/GPU_VIPER.py M configs/ruby/MESI_Three_Level.py M configs/ruby/MOESI_AMD_Base.py M configs/ruby/MOESI_CMP_directory.py M configs/ruby/MOESI_CMP_token.py M configs/ruby/MOESI_hammer.py M configs/ruby/Ruby.py M configs/topologies/BaseTopology.py M configs/topologies/Cluster.py M configs/topologies/MeshDirCorners_XY.py M configs/topologies/Mesh_XY.py 12 files changed, 239 insertions(+), 4 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12121 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b Gerrit-Change-Number: 12121 Gerrit-PatchSet: 22 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: John Alsop Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-CC: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add socket ioctls
Hello John Alsop, Jason Lowe-Power, Hoa Nguyen, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12123 to look at the new patch set (#20). Change subject: sim-se: add socket ioctls .. sim-se: add socket ioctls The OpenMPI 1.8.2 runtime needs the ioctl code included in this patch to issue socket operations on the host machine. Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d --- M src/sim/syscall_emul.hh 1 file changed, 57 insertions(+), 10 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12123 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d Gerrit-Change-Number: 12123 Gerrit-PatchSet: 20 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Hoa Nguyen Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: John Alsop Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello Anthony Gutierrez, Jason Lowe-Power, Ciro Santilli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#17). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py A src/doc/se-files.txt M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 17 files changed, 755 insertions(+), 94 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 17 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Jason Lowe-Power Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello Anthony Gutierrez, Jason Lowe-Power, Ciro Santilli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#16). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 16 files changed, 602 insertions(+), 94 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 16 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Jason Lowe-Power Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: faux-filesystem fix w/ ruby in se mode
Brandon Potter has uploaded a new patch set (#16). ( https://gem5-review.googlesource.com/c/public/gem5/+/12121 ) Change subject: configs: faux-filesystem fix w/ ruby in se mode .. configs: faux-filesystem fix w/ ruby in se mode These changes are needed so that the config scripts can report cache hierarchy information to the faux filesystem. This is useful for the ROCm runtime when it reads psuedofiles from the host filesytem from "/proc". Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b --- M configs/ruby/MESI_Three_Level.py M configs/ruby/MESI_Two_Level.py M configs/ruby/MI_example.py M configs/ruby/MOESI_CMP_directory.py M configs/ruby/MOESI_CMP_token.py M configs/ruby/MOESI_hammer.py M configs/ruby/Ruby.py M configs/topologies/BaseTopology.py M configs/topologies/Cluster.py M configs/topologies/Crossbar.py M configs/topologies/CrossbarGarnet.py M configs/topologies/MeshDirCorners_XY.py M configs/topologies/Mesh_XY.py M configs/topologies/Mesh_westfirst.py M configs/topologies/Pt2Pt.py 15 files changed, 235 insertions(+), 10 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12121 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b Gerrit-Change-Number: 12121 Gerrit-PatchSet: 16 Gerrit-Owner: Brandon Potter Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-CC: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove mem proxy in ThreadContext
Brandon Potter has uploaded a new patch set (#14). ( https://gem5-review.googlesource.com/c/public/gem5/+/12305 ) Change subject: sim-se: remove mem proxy in ThreadContext .. sim-se: remove mem proxy in ThreadContext Many parts of the source code use a memory proxy reference to access the simulated memory space in Syscall Emulation Mode. However, it would be nice if all memory responsibilities were delegated to a single object rather than spread across many objects. This patch helps to consolidate the memory responsibilities inside the MemState class by removing the ThreadContext's memory proxy. Change-Id: Ic1a6c3017c412a24db91770396d0a9bde790421d --- M src/arch/alpha/faults.cc M src/arch/alpha/linux/process.cc M src/arch/alpha/process.cc M src/arch/alpha/process.hh M src/arch/arm/freebsd/process.cc M src/arch/arm/linux/process.cc M src/arch/arm/process.cc M src/arch/arm/remote_gdb.cc M src/arch/arm/tlb.cc M src/arch/generic/tlb.cc M src/arch/mips/linux/process.cc M src/arch/mips/process.cc M src/arch/mips/remote_gdb.cc M src/arch/mips/tlb.cc M src/arch/power/linux/process.cc M src/arch/power/process.cc M src/arch/power/remote_gdb.cc M src/arch/power/tlb.cc M src/arch/riscv/linux/process.cc M src/arch/riscv/process.cc M src/arch/riscv/process.hh M src/arch/riscv/remote_gdb.cc M src/arch/riscv/tlb.cc M src/arch/sparc/faults.cc M src/arch/sparc/linux/syscalls.cc M src/arch/sparc/process.cc M src/arch/sparc/process.hh M src/arch/sparc/remote_gdb.cc M src/arch/sparc/solaris/process.cc M src/arch/x86/linux/process.cc M src/arch/x86/process.cc M src/arch/x86/process.hh M src/arch/x86/pseudo_inst.cc M src/arch/x86/remote_gdb.cc M src/arch/x86/tlb.cc M src/base/remote_gdb.cc M src/cpu/checker/thread_context.hh M src/cpu/o3/thread_context.hh M src/cpu/thread_context.hh M src/cpu/thread_state.cc M src/cpu/thread_state.hh M src/gpu-compute/cl_driver.cc M src/gpu-compute/compute_unit.cc M src/gpu-compute/gpu_tlb.cc M src/gpu-compute/shader.cc M src/mem/se_translating_port_proxy.cc M src/mem/se_translating_port_proxy.hh M src/sim/SConscript M src/sim/faults.cc A src/sim/mem_state.cc M src/sim/mem_state.hh R src/sim/mem_state_impl.hh M src/sim/process.cc M src/sim/process.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 56 files changed, 1,292 insertions(+), 644 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12305 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic1a6c3017c412a24db91770396d0a9bde790421d Gerrit-Change-Number: 12305 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: change syscall function signature
Hello Jason Lowe-Power, Andreas Sandberg, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12299 to look at the new patch set (#14). Change subject: sim-se: change syscall function signature .. sim-se: change syscall function signature The system calls had four parameters. One of the parameters is ThreadContext and another is Process. The ThreadContext holds the value of the current process so the Process parameter is redundant since the system call functions already have indirect access. With the old API, it is possible to call into the functions with the wrong supplied Process which could end up being a confusing error. This patch removes the redundancy by forcing access through the ThreadContext field within each system call. Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c --- M src/arch/alpha/linux/process.cc M src/arch/arm/freebsd/process.cc M src/arch/arm/linux/process.cc M src/arch/mips/linux/process.cc M src/arch/power/linux/process.cc M src/arch/riscv/linux/process.cc M src/arch/sparc/linux/syscalls.cc M src/arch/sparc/solaris/process.cc M src/arch/x86/linux/process.cc M src/gpu-compute/cl_driver.cc M src/gpu-compute/cl_driver.hh M src/sim/emul_driver.hh M src/sim/process.cc M src/sim/syscall_desc.cc M src/sim/syscall_desc.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 17 files changed, 372 insertions(+), 383 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12299 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c Gerrit-Change-Number: 12299 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello Anthony Gutierrez, Jason Lowe-Power, Ciro Santilli, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#15). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 16 files changed, 585 insertions(+), 87 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 15 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Jason Lowe-Power Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Hello Anthony Gutierrez, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 to look at the new patch set (#14). Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 16 files changed, 597 insertions(+), 99 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 14 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Anthony Gutierrez Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Jason Lowe-Power Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: adding pipe2 syscall
Brandon Potter has uploaded a new patch set (#12). ( https://gem5-review.googlesource.com/c/public/gem5/+/12310 ) Change subject: sim-se: adding pipe2 syscall .. sim-se: adding pipe2 syscall pipe2 builds on top of the pipe syscall implementation by adding some extra flags for the files (to avoid have to make separate calls to fcntl). Change-Id: I88cf6f1387b9d14e60b33a32db412da9ed93a3e6 --- M src/arch/x86/linux/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 3 files changed, 63 insertions(+), 6 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12310 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I88cf6f1387b9d14e60b33a32db412da9ed93a3e6 Gerrit-Change-Number: 12310 Gerrit-PatchSet: 12 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: generate /proc/self/maps file
Hello Alexandru Duțu, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12311 to look at the new patch set (#12). Change subject: sim-se: generate /proc/self/maps file .. sim-se: generate /proc/self/maps file This change generates /proc/self/maps for the currently running process. It assummes a system with one process and one thread per process. This is needed by the OpenCL runtime, as it calls pthread_getattr_np. Change-Id: Iee0f35842ef5571f6b0717194bc746a585a945e6 --- M configs/common/FileSystemConfig.py M src/arch/alpha/process.cc M src/arch/x86/process.cc M src/kern/linux/linux.cc M src/kern/linux/linux.hh M src/mem/vma.hh M src/sim/mem_state.cc M src/sim/mem_state.hh M src/sim/syscall_emul.hh 9 files changed, 89 insertions(+), 21 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12311 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Iee0f35842ef5571f6b0717194bc746a585a945e6 Gerrit-Change-Number: 12311 Gerrit-PatchSet: 12 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove /sys from special paths
Brandon Potter has uploaded a new patch set (#13). ( https://gem5-review.googlesource.com/c/public/gem5/+/12127 ) Change subject: sim-se: remove /sys from special paths .. sim-se: remove /sys from special paths Currently, the open system call implementation in SE mode treats /sys/ as a special path that is opened using a special open handler. The ROC runtime, however, reads several files in /sys/ that are supported via path redirection. Here we remove /sys/ from the special files so that the necessary files may be read via path redirection. Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d --- M src/kern/linux/linux.cc M src/sim/syscall_emul.hh 2 files changed, 1 insertion(+), 12 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Gerrit-Change-Number: 12127 Gerrit-PatchSet: 13 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add new option to getrlimit syscall
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17109 Change subject: sim-se: add new option to getrlimit syscall .. sim-se: add new option to getrlimit syscall The NPROC option was not serviced by the getrlimit syscall. This changeset adds in the necessary code to service the option. Change-Id: I679d3949c3bbb0628188f4e33034028d7726fdcb --- M src/sim/syscall_emul.hh 1 file changed, 6 insertions(+), 0 deletions(-) diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index d59fa72..1d4f399 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1959,6 +1959,12 @@ rlp->rlim_max = TheISA::htog(rlp->rlim_max); break; + case OS::TGT_RLIMIT_NPROC: +rlp->rlim_cur = rlp->rlim_max = tc->getSystemPtr()->numContexts(); +rlp->rlim_cur = TheISA::htog(rlp->rlim_cur); +rlp->rlim_max = TheISA::htog(rlp->rlim_max); +break; + default: warn("getrlimit: unimplemented resource %d", resource); return -EINVAL; -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17109 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I679d3949c3bbb0628188f4e33034028d7726fdcb Gerrit-Change-Number: 17109 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove mem proxy in ThreadContext
Brandon Potter has uploaded a new patch set (#11). ( https://gem5-review.googlesource.com/c/public/gem5/+/12305 ) Change subject: sim-se: remove mem proxy in ThreadContext .. sim-se: remove mem proxy in ThreadContext Many parts of the source code use a memory proxy reference to access the simulated memory space in Syscall Emulation Mode. However, it would be nice if all memory responsibilities were delegated to a single object rather than spread across many objects. This patch helps to consolidate the memory responsibilities inside the MemState class by removing the ThreadContext's memory proxy. Change-Id: Ic1a6c3017c412a24db91770396d0a9bde790421d --- M src/arch/alpha/faults.cc M src/arch/alpha/linux/process.cc M src/arch/alpha/process.cc M src/arch/alpha/process.hh M src/arch/arm/freebsd/process.cc M src/arch/arm/linux/process.cc M src/arch/arm/process.cc M src/arch/arm/remote_gdb.cc M src/arch/arm/tlb.cc M src/arch/generic/tlb.cc M src/arch/mips/linux/process.cc M src/arch/mips/process.cc M src/arch/mips/remote_gdb.cc M src/arch/mips/tlb.cc M src/arch/power/linux/process.cc M src/arch/power/process.cc M src/arch/power/remote_gdb.cc M src/arch/power/tlb.cc M src/arch/riscv/linux/process.cc M src/arch/riscv/process.cc M src/arch/riscv/process.hh M src/arch/riscv/remote_gdb.cc M src/arch/riscv/tlb.cc M src/arch/sparc/faults.cc M src/arch/sparc/linux/syscalls.cc M src/arch/sparc/process.cc M src/arch/sparc/process.hh M src/arch/sparc/remote_gdb.cc M src/arch/sparc/solaris/process.cc M src/arch/x86/linux/process.cc M src/arch/x86/process.cc M src/arch/x86/process.hh M src/arch/x86/pseudo_inst.cc M src/arch/x86/remote_gdb.cc M src/arch/x86/tlb.cc M src/base/remote_gdb.cc M src/cpu/checker/thread_context.hh M src/cpu/o3/thread_context.hh M src/cpu/thread_context.hh M src/cpu/thread_state.cc M src/cpu/thread_state.hh M src/gpu-compute/cl_driver.cc M src/gpu-compute/compute_unit.cc M src/gpu-compute/gpu_tlb.cc M src/gpu-compute/shader.cc M src/mem/se_translating_port_proxy.cc M src/mem/se_translating_port_proxy.hh M src/sim/SConscript M src/sim/faults.cc A src/sim/mem_state.cc M src/sim/mem_state.hh R src/sim/mem_state_impl.hh M src/sim/process.cc M src/sim/process.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 56 files changed, 1,292 insertions(+), 644 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12305 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ic1a6c3017c412a24db91770396d0a9bde790421d Gerrit-Change-Number: 12305 Gerrit-PatchSet: 11 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a faux-filesystem
Brandon Potter has uploaded a new patch set (#12). ( https://gem5-review.googlesource.com/c/public/gem5/+/12119 ) Change subject: sim-se: add a faux-filesystem .. sim-se: add a faux-filesystem This change introduces the concept of a faux-filesystem. The faux-filesystem creates a directory structure in m5out (or whatever output dir the user specifies) where system calls may be redirected. This is useful to avoid non-determinism when reading files with varying path names (e.g., variations from run-to-run if the simulation is scheduled on a cluster where paths may change). Also, this changeset allows circumventing host pseudofiles which have information specific to the host processor (such as cache hierarchy or processor information). Bypassing host pseudofiles can be useful when executing runtimes in the absence of an operating system kernel since runtimes may try to query standard files (i.e. /proc or /sys) which are not relevant to an application executing in syscall emulation mode. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc M src/sim/Process.py A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 16 files changed, 619 insertions(+), 99 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 12 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add new getpgrp system call
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17111 Change subject: sim-se: add new getpgrp system call .. sim-se: add new getpgrp system call This changeset adds new (relatively simple) system call support. The getpgrp call returns a thread context's pgid. Change-Id: I361bdbfb9c01b761ddd5a4923d23f86971f8d614 --- M src/arch/x86/linux/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/arch/x86/linux/process.cc b/src/arch/x86/linux/process.cc index f92575f..ab57b78 100644 --- a/src/arch/x86/linux/process.cc +++ b/src/arch/x86/linux/process.cc @@ -344,7 +344,7 @@ /* 108 */ SyscallDesc("getegid", getegidFunc), /* 109 */ SyscallDesc("setpgid", setpgidFunc), /* 110 */ SyscallDesc("getppid", getppidFunc), -/* 111 */ SyscallDesc("getpgrp", unimplementedFunc), +/* 111 */ SyscallDesc("getpgrp", getpgrpFunc), /* 112 */ SyscallDesc("setsid", unimplementedFunc), /* 113 */ SyscallDesc("setreuid", unimplementedFunc), /* 114 */ SyscallDesc("setregid", unimplementedFunc), diff --git a/src/sim/syscall_emul.cc b/src/sim/syscall_emul.cc index 17ce9b7..b3f675c 100644 --- a/src/sim/syscall_emul.cc +++ b/src/sim/syscall_emul.cc @@ -971,6 +971,13 @@ } SyscallReturn +getpgrpFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) +{ +auto process = tc->getProcessPtr(); +return process->pgid(); +} + +SyscallReturn setpgidFunc(SyscallDesc *desc, int callnum, ThreadContext *tc) { int index = 0; diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 0abd814..8dd049d 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -245,6 +245,9 @@ /// Target chown() handler. SyscallReturn chownFunc(SyscallDesc *desc, int num, ThreadContext *tc); +/// Target getpgrpFunc() handler. +SyscallReturn getpgrpFunc(SyscallDesc *desc, int num, ThreadContext *tc); + /// Target setpgid() handler. SyscallReturn setpgidFunc(SyscallDesc *desc, int num, ThreadContext *tc); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17111 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I361bdbfb9c01b761ddd5a4923d23f86971f8d614 Gerrit-Change-Number: 17111 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: small performance optimization
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17108 Change subject: sim-se: small performance optimization .. sim-se: small performance optimization A local variable was being set inside a loop when it should have been set outside the loop. This changeset moves the variable to the appropriate place. Change-Id: If7655b501bd819c39d35dea4c316b4b9ed3173a2 --- M src/sim/process.cc 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/process.cc b/src/sim/process.cc index 7d1a78d..961913d 100644 --- a/src/sim/process.cc +++ b/src/sim/process.cc @@ -202,8 +202,8 @@ * host file descriptors are also dup'd so that the flags for the * host file descriptor is independent of the other process. */ +std::shared_ptr nfds = np->fds; for (int tgt_fd = 0; tgt_fd < fds->getSize(); tgt_fd++) { -std::shared_ptr nfds = np->fds; std::shared_ptr this_fde = (*fds)[tgt_fd]; if (!this_fde) { nfds->setFDEntry(tgt_fd, nullptr); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17108 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If7655b501bd819c39d35dea4c316b4b9ed3173a2 Gerrit-Change-Number: 17108 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se, tests: add a new sim-se test
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17112 Change subject: sim-se, tests: add a new sim-se test .. sim-se, tests: add a new sim-se test This changeset adds a test to check the redirection features added in faux-filesystem changeset. The test contains a "chdir" system call to "/proc" which should be redirected to "$(gem5-dir)/m5out/fs/proc" (as specified by the config files). After "chdir", the test subsequently outputs the "/proc/cpuinfo" file which should output a configuration of a fake cpu with values set by a Python configuration file. Note, the test will call "clone" once. To avoid a runtime error, make sure that you run this test with "-n2" supplied to the "config/example/se.py" script. Change-Id: I505b046b7a4feddfa93a6ef0f0773ac43078cc94 --- A tests/test-progs/chdir-print/Makefile A tests/test-progs/chdir-print/chdir-print.c 2 files changed, 50 insertions(+), 0 deletions(-) diff --git a/tests/test-progs/chdir-print/Makefile b/tests/test-progs/chdir-print/Makefile new file mode 100644 index 000..6a357d5 --- /dev/null +++ b/tests/test-progs/chdir-print/Makefile @@ -0,0 +1,20 @@ + +CPP := g++ + +TEST_OBJS := chdir-print.o +TEST_PROGS := $(TEST_OBJS:.o=) + +# Rules == + +.PHONY: default clean + +default: $(TEST_PROGS) + +clean: + $(RM) $(TEST_OBJS) $(TEST_PROGS) + +$(TEST_PROGS): $(TEST_OBJS) + $(CPP) -static -o $@ $@.o + +%.o: %.c Makefile + $(CPP) -c -o $@ $*.c -msse3 diff --git a/tests/test-progs/chdir-print/chdir-print.c b/tests/test-progs/chdir-print/chdir-print.c new file mode 100644 index 000..0cf56f9 --- /dev/null +++ b/tests/test-progs/chdir-print/chdir-print.c @@ -0,0 +1,30 @@ +#include +#include +#include +#include + +const int BUFFER_SIZE = 64; + +int main(void) +{ +char *cwd = getcwd(NULL, PATH_MAX); +printf("cwd: %s\n", cwd); +free(cwd); + +chdir("/proc"); + +cwd = getcwd(NULL, PATH_MAX); +printf("cwd: %s\n", cwd); +free(cwd); + +FILE *fp; +char buffer[BUFFER_SIZE]; +fp = popen("cat cpuinfo", "r"); +if (fp != NULL) { +while (fgets(buffer, BUFFER_SIZE, fp) != NULL) +printf("%s", buffer); +pclose(fp); +} + +return 0; +} -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17112 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I505b046b7a4feddfa93a6ef0f0773ac43078cc94 Gerrit-Change-Number: 17112 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: fstat64 bugfix
Brandon Potter has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/17110 Change subject: sim-se: fstat64 bugfix .. sim-se: fstat64 bugfix The fstat64 system call does an upcast on entries in the file descriptor array to check if the file descriptor has a backing host-filesystem file opened. It does so because it needs to pass the host fd into the fstat call (since we rely on the host filesystem to service filesystem system calls). The upcast was overly specific. This changeset alters the system call to use the most general base class of the file descriptor entries that can satisfy the code. Change-Id: I10daf820257cea4d678ee6917e01e9cc9cd1cf5e --- M src/sim/syscall_emul.hh 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sim/syscall_emul.hh b/src/sim/syscall_emul.hh index 1d4f399..0abd814 100644 --- a/src/sim/syscall_emul.hh +++ b/src/sim/syscall_emul.hh @@ -1367,7 +1367,7 @@ int tgt_fd = p->getSyscallArg(tc, index); Addr bufPtr = p->getSyscallArg(tc, index); -auto ffdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); +auto ffdp = std::dynamic_pointer_cast((*p->fds)[tgt_fd]); if (!ffdp) return -EBADF; int sim_fd = ffdp->getSimFD(); -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/17110 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I10daf820257cea4d678ee6917e01e9cc9cd1cf5e Gerrit-Change-Number: 17110 Gerrit-PatchSet: 1 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newchange ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: faux-filesystem fix w/ classic se mode
Brandon Potter has uploaded a new patch set (#12). ( https://gem5-review.googlesource.com/c/public/gem5/+/12120 ) Change subject: configs: faux-filesystem fix w/ classic se mode .. configs: faux-filesystem fix w/ classic se mode These changes are needed so that the config scripts can report cache hierarchy information to the faux filesystem. This is useful for the ROCm runtime when it reads psuedofiles from the host filesystem from "/proc". Change-Id: I51af4d41c49dcf719a4a540346fe3e17b2eb95f7 --- M configs/common/CacheConfig.py M configs/example/se.py 2 files changed, 37 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12120 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I51af4d41c49dcf719a4a540346fe3e17b2eb95f7 Gerrit-Change-Number: 12120 Gerrit-PatchSet: 12 Gerrit-Owner: Brandon Potter Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-CC: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove Process initVirtMem member
Brandon Potter has uploaded a new patch set (#10). ( https://gem5-review.googlesource.com/c/public/gem5/+/12304 ) Change subject: sim-se: remove Process initVirtMem member .. sim-se: remove Process initVirtMem member The MemState class has a reference to a virtual memory proxy that can be used to access the simulated address space. There is no need for the Process class to have a duplicate reference. Remove the Process initVirtMem member and use the one provided in MemState instead. Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 --- M src/arch/alpha/process.cc M src/arch/arm/process.cc M src/arch/mips/process.cc M src/arch/power/process.cc M src/arch/riscv/process.cc M src/arch/sparc/process.cc M src/arch/x86/process.cc M src/sim/process.cc M src/sim/process.hh 9 files changed, 112 insertions(+), 108 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12304 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 Gerrit-Change-Number: 12304 Gerrit-PatchSet: 10 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a pseudo-filesystem
Brandon Potter has uploaded a new patch set (#10). ( https://gem5-review.googlesource.com/c/public/gem5/+/12119 ) Change subject: sim-se: add a pseudo-filesystem .. sim-se: add a pseudo-filesystem This change introduce the concept of a pseudo-filesystem in gem5. The pseudo-filesystm works by creating a directory structure in m5out (or whichever output dir the user specifies) that system calls may be redirected to. This is useful for cases where SE mode would introduce some non-determinism due to reading files with varying path names (e.g., variation from run to run if your gem5 job is scheduled on a cluster where paths may change). It is also useful for opening files that have information specific to the host CPU, such as cache hierarchy or CPU information. This is useful when running runtimes in SE mode in the absence of a real OS kernel since many runtime layers provide system-level services to user space applications. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 15 files changed, 582 insertions(+), 96 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 10 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Brandon Potter Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: change syscall function signature
Hello Jason Lowe-Power, Andreas Sandberg, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12299 to look at the new patch set (#8). Change subject: sim-se: change syscall function signature .. sim-se: change syscall function signature The system calls had four parameters. One of the parameters is ThreadContext and another is Process. The ThreadContext holds the value of the current process so the Process parameter is redundant since the system call functions already have indirect access. With the old API, it is possible to call into the functions with the wrong supplied Process which could end up being a confusing error. This patch removes the redundancy by forcing access through the ThreadContext field within each system call. Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c --- M src/arch/alpha/linux/process.cc M src/arch/arm/freebsd/process.cc M src/arch/arm/linux/process.cc M src/arch/mips/linux/process.cc M src/arch/power/linux/process.cc M src/arch/riscv/linux/process.cc M src/arch/sparc/linux/syscalls.cc M src/arch/sparc/solaris/process.cc M src/arch/x86/linux/process.cc M src/gpu-compute/cl_driver.cc M src/gpu-compute/cl_driver.hh M src/sim/emul_driver.hh M src/sim/process.cc M src/sim/syscall_desc.cc M src/sim/syscall_desc.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 17 files changed, 372 insertions(+), 383 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12299 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib43d3f65824f6d425260dfd9f67de1892b6e8b7c Gerrit-Change-Number: 12299 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: const for loader's loadSection param
Hello Andreas Sandberg, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12301 to look at the new patch set (#8). Change subject: sim-se: const for loader's loadSection param .. sim-se: const for loader's loadSection param The port proxy can be declared as a reference to a const proxy rather than just a reference to a proxy. Change-Id: I4640b0c5f33e2334c1e7630131f78607ced40a34 --- M src/base/loader/elf_object.cc M src/base/loader/elf_object.hh M src/base/loader/object_file.cc M src/base/loader/object_file.hh 4 files changed, 9 insertions(+), 7 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12301 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4640b0c5f33e2334c1e7630131f78607ced40a34 Gerrit-Change-Number: 12301 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: do not redirect for /proc/self/exe
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12312 ) Change subject: sim-se: do not redirect for /proc/self/exe .. sim-se: do not redirect for /proc/self/exe Change-Id: I38286282759963f479efe97db5818a32b3a7dd73 --- M src/sim/syscall_emul.cc 1 file changed, 2 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12312 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I38286282759963f479efe97db5818a32b3a7dd73 Gerrit-Change-Number: 12312 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: small refactor on pipe syscall
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12308 ) Change subject: sim-se: small refactor on pipe syscall .. sim-se: small refactor on pipe syscall Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 --- M src/sim/syscall_emul.cc 1 file changed, 7 insertions(+), 5 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12308 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I02ffb1c4af980554ff12ac7d11d32ba80fe261c5 Gerrit-Change-Number: 12308 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove comment for code that moved
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12300 ) Change subject: sim-se: remove comment for code that moved .. sim-se: remove comment for code that moved The page table code must have moved from this class, because the comment no longer accurately reflects upon any of the surrounding code. Change-Id: If08a4298c1237a541d9875ddeaf3d3ecfd98e9db --- M src/arch/x86/process.hh 1 file changed, 0 insertions(+), 7 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12300 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: If08a4298c1237a541d9875ddeaf3d3ecfd98e9db Gerrit-Change-Number: 12300 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove Process initVirtMem member
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12304 ) Change subject: sim-se: remove Process initVirtMem member .. sim-se: remove Process initVirtMem member The MemState class has a reference to a virtual memory proxy that can be used to access the simulated address space. There is no need for the Process class to have a duplicate reference. Remove the Process initVirtMem member and use the one provided in MemState instead. Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 --- M src/arch/alpha/process.cc M src/arch/arm/process.cc M src/arch/mips/process.cc M src/arch/power/process.cc M src/arch/riscv/process.cc M src/arch/sparc/process.cc M src/arch/x86/process.cc M src/sim/process.cc M src/sim/process.hh 9 files changed, 107 insertions(+), 105 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12304 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifcc00759423e18975bb488bb44661d2545fd30b3 Gerrit-Change-Number: 12304 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: generate /proc/self/maps file
Hello Alexandru Duțu, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12311 to look at the new patch set (#8). Change subject: sim-se: generate /proc/self/maps file .. sim-se: generate /proc/self/maps file This change generates /proc/self/maps for the currently running process. It assummes a system with one process and one thread per process. This is needed by the OpenCL runtime, as it calls pthread_getattr_np. Change-Id: Iee0f35842ef5571f6b0717194bc746a585a945e6 --- M configs/common/FileSystemConfig.py M src/arch/alpha/process.cc M src/arch/x86/linux/process.cc M src/arch/x86/process.cc M src/kern/linux/linux.cc M src/kern/linux/linux.hh M src/mem/vma.hh M src/sim/mem_state.cc M src/sim/mem_state.hh M src/sim/syscall_emul.hh 10 files changed, 90 insertions(+), 22 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12311 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Iee0f35842ef5571f6b0717194bc746a585a945e6 Gerrit-Change-Number: 12311 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: support lazy physical page allocs
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12307 ) Change subject: sim-se: support lazy physical page allocs .. sim-se: support lazy physical page allocs This patch introduces Virtual Memory Areas (VMAs) to the Process class. Instead of binding virtual pages to physical pages during mmap/remap, we instead create a VMA that covers the region. Physical pages are allocated only if the virtual page is actually touched by the program. The binding occurs in fixupStackFault, renamed to fixupFault. Delaying the binding allows SE mode to support sparse usages of mmap. Change-Id: I2caa0f3c9622d810474ea1b1ad717820b2de9437 --- M src/base/addr_range.hh A src/base/mapped_buf.hh M src/mem/SConscript A src/mem/vma.cc A src/mem/vma.hh M src/sim/mem_state.cc M src/sim/mem_state.hh M src/sim/process.cc M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh 10 files changed, 494 insertions(+), 167 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12307 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I2caa0f3c9622d810474ea1b1ad717820b2de9437 Gerrit-Change-Number: 12307 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: remove /sys from special paths
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12127 ) Change subject: sim-se: remove /sys from special paths .. sim-se: remove /sys from special paths Currently, the open system call implementation in SE mode treats /sys/ as a special path that is opened using a special open handler. The ROC runtime, however, reads several files in /sys/ that are supported via path redirection. Here we remove /sys/ from the special files so that the necessary files may be read via path redirection. Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d --- M src/sim/syscall_emul.hh 1 file changed, 1 insertion(+), 2 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12127 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ifdab38ea1e6cc486ad43aec96b6e032fe63f137d Gerrit-Change-Number: 12127 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add const qualifier to copy funcs
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12302 ) Change subject: sim-se: add const qualifier to copy funcs .. sim-se: add const qualifier to copy funcs The reference parameters do not need modification access so tack on the const qualifier. Change-Id: I281ba42438fd672b5bfbb1b9f7fb16aa7273d14a --- M src/sim/syscall_emul.hh 1 file changed, 3 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12302 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I281ba42438fd672b5bfbb1b9f7fb16aa7273d14a Gerrit-Change-Number: 12302 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add const to syscall_emul_buf params
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12303 ) Change subject: sim-se: add const to syscall_emul_buf params .. sim-se: add const to syscall_emul_buf params The parameter usage does not require the ability to modify the port proxy. Change-Id: I8c47926048bb14ed429b0656e09da3f53c941ab8 --- M src/sim/syscall_emul_buf.hh 1 file changed, 2 insertions(+), 2 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12303 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I8c47926048bb14ed429b0656e09da3f53c941ab8 Gerrit-Change-Number: 12303 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add eventfd system call
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12125 ) Change subject: sim-se: add eventfd system call .. sim-se: add eventfd system call Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c --- M src/arch/x86/linux/process.cc M src/sim/fd_entry.hh M src/sim/syscall_emul.hh 3 files changed, 48 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12125 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I7aeb4fe808d0c8f2fb8041e3662d330d8458f09c Gerrit-Change-Number: 12125 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: move members of Process to MemState
Brandon Potter has uploaded a new patch set (#8). ( https://gem5-review.googlesource.com/c/public/gem5/+/12306 ) Change subject: sim-se: move members of Process to MemState .. sim-se: move members of Process to MemState This changeset moves memory-related functionality from the Process class to the MemState class. The goal is to create an object to manage the memory for Syscall Emulation Mode; ideally, that object has as much cohesion as possible. Change-Id: I5e6afecbd47e9c46998c4d6a1091d1f4fb698a71 --- M src/arch/alpha/faults.cc M src/arch/alpha/process.cc M src/arch/alpha/process.hh M src/arch/arm/linux/process.cc M src/arch/arm/process.cc M src/arch/arm/remote_gdb.cc M src/arch/arm/tlb.cc M src/arch/generic/tlb.cc M src/arch/mips/process.cc M src/arch/mips/remote_gdb.cc M src/arch/mips/tlb.cc M src/arch/power/process.cc M src/arch/power/remote_gdb.cc M src/arch/power/tlb.cc M src/arch/riscv/process.cc M src/arch/riscv/process.hh M src/arch/riscv/remote_gdb.cc M src/arch/riscv/tlb.cc M src/arch/sparc/faults.cc M src/arch/sparc/process.cc M src/arch/sparc/process.hh M src/arch/sparc/remote_gdb.cc M src/arch/x86/process.cc M src/arch/x86/process.hh M src/arch/x86/remote_gdb.cc M src/arch/x86/tlb.cc M src/cpu/thread_context.hh M src/gpu-compute/compute_unit.cc M src/gpu-compute/gpu_tlb.cc M src/gpu-compute/shader.cc M src/mem/se_translating_port_proxy.cc M src/mem/se_translating_port_proxy.hh M src/sim/SConscript M src/sim/faults.cc A src/sim/mem_state.cc M src/sim/mem_state.hh R src/sim/mem_state_impl.hh M src/sim/process.cc M src/sim/process.hh M src/sim/syscall_emul.hh 40 files changed, 893 insertions(+), 385 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12306 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I5e6afecbd47e9c46998c4d6a1091d1f4fb698a71 Gerrit-Change-Number: 12306 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add a pseudo-filesystem
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12119 ) Change subject: sim-se: add a pseudo-filesystem .. sim-se: add a pseudo-filesystem This change introduce the concept of a pseudo-filesystem in gem5. The pseudo-filesystm works by creating a directory structure in m5out (or whichever output dir the user specifies) that system calls may be redirected to. This is useful for cases where SE mode would introduce some non-determinism due to reading files with varying path names (e.g., variation from run to run if your gem5 job is scheduled on a cluster where paths may change). It is also useful for opening files that have information specific to the host CPU, such as cache hierarchy or CPU information. This is useful when running runtimes in SE mode in the absence of a real OS kernel since many runtime layers provide system-level services to user space applications. Change-Id: I90821b3b403168b904a662fa98b85def1628621c --- A configs/common/FileSystemConfig.py M configs/common/Options.py M configs/example/se.py M src/kern/linux/linux.cc A src/sim/RedirectPath.py M src/sim/SConscript M src/sim/System.py M src/sim/process.cc M src/sim/process.hh A src/sim/redirect_path.cc A src/sim/redirect_path.hh M src/sim/syscall_emul.cc M src/sim/syscall_emul.hh M src/sim/system.cc M src/sim/system.hh 15 files changed, 593 insertions(+), 96 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12119 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I90821b3b403168b904a662fa98b85def1628621c Gerrit-Change-Number: 12119 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Andreas Sandberg Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: arch-arm, sim-se: cleanup arm auxv fields
Hello Nikos Nikoleris, Giacomo Travaglini, Andreas Sandberg, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12118 to look at the new patch set (#9). Change subject: arch-arm, sim-se: cleanup arm auxv fields .. arch-arm, sim-se: cleanup arm auxv fields Change-Id: Ib4047dd3bd51ce0d0ac71d802b16085ba040e9bd --- M src/arch/arm/process.cc 1 file changed, 60 insertions(+), 62 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12118 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib4047dd3bd51ce0d0ac71d802b16085ba040e9bd Gerrit-Change-Number: 12118 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Brandon Potter Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Nikos Nikoleris Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: fix a few bugs/warns from GCC 6
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12126 ) Change subject: sim-se: fix a few bugs/warns from GCC 6 .. sim-se: fix a few bugs/warns from GCC 6 Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 --- M src/sim/syscall_emul.cc 1 file changed, 4 insertions(+), 6 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12126 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib2ad860324fd234b23262d141be3e82628ff61f0 Gerrit-Change-Number: 12126 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: use DPRINTF_SYSCALL for ioctl/wait4
Hello Jason Lowe-Power, Alexandru Duțu, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12124 to look at the new patch set (#9). Change subject: sim-se: use DPRINTF_SYSCALL for ioctl/wait4 .. sim-se: use DPRINTF_SYSCALL for ioctl/wait4 Change-Id: I4fbaf1a0653f13ae964a2574cc26bbaac2dc0686 --- M src/sim/syscall_emul.hh 1 file changed, 3 insertions(+), 4 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12124 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I4fbaf1a0653f13ae964a2574cc26bbaac2dc0686 Gerrit-Change-Number: 12124 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Alexandru Duțu Gerrit-Reviewer: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: add socket ioctls
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12123 ) Change subject: sim-se: add socket ioctls .. sim-se: add socket ioctls The OpenMPI 1.8.2 runtime needs the ioctl code included in this patch to issue socket operations on the host machine. Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d --- M src/sim/syscall_emul.hh 1 file changed, 53 insertions(+), 10 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12123 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I687b31f375a846f0bab2debd9b9472605a4d2c7d Gerrit-Change-Number: 12123 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: use pseudo fs with classic mem se mode
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12120 ) Change subject: configs: use pseudo fs with classic mem se mode .. configs: use pseudo fs with classic mem se mode These changes are needed so that the config scripts can report cache hierarchy information to the pseudo file-system. This is useful for the ROCm runtime when it reads special files about the HW from /proc/. Change-Id: I51af4d41c49dcf719a4a540346fe3e17b2eb95f7 --- M configs/common/CacheConfig.py M configs/example/se.py 2 files changed, 37 insertions(+), 3 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12120 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I51af4d41c49dcf719a4a540346fe3e17b2eb95f7 Gerrit-Change-Number: 12120 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-CC: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: configs: use pseudo fs with ruby memory in se mode
Brandon Potter has uploaded a new patch set (#9). ( https://gem5-review.googlesource.com/c/public/gem5/+/12121 ) Change subject: configs: use pseudo fs with ruby memory in se mode .. configs: use pseudo fs with ruby memory in se mode These changes are needed so that the config scripts can report cache hierarchy information to the pseudo file-system. This is useful for the ROCm runtime when it reads special files about the HW from /proc/. Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b --- M configs/ruby/MESI_Three_Level.py M configs/ruby/MESI_Two_Level.py M configs/ruby/MI_example.py M configs/ruby/MOESI_CMP_directory.py M configs/ruby/MOESI_CMP_token.py M configs/ruby/MOESI_hammer.py M configs/ruby/Ruby.py M configs/topologies/BaseTopology.py M configs/topologies/Cluster.py M configs/topologies/Crossbar.py M configs/topologies/CrossbarGarnet.py M configs/topologies/MeshDirCorners_XY.py M configs/topologies/Mesh_XY.py M configs/topologies/Mesh_westfirst.py M configs/topologies/Pt2Pt.py 15 files changed, 231 insertions(+), 10 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12121 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Iad3e6c088d47c9b93979f584de748367eae8259b Gerrit-Change-Number: 12121 Gerrit-PatchSet: 9 Gerrit-Owner: Brandon Potter Gerrit-CC: Giacomo Travaglini Gerrit-CC: Jason Lowe-Power Gerrit-CC: Nikos Nikoleris Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: cleanup architecture specific auxv
Hello Nikos Nikoleris, Giacomo Travaglini, Andreas Sandberg, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/12118 to look at the new patch set (#8). Change subject: sim-se: cleanup architecture specific auxv .. sim-se: cleanup architecture specific auxv Change-Id: Ib4047dd3bd51ce0d0ac71d802b16085ba040e9bd --- M src/arch/arm/process.cc 1 file changed, 60 insertions(+), 62 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12118 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ib4047dd3bd51ce0d0ac71d802b16085ba040e9bd Gerrit-Change-Number: 12118 Gerrit-PatchSet: 8 Gerrit-Owner: Brandon Potter Gerrit-Reviewer: Andreas Sandberg Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Nikos Nikoleris Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: sim-se: move members of Process to MemState
Brandon Potter has uploaded a new patch set (#6). ( https://gem5-review.googlesource.com/c/public/gem5/+/12306 ) Change subject: sim-se: move members of Process to MemState .. sim-se: move members of Process to MemState This changeset moves memory-related functionality from the Process class to the MemState class. The goal is to create an object to manage the memory for Syscall Emulation Mode; ideally, that object has as much cohesion as possible. Change-Id: I5e6afecbd47e9c46998c4d6a1091d1f4fb698a71 --- M src/arch/alpha/faults.cc M src/arch/alpha/process.cc M src/arch/alpha/process.hh M src/arch/arm/linux/process.cc M src/arch/arm/process.cc M src/arch/arm/remote_gdb.cc M src/arch/arm/tlb.cc M src/arch/generic/tlb.cc M src/arch/mips/process.cc M src/arch/mips/remote_gdb.cc M src/arch/mips/tlb.cc M src/arch/power/process.cc M src/arch/power/remote_gdb.cc M src/arch/power/tlb.cc M src/arch/riscv/process.cc M src/arch/riscv/process.hh M src/arch/riscv/remote_gdb.cc M src/arch/riscv/tlb.cc M src/arch/sparc/faults.cc M src/arch/sparc/process.cc M src/arch/sparc/process.hh M src/arch/sparc/remote_gdb.cc M src/arch/x86/process.cc M src/arch/x86/process.hh M src/arch/x86/remote_gdb.cc M src/arch/x86/tlb.cc M src/cpu/thread_context.hh M src/gpu-compute/compute_unit.cc M src/gpu-compute/gpu_tlb.cc M src/gpu-compute/shader.cc M src/mem/se_translating_port_proxy.cc M src/mem/se_translating_port_proxy.hh M src/sim/SConscript M src/sim/faults.cc A src/sim/mem_state.cc M src/sim/mem_state.hh R src/sim/mem_state_impl.hh M src/sim/process.cc M src/sim/process.hh M src/sim/syscall_emul.hh 40 files changed, 893 insertions(+), 385 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/12306 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: I5e6afecbd47e9c46998c4d6a1091d1f4fb698a71 Gerrit-Change-Number: 12306 Gerrit-PatchSet: 6 Gerrit-Owner: Brandon Potter Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev