aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2022-10-26 18:03:16 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-10-26 18:03:16 +0000
commitebbcdf7d41ca24ac6618323ef594fec3372744c5 (patch)
tree1f9a6078a5af7e2b4835823812c1a47f69c42d30
parenta99a76cfe180577a3a4f5e0ecbc3025057d6f6bd (diff)
parenta1ea109f9bd3241d162e93d551896e98de3148e3 (diff)
downloadOpenCSD-ebbcdf7d41ca24ac6618323ef594fec3372744c5.tar.gz
Update OpenCSD to v1.3.2 am: 815cee34eb am: c56998bb8e am: a1ea109f9b
Original change: https://android-review.googlesource.com/c/platform/external/OpenCSD/+/2270111 Change-Id: I76199779d0894aa6c385d8e7a0a93c814d4a3915 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--METADATA6
-rw-r--r--README.md22
-rw-r--r--decoder/docs/doxygen_config.dox2
-rw-r--r--decoder/include/common/trc_pkt_decode_base.h9
-rw-r--r--decoder/include/interfaces/trc_pkt_raw_in_i.h2
-rw-r--r--decoder/include/interfaces/trc_tgt_mem_access_i.h8
-rw-r--r--decoder/include/mem_acc/trc_mem_acc_mapper.h2
-rw-r--r--decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h5
-rw-r--r--decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h2
-rw-r--r--decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h1
-rw-r--r--decoder/include/opencsd/ocsd_if_types.h6
-rw-r--r--decoder/include/opencsd/ocsd_if_version.h6
-rw-r--r--decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp37
-rw-r--r--decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp31
-rw-r--r--decoder/source/i_dec/trc_idec_arminst.cpp9
-rw-r--r--decoder/source/mem_acc/trc_mem_acc_mapper.cpp8
-rw-r--r--decoder/source/trc_gen_elem.cpp9
-rwxr-xr-xdecoder/tests/run_pkt_decode_tests-ete.bash2
-rw-r--r--decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h1
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/ETE_0_s1.ini15
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/OTHERS_execbin0 -> 462720 bytes
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/TEST_NON_DET_CODE_execbin0 -> 72 bytes
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/VAL_NON_DET_CODE_execbin0 -> 127768 bytes
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/leafBlock_EL3_0_l1_0_l2_0_l3_256_0_execbin0 -> 125320 bytes
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/checker_metadata.ini7
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/cpu_0.ini32
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/session1.binbin0 -> 33 bytes
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/snapshot.ini11
-rw-r--r--decoder/tests/snapshots-ete/ete-bc-instr/trace.ini15
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/ETE_0_s1.ini15
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/OTHERS_execbin0 -> 118904 bytes
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/TEST_NON_DET_CODE_execbin0 -> 332 bytes
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_NON_DET_CODE_execbin0 -> 134500 bytes
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_TEST_CODE_execbin0 -> 198880 bytes
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/cpu_0.ini32
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/session1.binbin0 -> 1793 bytes
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/snapshot.ini10
-rw-r--r--decoder/tests/snapshots-ete/ts_bit64_set/trace.ini16
38 files changed, 285 insertions, 36 deletions
diff --git a/METADATA b/METADATA
index 256f7cb..484f795 100644
--- a/METADATA
+++ b/METADATA
@@ -9,11 +9,11 @@ third_party {
type: GIT
value: "https://github.com/Linaro/OpenCSD.git"
}
- version: "v1.2.0"
+ version: "v1.3.2"
license_type: RESTRICTED
last_upgrade_date {
- year: 2021
+ year: 2022
month: 10
- day: 13
+ day: 26
}
}
diff --git a/README.md b/README.md
index 97b32ed..c0b402c 100644
--- a/README.md
+++ b/README.md
@@ -27,11 +27,11 @@ Releases will appear on the master branch in the git repository with an appropri
CoreSight Trace Component Support.
----------------------------------
-_Current Version 1.2.0_
+_Current Version 1.3.2_
### Current support:
-- ETE (v1.1) instruction trace - packet processing and packet decode.
+- ETE (v1.2) instruction trace - packet processing and packet decode.
- ETMv4 (v4.6 [A/R profile] v4.4 [M profile]) instruction trace - packet processing and packet decode.
- PTM (v1.1) instruction trace - packet processing and packet decode.
- ETMv3 (v3.5) instruction trace - packet processing and packet decode.
@@ -258,6 +258,24 @@ Version and Modification Information
- __Bugfix__: Remove noisy printf (James Clark)
- __Bugfix__: Fix documentation issues (github issues #39 & #40 from rbresalier)
+- _Version 1.2.1_:
+ - __Bugfix__: ETM4x / ETE - output of context elements to client can in some circumstances
+ be delayed until after subsequent atoms have been processed leading to incorrect
+ memory decode access via the client callbacks.
+ Fixed to flush context elements immediately they are committed.
+
+- _Version 1.3.0_:
+ - __Admin__: Dev versions now have patch versions at least +100 from root public version
+ - __Update__: Add support for conditional branch (BC.cond) introduced for v8.8 / v9.3 architecture.
+ - __Update__: ETE: Add support for NSE bit - security state bit defining Root / Realm states in FEAT_RME.
+
+- _Version 1.3.1_:
+ - __Bugfix__: Add header file in snapshot parser - fix build for certain libc++ libs (github issue #43 from manojgupta)
+ - __Bugfix__: Fix typo in comment (github issue #42 from nothatDinger)
+
+- _Version 1.3.2_:
+ - __Bugfix__: ETM4x / ETE - 64 bit timestamp value - MS bit incorrectly masked to 1b0 during extraction from packet.
+
Licence Information
===================
diff --git a/decoder/docs/doxygen_config.dox b/decoder/docs/doxygen_config.dox
index 6d2f02c..a5da45d 100644
--- a/decoder/docs/doxygen_config.dox
+++ b/decoder/docs/doxygen_config.dox
@@ -38,7 +38,7 @@ PROJECT_NAME = "OpenCSD - CoreSight Trace Decode Library"
# could be handy for archiving the generated documentation or if some version
# control system is used.
-PROJECT_NUMBER = 1.2.0
+PROJECT_NUMBER = 1.3.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
diff --git a/decoder/include/common/trc_pkt_decode_base.h b/decoder/include/common/trc_pkt_decode_base.h
index da70206..24ea2b0 100644
--- a/decoder/include/common/trc_pkt_decode_base.h
+++ b/decoder/include/common/trc_pkt_decode_base.h
@@ -96,6 +96,7 @@ protected:
/* target access */
ocsd_err_t accessMemory(const ocsd_vaddr_t address, const ocsd_mem_space_acc_t mem_space, uint32_t *num_bytes, uint8_t *p_buffer);
+ ocsd_err_t invalidateMemAccCache();
/* instruction decode */
ocsd_err_t instrDecode(ocsd_instr_info *instr_info);
@@ -180,6 +181,14 @@ inline ocsd_err_t TrcPktDecodeI::accessMemory(const ocsd_vaddr_t address, const
return OCSD_ERR_DCD_INTERFACE_UNUSED;
}
+inline ocsd_err_t TrcPktDecodeI::invalidateMemAccCache()
+{
+ if (!m_uses_memaccess)
+ return OCSD_ERR_DCD_INTERFACE_UNUSED;
+ m_mem_access.first()->InvalidateMemAccCache(getCoreSightTraceID());
+ return OCSD_OK;
+}
+
/**********************************************************************/
template <class P, class Pc>
class TrcPktDecodeBase : public TrcPktDecodeI, public IPktDataIn<P>
diff --git a/decoder/include/interfaces/trc_pkt_raw_in_i.h b/decoder/include/interfaces/trc_pkt_raw_in_i.h
index 6f7b213..dfa7e05 100644
--- a/decoder/include/interfaces/trc_pkt_raw_in_i.h
+++ b/decoder/include/interfaces/trc_pkt_raw_in_i.h
@@ -47,7 +47,7 @@
*
* This interface provides a monitor point for the packet processor block.
* The templated interface is called with a complete packet of the given
- * type, plus the raw packet bytes. Use for tools which need to display compplete
+ * type, plus the raw packet bytes. Use for tools which need to display complete
* packets or require additional processing on raw packet data.
*
* This interface is not part of the data decode path and cannot provide feedback.
diff --git a/decoder/include/interfaces/trc_tgt_mem_access_i.h b/decoder/include/interfaces/trc_tgt_mem_access_i.h
index effc9b5..68a4e10 100644
--- a/decoder/include/interfaces/trc_tgt_mem_access_i.h
+++ b/decoder/include/interfaces/trc_tgt_mem_access_i.h
@@ -83,6 +83,14 @@ public:
const ocsd_mem_space_acc_t mem_space,
uint32_t *num_bytes,
uint8_t *p_buffer) = 0;
+
+ /*!
+ * Invalidate any caching that the memory accessor functions are using.
+ * Generally called when a memory context changes in the trace.
+ *
+ * @param cs_trace_id : protocol source trace ID.
+ */
+ virtual void InvalidateMemAccCache(const uint8_t cs_trace_id) = 0;
};
diff --git a/decoder/include/mem_acc/trc_mem_acc_mapper.h b/decoder/include/mem_acc/trc_mem_acc_mapper.h
index a700e9d..4a08498 100644
--- a/decoder/include/mem_acc/trc_mem_acc_mapper.h
+++ b/decoder/include/mem_acc/trc_mem_acc_mapper.h
@@ -61,6 +61,8 @@ public:
uint32_t *num_bytes,
uint8_t *p_buffer);
+ virtual void InvalidateMemAccCache(const uint8_t cs_trace_id);
+
// mapper memory area configuration interface
// add an accessor to this map
diff --git a/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h b/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
index 8ee7087..22f39d9 100644
--- a/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
+++ b/decoder/include/opencsd/etmv4/trc_pkt_elem_etmv4i.h
@@ -145,7 +145,7 @@ public:
void setCondRF3(const uint16_t tokens);
void setCondRF4(const uint8_t token);
- void setContextInfo(const bool update, const uint8_t EL = 0, const uint8_t NS = 0, const uint8_t SF = 0);
+ void setContextInfo(const bool update, const uint8_t EL = 0, const uint8_t NS = 0, const uint8_t SF = 0, const uint8_t NSE = 0);
void setContextVMID(const uint32_t VMID);
void setContextCID(const uint32_t CID);
@@ -416,7 +416,7 @@ inline void EtmV4ITrcPacket::setCondRF4(const uint8_t token)
cond_result.f2f4_token = token;
}
-inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL, const uint8_t NS, const uint8_t SF)
+inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL, const uint8_t NS, const uint8_t SF, const uint8_t NSE)
{
pkt_valid.bits.context_valid = 1;
if(update)
@@ -425,6 +425,7 @@ inline void EtmV4ITrcPacket::setContextInfo(const bool update, const uint8_t EL,
context.EL = EL;
context.NS = NS;
context.SF = SF;
+ context.NSE = NSE;
}
}
diff --git a/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h b/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h
index 45f8810..19388c3 100644
--- a/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h
+++ b/decoder/include/opencsd/etmv4/trc_pkt_proc_etmv4i.h
@@ -181,7 +181,7 @@ private:
void iPktInvalidCfg(const uint8_t lastByte); // packet invalid in current config.
unsigned extractContField(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint32_t &value, const unsigned byte_limit = 5);
- unsigned extractContField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value, const unsigned byte_limit = 9);
+ unsigned extractTSField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value);
unsigned extractCondResult(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint32_t& key, uint8_t &result);
void extractAndSetContextInfo(const std::vector<uint8_t> &buffer, const int st_idx);
int extract64BitLongAddr(const std::vector<uint8_t> &buffer, const int st_idx, const uint8_t IS, uint64_t &value);
diff --git a/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h b/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h
index dd241a0..38963d1 100644
--- a/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h
+++ b/decoder/include/opencsd/etmv4/trc_pkt_types_etmv4.h
@@ -184,6 +184,7 @@ typedef struct _etmv4_context_t {
uint32_t updated:1; //!< updated this context packet (otherwise same as last time)
uint32_t updated_c:1; //!< updated CtxtID
uint32_t updated_v:1; //!< updated VMID
+ uint32_t NSE:1; //!< PE FEAT_RME: root / realm indicator
};
uint32_t ctxtID; //!< Current ctxtID
uint32_t VMID; //!< current VMID
diff --git a/decoder/include/opencsd/ocsd_if_types.h b/decoder/include/opencsd/ocsd_if_types.h
index 5628fec..f5ff6ac 100644
--- a/decoder/include/opencsd/ocsd_if_types.h
+++ b/decoder/include/opencsd/ocsd_if_types.h
@@ -338,8 +338,10 @@ typedef enum _ocsd_isa
*/
typedef enum _ocsd_sec_level
{
- ocsd_sec_secure, /**< Core is in secure state */
- ocsd_sec_nonsecure /**< Core is in non-secure state */
+ ocsd_sec_secure, /**< Core is in secure state */
+ ocsd_sec_nonsecure, /**< Core is in non-secure state */
+ ocsd_sec_root, /**< PE FEAT_RME: Core is in root state. */
+ ocsd_sec_realm, /**< PE FEAT_RME: Core is in realm state. */
} ocsd_sec_level ;
/** Exception level type
diff --git a/decoder/include/opencsd/ocsd_if_version.h b/decoder/include/opencsd/ocsd_if_version.h
index d6f5849..9e7ecf1 100644
--- a/decoder/include/opencsd/ocsd_if_version.h
+++ b/decoder/include/opencsd/ocsd_if_version.h
@@ -43,8 +43,8 @@
/** @name Library Versioning
@{*/
#define OCSD_VER_MAJOR 0x1 /**< Library Major Version */
-#define OCSD_VER_MINOR 0x2 /**< Library Minor Version */
-#define OCSD_VER_PATCH 0x0 /**< Library Patch Version */
+#define OCSD_VER_MINOR 0x3 /**< Library Minor Version */
+#define OCSD_VER_PATCH 0x2 /**< Library Patch Version */
/** Library version number - MMMMnnpp format.
MMMM = major version,
@@ -53,7 +53,7 @@
*/
#define OCSD_VER_NUM ((OCSD_VER_MAJOR << 16) | (OCSD_VER_MINOR << 8) | OCSD_VER_PATCH)
-#define OCSD_VER_STRING "1.2.0" /**< Library Version string */
+#define OCSD_VER_STRING "1.3.2" /**< Library Version string */
#define OCSD_LIB_NAME "OpenCSD Library" /**< Library name string */
#define OCSD_LIB_SHORT_NAME "OCSD" /**< Library Short name string */
/** @}*/
diff --git a/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp b/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp
index 015a2f5..a9b059a 100644
--- a/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp
+++ b/decoder/source/etmv4/trc_pkt_decode_etmv4i.cpp
@@ -664,14 +664,18 @@ ocsd_datapath_resp_t TrcPktDecodeEtmV4I::resolveElements()
if (m_elem_res.P0_commit)
err = commitElements();
- if (!err && m_elem_res.P0_cancel)
- err = cancelElements();
+ // allow for early flush on context element
+ if (!m_elem_res.P0_commit) {
- if (!err && m_elem_res.mispredict)
- err = mispredictAtom();
-
- if (!err && m_elem_res.discard)
- err = discardElements();
+ if (!err && m_elem_res.P0_cancel)
+ err = cancelElements();
+
+ if (!err && m_elem_res.mispredict)
+ err = mispredictAtom();
+
+ if (!err && m_elem_res.discard)
+ err = discardElements();
+ }
if (err != OCSD_OK)
resp = OCSD_RESP_FATAL_INVALID_DATA;
@@ -706,10 +710,11 @@ ocsd_err_t TrcPktDecodeEtmV4I::commitElements()
int num_commit_req = m_elem_res.P0_commit;
ocsd_trc_index_t err_idx = 0;
TrcStackElem *pElem = 0; // stacked element pointer
+ bool contextFlush = false;
err = m_out_elem.resetElemStack();
- while(m_elem_res.P0_commit && !err)
+ while(m_elem_res.P0_commit && !err && !contextFlush)
{
if (m_P0_stack.size() > 0)
{
@@ -751,8 +756,17 @@ ocsd_err_t TrcPktDecodeEtmV4I::commitElements()
if(ctxt.updated)
{
err = m_out_elem.addElem(pElem->getRootIndex());
- if (!err)
+ if (!err) {
updateContext(pCtxtElem, outElem());
+
+ // updated context - need to force this to be output to the client so correct memory
+ // context can be used.
+ contextFlush = true;
+
+ // invalidate memory accessor cacheing - force next memory access out to client to
+ // ensure that the correct memory context is in play when decoding subsequent atoms.
+ invalidateMemAccCache();
+ }
}
}
}
@@ -1858,7 +1872,10 @@ void TrcPktDecodeEtmV4I::updateContext(TrcStackElemCtxt *pCtxtElem, OcsdTraceEle
m_is_64bit = (ctxt.SF != 0);
elem.context.bits64 = ctxt.SF;
m_is_secure = (ctxt.NS == 0);
- elem.context.security_level = ctxt.NS ? ocsd_sec_nonsecure : ocsd_sec_secure;
+ if (ctxt.NSE)
+ elem.context.security_level = ctxt.NS ? ocsd_sec_realm : ocsd_sec_root;
+ else
+ elem.context.security_level = ctxt.NS ? ocsd_sec_nonsecure : ocsd_sec_secure;
elem.context.exception_level = (ocsd_ex_level)ctxt.EL;
elem.context.el_valid = 1;
if(ctxt.updated_c)
diff --git a/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp b/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp
index 07b372c..d0573d6 100644
--- a/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp
+++ b/decoder/source/etmv4/trc_pkt_proc_etmv4i.cpp
@@ -522,8 +522,11 @@ void TrcPktProcEtmV4I::iPktTimestamp(const uint8_t lastByte)
{
int idx = 1;
uint64_t tsVal;
- int ts_bytes = extractContField64(m_currPacketData, idx, tsVal);
- int ts_bits = ts_bytes < 7 ? ts_bytes * 7 : 64;
+ int ts_bytes = extractTSField64(m_currPacketData, idx, tsVal);
+ int ts_bits;
+
+ // if ts_bytes 8 or less, then cont bits on each byte, otherwise full 64 bit value for 9 bytes
+ ts_bits = ts_bytes < 9 ? ts_bytes * 7 : 64;
if(!m_curr_packet.pkt_valid.bits.ts_valid && m_first_trace_info)
ts_bits = 64; // after trace info, missing bits are all 0.
@@ -872,7 +875,7 @@ void TrcPktProcEtmV4I::extractAndSetContextInfo(const std::vector<uint8_t> &buff
// on input, buffer index points at the info byte - always present
uint8_t infoByte = m_currPacketData[st_idx];
- m_curr_packet.setContextInfo(true, (infoByte & 0x3), (infoByte >> 5) & 0x1, (infoByte >> 4) & 0x1);
+ m_curr_packet.setContextInfo(true, (infoByte & 0x3), (infoByte >> 5) & 0x1, (infoByte >> 4) & 0x1, (infoByte >> 3) & 0x1);
// see if there are VMID and CID bytes, and how many.
int nVMID_bytes = ((infoByte & 0x40) == 0x40) ? (m_config.vmidSize()/8) : 0;
@@ -1653,20 +1656,33 @@ void TrcPktProcEtmV4I::BuildIPacketTable()
return idx;
}
-unsigned TrcPktProcEtmV4I::extractContField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value, const unsigned byte_limit /*= 9*/)
+unsigned TrcPktProcEtmV4I::extractTSField64(const std::vector<uint8_t> &buffer, const unsigned st_idx, uint64_t &value)
{
+ const unsigned max_byte_idx = 8; /* the 9th byte, index 8, will use full 8 bits for value */
unsigned idx = 0;
bool lastByte = false;
uint8_t byteVal;
+ uint8_t byteValMask = 0x7f;
+
+ /* init value */
value = 0;
- while(!lastByte && (idx < byte_limit)) // max 9 bytes for 64 bit value;
+ while(!lastByte) // max 9 bytes for 64 bit value;
{
if(buffer.size() > (st_idx + idx))
{
// each byte has seven bits + cont bit
byteVal = buffer[(st_idx + idx)];
- lastByte = (byteVal & 0x80) != 0x80;
- value |= ((uint64_t)(byteVal & 0x7F)) << (idx * 7);
+
+ /* detect the final byte - which uses full 8 bits as value */
+ if (idx == max_byte_idx)
+ {
+ byteValMask = 0xFF; /* last byte of 9, no cont bit */
+ lastByte = true;
+ }
+ else
+ lastByte = (byteVal & 0x80) != 0x80;
+
+ value |= ((uint64_t)(byteVal & byteValMask)) << (idx * 7);
idx++;
}
else
@@ -1674,6 +1690,7 @@ unsigned TrcPktProcEtmV4I::extractContField64(const std::vector<uint8_t> &buffer
throwBadSequenceError("Invalid 64 bit continuation fields in packet");
}
}
+ // index is the count of bytes used here.
return idx;
}
diff --git a/decoder/source/i_dec/trc_idec_arminst.cpp b/decoder/source/i_dec/trc_idec_arminst.cpp
index 58450ee..76951fd 100644
--- a/decoder/source/i_dec/trc_idec_arminst.cpp
+++ b/decoder/source/i_dec/trc_idec_arminst.cpp
@@ -244,8 +244,9 @@ int inst_A64_is_direct_branch_link(uint32_t inst, uint8_t *is_link, struct decod
int is_direct_branch = 1;
if ((inst & 0x7c000000) == 0x34000000) {
/* CB, TB */
- } else if ((inst & 0xff000010) == 0x54000000) {
+ } else if ((inst & 0xff000000) == 0x54000000) {
/* B<cond> */
+ /* BC<cond> 8.8 / 9.3 arch - bit 4 = 1'b1 */
} else if ((inst & 0x7c000000) == 0x14000000) {
/* B, BL imm */
if (inst & 0x80000000) {
@@ -414,8 +415,9 @@ int inst_A64_branch_destination(uint64_t addr, uint32_t inst, uint64_t *pnpc)
{
uint64_t npc;
int is_direct_branch = 1;
- if ((inst & 0xff000010) == 0x54000000) {
+ if ((inst & 0xff000000) == 0x54000000) {
/* B<cond> */
+ /* BC<cond> */
npc = addr + ((int32_t)((inst & 0x00ffffe0) << 8) >> 11);
} else if ((inst & 0x7c000000) == 0x14000000) {
/* B, BL imm */
@@ -568,8 +570,9 @@ int inst_A64_is_conditional(uint32_t inst)
if ((inst & 0x7c000000) == 0x34000000) {
/* CB, TB */
return 1;
- } else if ((inst & 0xff000010) == 0x54000000) {
+ } else if ((inst & 0xff000000) == 0x54000000) {
/* B.cond */
+ /* BC.cond */
return 1;
}
return 0;
diff --git a/decoder/source/mem_acc/trc_mem_acc_mapper.cpp b/decoder/source/mem_acc/trc_mem_acc_mapper.cpp
index 53edfe1..dc07a1e 100644
--- a/decoder/source/mem_acc/trc_mem_acc_mapper.cpp
+++ b/decoder/source/mem_acc/trc_mem_acc_mapper.cpp
@@ -119,6 +119,14 @@ ocsd_err_t TrcMemAccMapper::ReadTargetMemory(const ocsd_vaddr_t address, const u
return err;
}
+void TrcMemAccMapper::InvalidateMemAccCache(const uint8_t /* cs_trace_id */)
+{
+ // default mapper does not use cs_trace_id for cache invalidation.
+ if (m_cache.enabled())
+ m_cache.invalidateAll();
+ m_acc_curr = 0;
+}
+
void TrcMemAccMapper::RemoveAllAccessors()
{
TrcMemAccessorBase *pAcc = 0;
diff --git a/decoder/source/trc_gen_elem.cpp b/decoder/source/trc_gen_elem.cpp
index 4c09945..b2e6772 100644
--- a/decoder/source/trc_gen_elem.cpp
+++ b/decoder/source/trc_gen_elem.cpp
@@ -171,7 +171,14 @@ void OcsdTraceElement::toString(std::string &str) const
{
oss << "EL" << std::dec << (int)(context.exception_level);
}
- oss << (context.security_level == ocsd_sec_secure ? "S; " : "N; ") << (context.bits64 ? "64-bit; " : "32-bit; ");
+ switch (context.security_level)
+ {
+ case ocsd_sec_secure: oss << "S; "; break;
+ case ocsd_sec_nonsecure: oss << "N; "; break;
+ case ocsd_sec_root: oss << "Root; "; break;
+ case ocsd_sec_realm: oss << "Realm; "; break;
+ }
+ oss << (context.bits64 ? "64-bit; " : "32-bit; ");
if(context.vmid_valid)
oss << "VMID=0x" << std::hex << context.vmid << "; ";
if(context.ctxt_id_valid)
diff --git a/decoder/tests/run_pkt_decode_tests-ete.bash b/decoder/tests/run_pkt_decode_tests-ete.bash
index 1b8c762..1bf60a5 100755
--- a/decoder/tests/run_pkt_decode_tests-ete.bash
+++ b/decoder/tests/run_pkt_decode_tests-ete.bash
@@ -53,6 +53,7 @@ BIN_DIR=./bin/linux64/rel/
# directories for tests using full decode
declare -a test_dirs_decode=( "001-ack_test"
"002-ack_test_scr"
+ "ete-bc-instr"
"ete_ip"
"ete_mem"
"ete_spec_1"
@@ -67,6 +68,7 @@ declare -a test_dirs_decode=( "001-ack_test"
"tme_test"
"trace_file_cid_vmid"
"trace_file_vmid"
+ "ts_bit64_set"
"ts_marker"
)
diff --git a/decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h b/decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h
index 815afe9..d4fd6cd 100644
--- a/decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h
+++ b/decoder/tests/snapshot_parser_lib/include/snapshot_parser_util.h
@@ -35,6 +35,7 @@
#ifndef ARM_SNAPSHOT_PARSER_UTIL_H_INCLUDED
#define ARM_SNAPSHOT_PARSER_UTIL_H_INCLUDED
+#include <algorithm>
#include <string>
#include <sstream>
#include <iomanip>
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/ETE_0_s1.ini b/decoder/tests/snapshots-ete/ete-bc-instr/ETE_0_s1.ini
new file mode 100644
index 0000000..62661c1
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/ETE_0_s1.ini
@@ -0,0 +1,15 @@
+[device]
+name=ETE_0_s1
+class=trace_source
+type=ETE
+
+
+[regs]
+TRCCONFIGR=0x8001
+TRCTRACEIDR=0x1
+TRCDEVARCH=0x47715a13
+TRCIDR0=0x2881cea1
+TRCIDR1=0x4100fff0
+TRCIDR2=0xd0001088
+TRCIDR8=0x0
+
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/OTHERS_exec b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/OTHERS_exec
new file mode 100644
index 0000000..50abb36
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/OTHERS_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/TEST_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/TEST_NON_DET_CODE_exec
new file mode 100644
index 0000000..ec2e6c0
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/TEST_NON_DET_CODE_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/VAL_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/VAL_NON_DET_CODE_exec
new file mode 100644
index 0000000..c04998a
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/VAL_NON_DET_CODE_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/leafBlock_EL3_0_l1_0_l2_0_l3_256_0_exec b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/leafBlock_EL3_0_l1_0_l2_0_l3_256_0_exec
new file mode 100644
index 0000000..ab8412a
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/bindir_64/leafBlock_EL3_0_l1_0_l2_0_l3_256_0_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/checker_metadata.ini b/decoder/tests/snapshots-ete/ete-bc-instr/checker_metadata.ini
new file mode 100644
index 0000000..3a3291e
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/checker_metadata.ini
@@ -0,0 +1,7 @@
+[trace_source]
+sessions = session1
+
+[session1]
+partnum = 1
+checktype = TRC_CFC_CHECK
+
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/cpu_0.ini b/decoder/tests/snapshots-ete/ete-bc-instr/cpu_0.ini
new file mode 100644
index 0000000..4d52d93
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/cpu_0.ini
@@ -0,0 +1,32 @@
+[device]
+name=cpu_0
+class=core
+type=ARM-AA64
+
+[regs]
+PC(size:64)=0x0
+SP(size:64)=0
+SCTLR_EL1=0x0
+CPSR=0x0
+
+
+[dump1]
+file=bindir_64/OTHERS_exec
+address=0x00060000
+length=0x70f80
+
+[dump2]
+file=bindir_64/leafBlock_EL3_0_l1_0_l2_0_l3_256_0_exec
+address=0x01000000
+length=0x1e988
+
+[dump3]
+file=bindir_64/VAL_NON_DET_CODE_exec
+address=0x00010000
+length=0x1f318
+
+[dump4]
+file=bindir_64/TEST_NON_DET_CODE_exec
+address=0x00050000
+length=0x48
+
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/session1.bin b/decoder/tests/snapshots-ete/ete-bc-instr/session1.bin
new file mode 100644
index 0000000..47dc6e6
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/session1.bin
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/snapshot.ini b/decoder/tests/snapshots-ete/ete-bc-instr/snapshot.ini
new file mode 100644
index 0000000..fae7cd1
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/snapshot.ini
@@ -0,0 +1,11 @@
+[snapshot]
+version=1.0
+description=checker_metadata.ini
+
+[device_list]
+device0=cpu_0.ini
+device1=ETE_0_s1.ini
+
+[trace]
+metadata=trace.ini
+
diff --git a/decoder/tests/snapshots-ete/ete-bc-instr/trace.ini b/decoder/tests/snapshots-ete/ete-bc-instr/trace.ini
new file mode 100644
index 0000000..7e95dab
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ete-bc-instr/trace.ini
@@ -0,0 +1,15 @@
+[trace_buffers]
+buffers=buffer1
+
+[buffer1]
+name=ETB_1
+file=session1.bin
+format=source_data
+
+
+[source_buffers]
+ETE_0_s1=ETB_1
+
+[core_trace_sources]
+cpu_0=ETE_0_s1
+
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/ETE_0_s1.ini b/decoder/tests/snapshots-ete/ts_bit64_set/ETE_0_s1.ini
new file mode 100644
index 0000000..8f11b5b
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/ETE_0_s1.ini
@@ -0,0 +1,15 @@
+[device]
+name=ETE_0_s1
+class=trace_source
+type=ETE
+
+
+[regs]
+TRCCONFIGR=0x8801
+TRCTRACEIDR=0x1
+TRCDEVARCH=0x47735a13
+TRCIDR0=0x28c1cea1
+TRCIDR1=0x4100fff0
+TRCIDR2=0xd0001088
+TRCIDR8=0x0
+
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/OTHERS_exec b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/OTHERS_exec
new file mode 100644
index 0000000..6e7f30b
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/OTHERS_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/TEST_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/TEST_NON_DET_CODE_exec
new file mode 100644
index 0000000..a3cbd81
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/TEST_NON_DET_CODE_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_NON_DET_CODE_exec b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_NON_DET_CODE_exec
new file mode 100644
index 0000000..76475cf
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_NON_DET_CODE_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_TEST_CODE_exec b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_TEST_CODE_exec
new file mode 100644
index 0000000..7b985e1
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/bindir_64/VAL_TEST_CODE_exec
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/cpu_0.ini b/decoder/tests/snapshots-ete/ts_bit64_set/cpu_0.ini
new file mode 100644
index 0000000..a3104eb
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/cpu_0.ini
@@ -0,0 +1,32 @@
+[device]
+name=cpu_0
+class=core
+type=ARM-AA64
+
+[regs]
+PC(size:64)=0x0
+SP(size:64)=0
+SCTLR_EL1=0x0
+CPSR=0x0
+
+
+[dump1]
+file=bindir_64/OTHERS_exec
+address=0x00060000
+length=0x1d078
+
+[dump2]
+file=bindir_64/VAL_TEST_CODE_exec
+address=0x01000000
+length=0x308e0
+
+[dump3]
+file=bindir_64/VAL_NON_DET_CODE_exec
+address=0x00010000
+length=0x20d64
+
+[dump4]
+file=bindir_64/TEST_NON_DET_CODE_exec
+address=0x00050000
+length=0x14c
+
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/session1.bin b/decoder/tests/snapshots-ete/ts_bit64_set/session1.bin
new file mode 100644
index 0000000..85074d9
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/session1.bin
Binary files differ
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/snapshot.ini b/decoder/tests/snapshots-ete/ts_bit64_set/snapshot.ini
new file mode 100644
index 0000000..1696312
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/snapshot.ini
@@ -0,0 +1,10 @@
+[snapshot]
+version=1.0
+
+[device_list]
+device0=cpu_0.ini
+device1=ETE_0_s1.ini
+
+[trace]
+metadata=trace.ini
+
diff --git a/decoder/tests/snapshots-ete/ts_bit64_set/trace.ini b/decoder/tests/snapshots-ete/ts_bit64_set/trace.ini
new file mode 100644
index 0000000..11e1171
--- /dev/null
+++ b/decoder/tests/snapshots-ete/ts_bit64_set/trace.ini
@@ -0,0 +1,16 @@
+[trace_buffers]
+buffers=buffer1
+
+[buffer1]
+name=ETB_1
+file=session1.bin
+format=source_data
+
+
+
+[source_buffers]
+ETE_0_s1=ETB_1
+
+[core_trace_sources]
+cpu_0=ETE_0_s1
+