Skip to content

Commit

Permalink
Create more space in base image by switching trace to debug and small…
Browse files Browse the repository at this point in the history
…er printk

Change-Id: I5bdb3487d202f8713b543cbdda6d8103ad39807a
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/41186
Reviewed-by: Martin Gloff <mgloff@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: William G. Hoffa <wghoffa@us.ibm.com>
  • Loading branch information
Stephen Cprek authored and wghoffa committed Jun 1, 2017
1 parent f0cce8d commit 3cbec65
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 44 deletions.
16 changes: 9 additions & 7 deletions src/include/kernel/console.H
Expand Up @@ -5,7 +5,9 @@
/* */
/* OpenPOWER HostBoot Project */
/* */
/* COPYRIGHT International Business Machines Corp. 2010,2014 */
/* Contributors Listed Below - COPYRIGHT 2010,2017 */
/* [+] International Business Machines Corp. */
/* */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); */
/* you may not use this file except in compliance with the License. */
Expand Down Expand Up @@ -40,18 +42,18 @@ void printk(const char*, ...) FORMAT_PRINTF;
class Console : public Util::ConsoleBufferInterface
{
public:
int putc(int);
int putc(int);
size_t operator()(int c) { return putc(c); };

enum { BUFFER_SIZE = 1024 * 16 };
enum { BUFFER_SIZE = 1024 * 12 };

protected:
Console();
~Console() {};
Console();
~Console() {};

private:
size_t iv_pos;
char * iv_buffer;
size_t iv_pos;
char * iv_buffer;
};

extern char kernel_printk_buffer[Console::BUFFER_SIZE];
Expand Down
8 changes: 4 additions & 4 deletions src/usr/pnor/pnor_common.C
Expand Up @@ -138,7 +138,7 @@ errlHndl_t PNOR::parseTOC( uint8_t* i_tocBuffer,SectionData_t * o_TOC)
uint32_t l_errCode = 0;
ffs_hdr* l_ffs_hdr = NULL;

TRACFCOMP(g_trac_pnor, "PNOR::parseTOC verifying TOC");
TRACDCOMP(g_trac_pnor, "PNOR::parseTOC verifying TOC");

PNOR::checkForNullBuffer(i_tocBuffer, l_errCode, l_ffs_hdr);
//Check if the buffer is null
Expand Down Expand Up @@ -229,7 +229,7 @@ errlHndl_t PNOR::parseTOC( uint8_t* i_tocBuffer,SectionData_t * o_TOC)
break;
}

TRACFCOMP(g_trac_pnor, "PNOR::parseTOC: FFS Block size=0x%.8X,"
TRACDCOMP(g_trac_pnor, "PNOR::parseTOC: FFS Block size=0x%.8X,"
" Partition Table Size = 0x%.8x, entry_count=%d",
l_ffs_hdr->block_size,l_ffs_hdr->size,l_ffs_hdr->entry_count);

Expand Down Expand Up @@ -286,12 +286,12 @@ errlHndl_t PNOR::parseTOC( uint8_t* i_tocBuffer,SectionData_t * o_TOC)
continue;
}

TRACFCOMP(g_trac_pnor,"PNOR::parseTOC: User Data %s",
TRACUCOMP(g_trac_pnor,"PNOR::parseTOC: User Data %s",
cur_entry->name);

if (o_TOC[l_secId].integrity == FFS_INTEG_ECC_PROTECT)
{
TRACFCOMP(g_trac_pnor, "PNOR::TOC: ECC enabled for %s",
TRACUCOMP(g_trac_pnor, "PNOR::TOC: ECC enabled for %s",
cur_entry->name);

}
Expand Down
22 changes: 11 additions & 11 deletions src/usr/pnor/pnorrp.C
Expand Up @@ -262,7 +262,7 @@ iv_TOC_used(TOC_0)
,iv_startupRC(0)
,iv_shutdown_pending(false)
{
TRACFCOMP(g_trac_pnor, "PnorRP::PnorRP> " );
TRACDCOMP(g_trac_pnor, "PnorRP::PnorRP> " );
// setup everything in a separate function
initDaemon();

Expand All @@ -274,7 +274,7 @@ iv_TOC_used(TOC_0)
*/
PnorRP::~PnorRP()
{
TRACFCOMP(g_trac_pnor, "PnorRP::~PnorRP> " );
TRACDCOMP(g_trac_pnor, "PnorRP::~PnorRP> " );

// delete the message queue we created
if( iv_msgQ )
Expand All @@ -284,7 +284,7 @@ PnorRP::~PnorRP()

// should kill the task we spawned, but that isn't needed right now

TRACFCOMP(g_trac_pnor, "< PnorRP::~PnorRP" );
TRACDCOMP(g_trac_pnor, "< PnorRP::~PnorRP" );
}

/**
Expand Down Expand Up @@ -659,7 +659,7 @@ errlHndl_t PnorRP::getSectionInfo( PNOR::SectionId i_section,
*/
errlHndl_t PnorRP::findTOC()
{
TRACFCOMP(g_trac_pnor, ENTER_MRK"PnorRP::findTOC...");
TRACDCOMP(g_trac_pnor, ENTER_MRK"PnorRP::findTOC...");
errlHndl_t l_err = NULL;
do {
const uint32_t l_shiftAmount = 32;
Expand Down Expand Up @@ -756,7 +756,7 @@ errlHndl_t PnorRP::findTOC()
//found at least one TOC
if(l_foundTOC)
{
TRACFCOMP(g_trac_pnor, "findTOC> found at least one toc at 0x%X", l_toc);
TRACDCOMP(g_trac_pnor, "findTOC> found at least one toc at 0x%X", l_toc);

//look for BACKUP_PART and read it
uint64_t l_backupTOC = INVALID_OFFSET;
Expand Down Expand Up @@ -913,7 +913,7 @@ errlHndl_t PnorRP::findTOC()
}
} while (0);

TRACFCOMP(g_trac_pnor, EXIT_MRK"findTOC");
TRACDCOMP(g_trac_pnor, EXIT_MRK"findTOC");
return l_err;
}

Expand Down Expand Up @@ -1132,7 +1132,7 @@ errlHndl_t PnorRP::setSideInfo ()
//char side
iv_side[i].side =(ALIGN_DOWN_X(l_secOffset,32*MEGABYTE) == 0) ? 'A':'B';

TRACFCOMP(g_trac_pnor, "setSideInfo: sideId:%d, isGolden:%d, "
TRACDCOMP(g_trac_pnor, "setSideInfo: sideId:%d, isGolden:%d, "
"isGuardPresent:%d, hasOtherSide:%d, primaryTOC: 0x%x, backupTOC"
":0x%X, HBB:0x%X, MMIO:0x%X",i, iv_side[i].isGolden,
iv_side[i].isGuardPresent,iv_side[i].hasOtherSide,
Expand All @@ -1146,7 +1146,7 @@ errlHndl_t PnorRP::setSideInfo ()
*/
void PnorRP::waitForMessage()
{
TRACFCOMP(g_trac_pnor, "PnorRP::waitForMessage>" );
TRACDCOMP(g_trac_pnor, "PnorRP::waitForMessage>" );

errlHndl_t l_errhdl = NULL;
msg_t* message = NULL;
Expand Down Expand Up @@ -1301,7 +1301,7 @@ void PnorRP::waitForMessage()
}


TRACFCOMP(g_trac_pnor, "< PnorRP::waitForMessage" );
TRACDCOMP(g_trac_pnor, "< PnorRP::waitForMessage" );
}


Expand Down Expand Up @@ -1589,7 +1589,7 @@ errlHndl_t PnorRP::computeSection( uint64_t i_vaddr,

errlHndl_t PnorRP::clearSection(PNOR::SectionId i_section)
{
TRACFCOMP(g_trac_pnor, "PnorRP::clearSection Section id = %d", i_section);
TRACDCOMP(g_trac_pnor, "PnorRP::clearSection Section id = %d", i_section);
errlHndl_t l_errl = NULL;
const uint64_t CLEAR_BYTE = 0xFF;
uint8_t* l_buf = new uint8_t[PAGESIZE];
Expand Down Expand Up @@ -1724,7 +1724,7 @@ errlHndl_t PnorRP::fixECC (PNOR::SectionId i_section)
} while (0);

delete [] l_buffer;
TRACFCOMP(g_trac_pnor, EXIT_MRK"PnorRP::fixECC");
TRACDCOMP(g_trac_pnor, EXIT_MRK"PnorRP::fixECC");
return l_err;
}

Expand Down
31 changes: 15 additions & 16 deletions src/usr/pnor/spnorrp.C
Expand Up @@ -90,7 +90,7 @@ SPnorRP::SPnorRP()
iv_msgQ(NULL)
,iv_startupRC(0)
{
TRACFCOMP(g_trac_pnor, "SPnorRP::SPnorRP> " );
TRACDCOMP(g_trac_pnor, "SPnorRP::SPnorRP> " );
// setup everything in a separate function
initDaemon();

Expand All @@ -102,7 +102,7 @@ iv_msgQ(NULL)
*/
SPnorRP::~SPnorRP()
{
TRACFCOMP(g_trac_pnor, "SPnorRP::~SPnorRP> " );
TRACDCOMP(g_trac_pnor, "SPnorRP::~SPnorRP> " );

// delete the message queue we created
if( iv_msgQ )
Expand All @@ -120,7 +120,7 @@ SPnorRP::~SPnorRP()
delete l_rec;
}

TRACFCOMP(g_trac_pnor, "< SPnorRP::~SPnorRP" );
TRACDCOMP(g_trac_pnor, "< SPnorRP::~SPnorRP" );
}

/**
Expand Down Expand Up @@ -285,10 +285,10 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
if (!l_info.secure)
{
#ifdef CONFIG_SECUREBOOT_BEST_EFFORT
TRACFCOMP(g_trac_pnor,"PNOR::loadSecureSection> called on unsecured section - Best effort policy skipping");
TRACDCOMP(g_trac_pnor,"PNOR::loadSecureSection> called on unsecured section - Best effort policy skipping");
break;
#else
TRACFCOMP(g_trac_pnor,ERR_MRK"PNOR::loadSecureSection> called on "
TRACDCOMP(g_trac_pnor,ERR_MRK"PNOR::loadSecureSection> called on "
"unsecured section");

// TODO securebootp9 revisit this assert code and replace with error log
Expand Down Expand Up @@ -317,7 +317,7 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
// calcluate unsecured address from temp address
uint8_t* l_unsecuredAddr = l_tempAddr - VMM_VADDR_SPNOR_DELTA;

TRACFCOMP(g_trac_pnor,"SPnorRP::verifySections section start address "
TRACDCOMP(g_trac_pnor,"SPnorRP::verifySections section start address "
"in temp space is 0x%.16llX, "
"section start address in unsecured space is 0x%.16llX, "
"l_info.size = 0x%.16llX, "
Expand Down Expand Up @@ -362,7 +362,7 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
// store secure space pointer in load record
o_rec->secAddr = reinterpret_cast<uint8_t*>(l_info.vaddr) + PAGESIZE;

TRACFCOMP(g_trac_pnor,"section start address in secure space is "
TRACDCOMP(g_trac_pnor,"section start address in secure space is "
"0x%.16llX",o_rec->secAddr);

// verify while in temp space
Expand Down Expand Up @@ -436,7 +436,7 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
- PAGESIZE - o_rec->textSize;
if (unprotectedPayloadSize) // only write track a non-zero range
{
TRACFCOMP(g_trac_pnor,INFO_MRK " SPnorRP::verifySections "
TRACDCOMP(g_trac_pnor,INFO_MRK " SPnorRP::verifySections "
"creating unprotected area (%d bytes) for section %s",
unprotectedPayloadSize,
l_info.name);
Expand Down Expand Up @@ -470,7 +470,7 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
"creating unprotected area for section %s",
l_info.name);
}
TRACFCOMP(g_trac_pnor,"SPnorRP::verifySections set permissions "
TRACDCOMP(g_trac_pnor,"SPnorRP::verifySections set permissions "
"and register block complete");
} while(0);

Expand All @@ -482,7 +482,6 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
TRACFCOMP(g_trac_pnor,ERR_MRK"SPnorRP::verifySections there was an error");
if (failedVerify)
{
TRACFCOMP(g_trac_pnor,ERR_MRK"SPnorRP::verifySections failed verify");
SECUREBOOT::handleSecurebootFailure(l_errhdl,false);
}
else
Expand All @@ -502,7 +501,7 @@ uint64_t SPnorRP::verifySections(SectionId i_id, LoadRecord* o_rec)
*/
void SPnorRP::waitForMessage()
{
TRACFCOMP(g_trac_pnor, "SPnorRP::waitForMessage>" );
TRACDCOMP(g_trac_pnor, "SPnorRP::waitForMessage>" );

errlHndl_t l_errhdl = NULL;
msg_t* message = NULL;
Expand Down Expand Up @@ -696,7 +695,7 @@ void SPnorRP::waitForMessage()
assert(message != NULL);
}

TRACFCOMP(g_trac_pnor, "< SPnorRP::waitForMessage" );
TRACDCOMP(g_trac_pnor, "< SPnorRP::waitForMessage" );
}

/**
Expand All @@ -719,7 +718,7 @@ errlHndl_t PNOR::loadSecureSection(const SectionId i_section)
msg->data[0] = static_cast<uint64_t>(i_section);
int rc = msg_sendrecv(spnorQ, msg);

TRACFCOMP(g_trac_pnor, "loadSecureSection i_section = %i (%s)",
TRACDCOMP(g_trac_pnor, "loadSecureSection i_section = %i (%s)",
i_section,PNOR::SectionIdToString(i_section));

// TODO securebootp9 - Need to be able to receive an error from the
Expand Down Expand Up @@ -811,7 +810,7 @@ errlHndl_t SPnorRP::miscSectionVerification(const uint8_t *i_vaddr,
errlHndl_t l_errl = NULL;
assert(i_vaddr != NULL);

TRACFCOMP(g_trac_pnor, "SPnorRP::miscSectionVerification section=%d (%s)",
TRACDCOMP(g_trac_pnor, "SPnorRP::miscSectionVerification section=%d (%s)",
i_secId,PNOR::SectionIdToString(i_secId));

// Do any additional verification needed for a specific PNOR section
Expand Down Expand Up @@ -868,9 +867,9 @@ errlHndl_t SPnorRP::baseExtVersCheck(const uint8_t *i_vaddr) const
HASH_PAGE_TABLE_ENTRY_SIZE) != 0 )
{
TRACFCOMP(g_trac_pnor, ERR_MRK"SPnorRP::baseExtVersCheck Hostboot Base and Extended image mismatch");
TRACFBIN(g_trac_pnor,"SPnorRP::baseExtVersCheck Measured sw key hash",
TRACDBIN(g_trac_pnor,"SPnorRP::baseExtVersCheck Measured sw key hash",
l_hashSwSigs, HASH_PAGE_TABLE_ENTRY_SIZE);
TRACFBIN(g_trac_pnor,"SPnorRP::baseExtVersCheck HBI's hash page table salt entry",
TRACDBIN(g_trac_pnor,"SPnorRP::baseExtVersCheck HBI's hash page table salt entry",
l_hashPageTableSaltEntry, HASH_PAGE_TABLE_ENTRY_SIZE);

// Memcpy needed for measured hash to avoid gcc error: dereferencing
Expand Down
6 changes: 3 additions & 3 deletions src/usr/secureboot/base/securerommgr.C
Expand Up @@ -142,7 +142,7 @@ errlHndl_t SecureRomManager::initialize()
if (!iv_secureromValid)
{
// The Secure ROM has already been initialized
TRACFCOMP(g_trac_secure,"SecureRomManager::initialize(): SecureROM invalid, skipping functionality");
TRACDCOMP(g_trac_secure,"SecureRomManager::initialize(): SecureROM invalid, skipping functionality");

#ifdef CONFIG_CONSOLE
CONSOLE::displayf(SECURE_COMP_NAME, "SecureROM invalid - skipping functionality");
Expand All @@ -152,7 +152,7 @@ errlHndl_t SecureRomManager::initialize()
break;
}

TRACFCOMP(g_trac_secure,"SecureRomManager::initialize(): SecureROM valid, enabling functionality");
TRACDCOMP(g_trac_secure,"SecureRomManager::initialize(): SecureROM valid, enabling functionality");
#ifdef CONFIG_CONSOLE
CONSOLE::displayf(SECURE_COMP_NAME, "SecureROM valid - enabling functionality");
#endif
Expand Down Expand Up @@ -218,7 +218,7 @@ errlHndl_t SecureRomManager::initialize()
/***************************************************************/
SecureRomManager::getHwKeyHash();

TRACFCOMP(g_trac_secure,INFO_MRK"SecureRomManager::initialize(): SUCCESSFUL:"
TRACDCOMP(g_trac_secure,INFO_MRK"SecureRomManager::initialize(): SUCCESSFUL:"
" iv_securerom=%p", iv_securerom);

}while(0);
Expand Down
6 changes: 3 additions & 3 deletions src/usr/secureboot/trusted/base/trustedboot_base.C
Expand Up @@ -411,7 +411,7 @@ errlHndl_t extendBaseImage()

#ifdef CONFIG_TPMDD

TRACFCOMP(g_trac_trustedboot, ENTER_MRK " extendBaseImage()");
TRACDCOMP(g_trac_trustedboot, ENTER_MRK " extendBaseImage()");

do {

Expand All @@ -438,7 +438,7 @@ errlHndl_t extendBaseImage()
if(!PNOR::cmpSecurebootMagicNumber(
reinterpret_cast<const uint8_t*>(pHbbHeader)))
{
TRACFCOMP(g_trac_trustedboot, INFO_MRK " HBB header is not a secure "
TRACDCOMP(g_trac_trustedboot, INFO_MRK " HBB header is not a secure "
"header; inhibiting extending base image measurement");
break;
}
Expand Down Expand Up @@ -489,7 +489,7 @@ errlHndl_t extendBaseImage()

} while(0);

TRACFCOMP(g_trac_trustedboot, EXIT_MRK " extendBaseImage()");
TRACDCOMP(g_trac_trustedboot, EXIT_MRK " extendBaseImage()");

#endif

Expand Down

0 comments on commit 3cbec65

Please sign in to comment.