You can subscribe to this list here.
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(8) |
Sep
(14) |
Oct
(7) |
Nov
(9) |
Dec
(7) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2010 |
Jan
(11) |
Feb
(4) |
Mar
(6) |
Apr
(3) |
May
(7) |
Jun
(12) |
Jul
(4) |
Aug
(6) |
Sep
(1) |
Oct
(4) |
Nov
(2) |
Dec
(2) |
2011 |
Jan
(2) |
Feb
(3) |
Mar
(10) |
Apr
(7) |
May
(5) |
Jun
(3) |
Jul
(7) |
Aug
(6) |
Sep
(1) |
Oct
(1) |
Nov
(4) |
Dec
(6) |
2012 |
Jan
|
Feb
(4) |
Mar
(1) |
Apr
(2) |
May
(21) |
Jun
(6) |
Jul
(3) |
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
(10) |
2013 |
Jan
(10) |
Feb
(8) |
Mar
|
Apr
(9) |
May
(33) |
Jun
(11) |
Jul
(16) |
Aug
(3) |
Sep
(8) |
Oct
(1) |
Nov
(16) |
Dec
(7) |
2014 |
Jan
(19) |
Feb
(71) |
Mar
(46) |
Apr
(16) |
May
(1) |
Jun
(18) |
Jul
(6) |
Aug
(12) |
Sep
(7) |
Oct
(4) |
Nov
(9) |
Dec
(7) |
2015 |
Jan
(15) |
Feb
(6) |
Mar
(10) |
Apr
(7) |
May
(16) |
Jun
(21) |
Jul
(6) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(1) |
2016 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2018 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Joel S. <jo...@jm...> - 2015-06-10 04:11:16
|
Signed-off-by: Joel Stanley <jo...@jm...> --- src/nvram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index ce3f7e1..c3f4ebc 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -136,7 +136,7 @@ help(void) * @def MAXLINE * @brief maximum line length */ -#define MAXLINE 4096 +#define MAXLINE 512 /** * _msg @@ -152,10 +152,10 @@ _msg(int msg_type, const char *fmt, va_list ap) int n; char buf[MAXLINE]; - n = sprintf(buf, "%s: %s", nvram_cmdname, + n = snprintf(buf, sizeof(buf), "%s: %s", nvram_cmdname, (msg_type == WARN_MSG ? "WARNING: " : "ERROR: ")); - vsprintf(buf + n, fmt, ap); + vsnprintf(buf + n, sizeof(buf) - n, fmt, ap); fflush(stderr); fputs(buf, stderr); -- 2.1.4 |
From: Joel S. <jo...@jm...> - 2015-06-10 04:08:49
|
The maximum partition name length is 12 characters but nvram accepts strings of any length. This change will enforce the maximum length passed to options that take a partition name to avoid confusion. Signed-off-by: Joel Stanley <jo...@jm...> --- src/nvram.c | 25 +++++++++++++++++++++++++ src/nvram.h | 14 ++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index c3f4ebc..b2f5c8c 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -467,6 +467,11 @@ nvram_find_fd_partition(struct nvram *nvram, char *name) int len; int found = 0; + if (strlen(name) > MAX_PART_NAME) { + err_msg("partition name too long\n"); + return -1; + } + if (lseek(nvram->fd, SEEK_SET, 0) == -1) { err_msg("could not seek to beginning of file %s\n", nvram->filename); return -1; @@ -1461,12 +1466,27 @@ main (int argc, char *argv[]) break; case 'd': /* dump */ dump_name = optarg; + if (strlen(dump_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'a': /* ASCII dump */ ascii_name = optarg; + if (strlen(ascii_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'z': /* dump compressed data */ zip_name = optarg; + if (strlen(zip_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'n': /* nvram-file */ nvram.filename = optarg; @@ -1509,6 +1529,11 @@ main (int argc, char *argv[]) break; case 'p': /* update-config partition name */ config_pname = optarg; + if (strlen(config_pname) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case '?': exit(1); diff --git a/src/nvram.h b/src/nvram.h index b4961fe..b78e793 100644 --- a/src/nvram.h +++ b/src/nvram.h @@ -45,14 +45,20 @@ #define MAX_CPUS 128 /** + * @def MAX_PART_NAME + * @brief maximum number of bytes in partition name + */ +#define MAX_PART_NAME 12 + +/** * @struct partition_header * @brief nvram partition header data */ struct partition_header { - unsigned char signature; /**< partition signature */ - unsigned char checksum; /**< partition checksum */ - unsigned short length; /**< partition length */ - char name[12]; /**< partition name */ + unsigned char signature; /**< partition signature */ + unsigned char checksum; /**< partition checksum */ + unsigned short length; /**< partition length */ + char name[MAX_PART_NAME]; /**< partition name */ }; /* sub-header for error-log partitions */ -- 2.1.4 |
From: Joel S. <jo...@jm...> - 2015-06-10 04:08:35
|
The maximum partition name length is 12 characters but nvram accepts strings of any length. This change will enforce the maximum length passed to options that take a partition name to avoid confusion. Signed-off-by: Joel Stanley <jo...@jm...> --- src/nvram.c | 25 +++++++++++++++++++++++++ src/nvram.h | 14 ++++++++++---- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index c3f4ebc..b2f5c8c 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -467,6 +467,11 @@ nvram_find_fd_partition(struct nvram *nvram, char *name) int len; int found = 0; + if (strlen(name) > MAX_PART_NAME) { + err_msg("partition name too long\n"); + return -1; + } + if (lseek(nvram->fd, SEEK_SET, 0) == -1) { err_msg("could not seek to beginning of file %s\n", nvram->filename); return -1; @@ -1461,12 +1466,27 @@ main (int argc, char *argv[]) break; case 'd': /* dump */ dump_name = optarg; + if (strlen(dump_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'a': /* ASCII dump */ ascii_name = optarg; + if (strlen(ascii_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'z': /* dump compressed data */ zip_name = optarg; + if (strlen(zip_name) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case 'n': /* nvram-file */ nvram.filename = optarg; @@ -1509,6 +1529,11 @@ main (int argc, char *argv[]) break; case 'p': /* update-config partition name */ config_pname = optarg; + if (strlen(config_pname) > MAX_PART_NAME) { + err_msg("partition name maximum length is %d\n", + MAX_PART_NAME); + exit(1); + } break; case '?': exit(1); diff --git a/src/nvram.h b/src/nvram.h index b4961fe..b78e793 100644 --- a/src/nvram.h +++ b/src/nvram.h @@ -45,14 +45,20 @@ #define MAX_CPUS 128 /** + * @def MAX_PART_NAME + * @brief maximum number of bytes in partition name + */ +#define MAX_PART_NAME 12 + +/** * @struct partition_header * @brief nvram partition header data */ struct partition_header { - unsigned char signature; /**< partition signature */ - unsigned char checksum; /**< partition checksum */ - unsigned short length; /**< partition length */ - char name[12]; /**< partition name */ + unsigned char signature; /**< partition signature */ + unsigned char checksum; /**< partition checksum */ + unsigned short length; /**< partition length */ + char name[MAX_PART_NAME]; /**< partition name */ }; /* sub-header for error-log partitions */ -- 2.1.4 |
From: Joel S. <jo...@jm...> - 2015-06-10 04:06:24
|
Signed-off-by: Joel Stanley <jo...@jm...> --- src/nvram.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/nvram.c b/src/nvram.c index ce3f7e1..c3f4ebc 100644 --- a/src/nvram.c +++ b/src/nvram.c @@ -136,7 +136,7 @@ help(void) * @def MAXLINE * @brief maximum line length */ -#define MAXLINE 4096 +#define MAXLINE 512 /** * _msg @@ -152,10 +152,10 @@ _msg(int msg_type, const char *fmt, va_list ap) int n; char buf[MAXLINE]; - n = sprintf(buf, "%s: %s", nvram_cmdname, + n = snprintf(buf, sizeof(buf), "%s: %s", nvram_cmdname, (msg_type == WARN_MSG ? "WARNING: " : "ERROR: ")); - vsprintf(buf + n, fmt, ap); + vsnprintf(buf + n, sizeof(buf) - n, fmt, ap); fflush(stderr); fputs(buf, stderr); -- 2.1.4 |
From: Dinar V. <k0...@op...> - 2015-06-08 07:16:45
|
On Mon, Jun 8, 2015 at 7:29 AM, Vasant Hegde <heg...@li...> wrote: > On 06/05/2015 05:12 PM, Dinar valeev wrote: >> From: Dinar Valeev <dv...@su...> >> >> Name OPAL platform correctly.. Bare metal systems are not >> PowerKVM (which is IBM distro), but PowerNV. >> >> Signed-off-by: Dinar Valeev <dv...@su...> > > > In someplaces we have used PowerKVM (similar to PowerVM?) and in some other > places as "Power KVM". Assuming usage of "Power KVM" is fine .. You mean Power KVM pSeries guest? I'd suggest to use just KVM pSeries guest, as pSeries already implies POWER > > Reviewed-by: Vasant Hegde <heg...@li...> > > -Vasant > >> --- >> scripts/ofpathname | 2 +- >> scripts/pseries_platform | 8 ++++---- >> scripts/rtas_dump | 2 +- >> scripts/snap | 2 +- >> scripts/update_flash | 2 +- >> src/common/pseries_platform.c | 6 +++--- >> src/common/pseries_platform.h | 2 +- >> src/drmgr/drmgr.c | 2 +- >> src/drmgr/lsslot.c | 2 +- >> src/rtas_event_decode.c | 2 +- >> src/set_poweron_time.c | 2 +- >> 11 files changed, 16 insertions(+), 16 deletions(-) >> >> diff --git a/scripts/ofpathname b/scripts/ofpathname >> index 97032bb..e64b31d 100755 >> --- a/scripts/ofpathname >> +++ b/scripts/ofpathname >> @@ -1471,7 +1471,7 @@ of2l_fc() >> # Main >> # >> . $PSERIES_PLATFORM >> -if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then >> +if [[ $platform = $PLATFORM_POWERNV ]]; then >> echo "$OFPATHNAME: is not supported on the $platform_name platform" >> exit 1 >> fi >> diff --git a/scripts/pseries_platform b/scripts/pseries_platform >> index e693a5b..8bf388a 100644 >> --- a/scripts/pseries_platform >> +++ b/scripts/pseries_platform >> @@ -3,7 +3,7 @@ >> SOURCE_FILE="pseries_platform" >> PLATFORM_FILE=/proc/cpuinfo >> export PLATFORM_UNKNOWN=0 >> -export PLATFORM_POWERKVM_HOST=1 >> +export PLATFORM_POWERNV=1 >> export PLATFORM_POWERKVM_GUEST=2 >> export PLATFORM_PSERIES_LPAR=3 >> >> @@ -11,10 +11,10 @@ export platform_name="Unknown" >> export platform=$PLATFORM_UNKNOWN >> >> if grep -q "PowerNV" $PLATFORM_FILE; then >> - platform_name="PowerKVM Host" >> - platform=$PLATFORM_POWERKVM_HOST >> + platform_name="PowerNV Host" >> + platform=$PLATFORM_POWERNV >> elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then >> - platform_name="PowerKVM pSeries Guest" >> + platform_name="Power KVM pSeries Guest" >> platform=$PLATFORM_POWERKVM_GUEST >> elif grep -q "pSeries" $PLATFORM_FILE; then >> platform_name="PowerVM pSeries LPAR" >> diff --git a/scripts/rtas_dump b/scripts/rtas_dump >> index a5a68f8..9907c31 100755 >> --- a/scripts/rtas_dump >> +++ b/scripts/rtas_dump >> @@ -73,7 +73,7 @@ eval '%ENV=('.$1.')' if `bash -c " >> $perldumpenv"` >> =~ /^\s*\{(.*)\}\s*$/mxs; >> >> -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { >> +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV'}) { >> print "rtas_dump: is not supported on the $ENV{'platform_name'} platform\n"; >> exit 1; >> } >> diff --git a/scripts/snap b/scripts/snap >> index dc8abe1..f58b77e 100755 >> --- a/scripts/snap >> +++ b/scripts/snap >> @@ -341,7 +341,7 @@ if (<$input> =~ /Ubuntu/) { >> exit 1; >> } >> >> -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { >> +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV_HOST'}) { >> print "snap: is not supported on the $ENV{'platform_name'} platform\n"; >> exit 1; >> } >> diff --git a/scripts/update_flash b/scripts/update_flash >> index a1f2bbb..aca2c8a 100755 >> --- a/scripts/update_flash >> +++ b/scripts/update_flash >> @@ -414,7 +414,7 @@ case "$platform" in >> $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) >> echo "update_flash: is not supported on the $platform_name platform" >> exit 1;; >> - $PLATFORM_POWERKVM_HOST) >> + $PLATFORM_POWERNV) >> if [ ! -r "$UPDATE_FLASH_NV" ]; then >> error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." >> fi >> diff --git a/src/common/pseries_platform.c b/src/common/pseries_platform.c >> index 31dbedb..2353271 100644 >> --- a/src/common/pseries_platform.c >> +++ b/src/common/pseries_platform.c >> @@ -15,8 +15,8 @@ >> >> const char *power_platform_name[] = { >> "Unknown", >> - "PowerKVM Host", >> - "PowerKVM pSeries Guest", >> + "PowerNV", >> + "Power KVM pSeries Guest", >> "PowerVM pSeries LPAR", >> /* Add new platforms name here */ >> }; >> @@ -35,7 +35,7 @@ get_platform(void) >> >> while (fgets(line, LENGTH, fp)) { >> if (strstr(line, "PowerNV")) { >> - rc = PLATFORM_POWERKVM_HOST; >> + rc = PLATFORM_POWERNV; >> break; >> } else if (strstr(line, "IBM pSeries (emulated by qemu)")) { >> rc = PLATFORM_POWERKVM_GUEST; >> diff --git a/src/common/pseries_platform.h b/src/common/pseries_platform.h >> index 1a3dff5..aef92f8 100644 >> --- a/src/common/pseries_platform.h >> +++ b/src/common/pseries_platform.h >> @@ -10,7 +10,7 @@ >> >> enum { >> PLATFORM_UNKNOWN = 0, >> - PLATFORM_POWERKVM_HOST, >> + PLATFORM_POWERNV, >> PLATFORM_POWERKVM_GUEST, >> PLATFORM_PSERIES_LPAR, >> /* Add new platforms here */ >> diff --git a/src/drmgr/drmgr.c b/src/drmgr/drmgr.c >> index b3e9a3c..394b0d7 100644 >> --- a/src/drmgr/drmgr.c >> +++ b/src/drmgr/drmgr.c >> @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) >> >> switch (get_platform()) { >> case PLATFORM_UNKNOWN: >> - case PLATFORM_POWERKVM_HOST: >> + case PLATFORM_POWERNV: >> fprintf(stderr, "%s: is not supported on the %s platform\n", >> argv[0], platform_name); >> exit(1); >> diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c >> index 22d1346..0118355 100644 >> --- a/src/drmgr/lsslot.c >> +++ b/src/drmgr/lsslot.c >> @@ -850,7 +850,7 @@ main(int argc, char *argv[]) >> >> switch (get_platform()) { >> case PLATFORM_UNKNOWN: >> - case PLATFORM_POWERKVM_HOST: >> + case PLATFORM_POWERNV: >> fprintf(stderr, "%s: is not supported on the %s platform\n", >> argv[0], platform_name); >> exit(1); >> diff --git a/src/rtas_event_decode.c b/src/rtas_event_decode.c >> index afc34ee..ca96ec4 100644 >> --- a/src/rtas_event_decode.c >> +++ b/src/rtas_event_decode.c >> @@ -132,7 +132,7 @@ main(int argc , char *argv[]) >> >> switch (get_platform()) { >> case PLATFORM_UNKNOWN: >> - case PLATFORM_POWERKVM_HOST: >> + case PLATFORM_POWERNV: >> fprintf(stderr, "%s: is not supported on the %s platform\n", >> argv[0], platform_name); >> exit(1); >> diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c >> index 32bab76..3ad9ebc 100644 >> --- a/src/set_poweron_time.c >> +++ b/src/set_poweron_time.c >> @@ -221,7 +221,7 @@ int main(int argc, char **argv) { >> >> switch (get_platform()) { >> case PLATFORM_UNKNOWN: >> - case PLATFORM_POWERKVM_HOST: >> + case PLATFORM_POWERNV: >> fprintf(stderr, "%s: is not supported on the %s platform\n", >> argv[0], platform_name); >> return 1; >> > |
From: Vasant H. <heg...@li...> - 2015-06-08 05:30:13
|
On 06/05/2015 05:12 PM, Dinar valeev wrote: > From: Dinar Valeev <dv...@su...> > > Name OPAL platform correctly.. Bare metal systems are not > PowerKVM (which is IBM distro), but PowerNV. > > Signed-off-by: Dinar Valeev <dv...@su...> In someplaces we have used PowerKVM (similar to PowerVM?) and in some other places as "Power KVM". Assuming usage of "Power KVM" is fine .. Reviewed-by: Vasant Hegde <heg...@li...> -Vasant > --- > scripts/ofpathname | 2 +- > scripts/pseries_platform | 8 ++++---- > scripts/rtas_dump | 2 +- > scripts/snap | 2 +- > scripts/update_flash | 2 +- > src/common/pseries_platform.c | 6 +++--- > src/common/pseries_platform.h | 2 +- > src/drmgr/drmgr.c | 2 +- > src/drmgr/lsslot.c | 2 +- > src/rtas_event_decode.c | 2 +- > src/set_poweron_time.c | 2 +- > 11 files changed, 16 insertions(+), 16 deletions(-) > > diff --git a/scripts/ofpathname b/scripts/ofpathname > index 97032bb..e64b31d 100755 > --- a/scripts/ofpathname > +++ b/scripts/ofpathname > @@ -1471,7 +1471,7 @@ of2l_fc() > # Main > # > . $PSERIES_PLATFORM > -if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then > +if [[ $platform = $PLATFORM_POWERNV ]]; then > echo "$OFPATHNAME: is not supported on the $platform_name platform" > exit 1 > fi > diff --git a/scripts/pseries_platform b/scripts/pseries_platform > index e693a5b..8bf388a 100644 > --- a/scripts/pseries_platform > +++ b/scripts/pseries_platform > @@ -3,7 +3,7 @@ > SOURCE_FILE="pseries_platform" > PLATFORM_FILE=/proc/cpuinfo > export PLATFORM_UNKNOWN=0 > -export PLATFORM_POWERKVM_HOST=1 > +export PLATFORM_POWERNV=1 > export PLATFORM_POWERKVM_GUEST=2 > export PLATFORM_PSERIES_LPAR=3 > > @@ -11,10 +11,10 @@ export platform_name="Unknown" > export platform=$PLATFORM_UNKNOWN > > if grep -q "PowerNV" $PLATFORM_FILE; then > - platform_name="PowerKVM Host" > - platform=$PLATFORM_POWERKVM_HOST > + platform_name="PowerNV Host" > + platform=$PLATFORM_POWERNV > elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then > - platform_name="PowerKVM pSeries Guest" > + platform_name="Power KVM pSeries Guest" > platform=$PLATFORM_POWERKVM_GUEST > elif grep -q "pSeries" $PLATFORM_FILE; then > platform_name="PowerVM pSeries LPAR" > diff --git a/scripts/rtas_dump b/scripts/rtas_dump > index a5a68f8..9907c31 100755 > --- a/scripts/rtas_dump > +++ b/scripts/rtas_dump > @@ -73,7 +73,7 @@ eval '%ENV=('.$1.')' if `bash -c " > $perldumpenv"` > =~ /^\s*\{(.*)\}\s*$/mxs; > > -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { > +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV'}) { > print "rtas_dump: is not supported on the $ENV{'platform_name'} platform\n"; > exit 1; > } > diff --git a/scripts/snap b/scripts/snap > index dc8abe1..f58b77e 100755 > --- a/scripts/snap > +++ b/scripts/snap > @@ -341,7 +341,7 @@ if (<$input> =~ /Ubuntu/) { > exit 1; > } > > -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { > +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV_HOST'}) { > print "snap: is not supported on the $ENV{'platform_name'} platform\n"; > exit 1; > } > diff --git a/scripts/update_flash b/scripts/update_flash > index a1f2bbb..aca2c8a 100755 > --- a/scripts/update_flash > +++ b/scripts/update_flash > @@ -414,7 +414,7 @@ case "$platform" in > $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) > echo "update_flash: is not supported on the $platform_name platform" > exit 1;; > - $PLATFORM_POWERKVM_HOST) > + $PLATFORM_POWERNV) > if [ ! -r "$UPDATE_FLASH_NV" ]; then > error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." > fi > diff --git a/src/common/pseries_platform.c b/src/common/pseries_platform.c > index 31dbedb..2353271 100644 > --- a/src/common/pseries_platform.c > +++ b/src/common/pseries_platform.c > @@ -15,8 +15,8 @@ > > const char *power_platform_name[] = { > "Unknown", > - "PowerKVM Host", > - "PowerKVM pSeries Guest", > + "PowerNV", > + "Power KVM pSeries Guest", > "PowerVM pSeries LPAR", > /* Add new platforms name here */ > }; > @@ -35,7 +35,7 @@ get_platform(void) > > while (fgets(line, LENGTH, fp)) { > if (strstr(line, "PowerNV")) { > - rc = PLATFORM_POWERKVM_HOST; > + rc = PLATFORM_POWERNV; > break; > } else if (strstr(line, "IBM pSeries (emulated by qemu)")) { > rc = PLATFORM_POWERKVM_GUEST; > diff --git a/src/common/pseries_platform.h b/src/common/pseries_platform.h > index 1a3dff5..aef92f8 100644 > --- a/src/common/pseries_platform.h > +++ b/src/common/pseries_platform.h > @@ -10,7 +10,7 @@ > > enum { > PLATFORM_UNKNOWN = 0, > - PLATFORM_POWERKVM_HOST, > + PLATFORM_POWERNV, > PLATFORM_POWERKVM_GUEST, > PLATFORM_PSERIES_LPAR, > /* Add new platforms here */ > diff --git a/src/drmgr/drmgr.c b/src/drmgr/drmgr.c > index b3e9a3c..394b0d7 100644 > --- a/src/drmgr/drmgr.c > +++ b/src/drmgr/drmgr.c > @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) > > switch (get_platform()) { > case PLATFORM_UNKNOWN: > - case PLATFORM_POWERKVM_HOST: > + case PLATFORM_POWERNV: > fprintf(stderr, "%s: is not supported on the %s platform\n", > argv[0], platform_name); > exit(1); > diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c > index 22d1346..0118355 100644 > --- a/src/drmgr/lsslot.c > +++ b/src/drmgr/lsslot.c > @@ -850,7 +850,7 @@ main(int argc, char *argv[]) > > switch (get_platform()) { > case PLATFORM_UNKNOWN: > - case PLATFORM_POWERKVM_HOST: > + case PLATFORM_POWERNV: > fprintf(stderr, "%s: is not supported on the %s platform\n", > argv[0], platform_name); > exit(1); > diff --git a/src/rtas_event_decode.c b/src/rtas_event_decode.c > index afc34ee..ca96ec4 100644 > --- a/src/rtas_event_decode.c > +++ b/src/rtas_event_decode.c > @@ -132,7 +132,7 @@ main(int argc , char *argv[]) > > switch (get_platform()) { > case PLATFORM_UNKNOWN: > - case PLATFORM_POWERKVM_HOST: > + case PLATFORM_POWERNV: > fprintf(stderr, "%s: is not supported on the %s platform\n", > argv[0], platform_name); > exit(1); > diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c > index 32bab76..3ad9ebc 100644 > --- a/src/set_poweron_time.c > +++ b/src/set_poweron_time.c > @@ -221,7 +221,7 @@ int main(int argc, char **argv) { > > switch (get_platform()) { > case PLATFORM_UNKNOWN: > - case PLATFORM_POWERKVM_HOST: > + case PLATFORM_POWERNV: > fprintf(stderr, "%s: is not supported on the %s platform\n", > argv[0], platform_name); > return 1; > |
From: Dinar V. <k0...@op...> - 2015-06-05 11:43:38
|
On Fri, Jun 5, 2015 at 1:02 PM, Michael Ellerman <mp...@el...> wrote: > On Fri, 2015-06-05 at 11:30 +0200, Dinar valeev wrote: >> From: Dinar Valeev <dv...@su...> >> >> Name OPAL platform correctly.. Bare metal systems are not >> PowerKVM (which is IBM distro), but PowerNV. > > Did you mean to use: > > PLATFORM_POWERNV > PLATFORM_POWERKNV > PLATFORM_POWERNVM > > ? No, that was a typo :) Thanks for review. Sent v2 > >> diff --git a/scripts/update_flash b/scripts/update_flash >> index a1f2bbb..a38b776 100755 >> --- a/scripts/update_flash >> +++ b/scripts/update_flash >> @@ -414,7 +414,7 @@ case "$platform" in >> $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) >> echo "update_flash: is not supported on the $platform_name platform" >> exit 1;; >> - $PLATFORM_POWERKVM_HOST) >> + $PLATFORM_POWERKNV) >> if [ ! -r "$UPDATE_FLASH_NV" ]; then >> error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." >> fi > >> diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c >> index 32bab76..3caf1b5 100644 >> --- a/src/set_poweron_time.c >> +++ b/src/set_poweron_time.c >> @@ -221,7 +221,7 @@ int main(int argc, char **argv) { >> >> switch (get_platform()) { >> case PLATFORM_UNKNOWN: >> - case PLATFORM_POWERKVM_HOST: >> + case PLATFORM_POWERNVM: >> fprintf(stderr, "%s: is not supported on the %s platform\n", >> argv[0], platform_name); >> return 1; > > > cheers > > |
From: Dinar v. <k0...@op...> - 2015-06-05 11:42:30
|
From: Dinar Valeev <dv...@su...> Name OPAL platform correctly.. Bare metal systems are not PowerKVM (which is IBM distro), but PowerNV. Signed-off-by: Dinar Valeev <dv...@su...> --- scripts/ofpathname | 2 +- scripts/pseries_platform | 8 ++++---- scripts/rtas_dump | 2 +- scripts/snap | 2 +- scripts/update_flash | 2 +- src/common/pseries_platform.c | 6 +++--- src/common/pseries_platform.h | 2 +- src/drmgr/drmgr.c | 2 +- src/drmgr/lsslot.c | 2 +- src/rtas_event_decode.c | 2 +- src/set_poweron_time.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/ofpathname b/scripts/ofpathname index 97032bb..e64b31d 100755 --- a/scripts/ofpathname +++ b/scripts/ofpathname @@ -1471,7 +1471,7 @@ of2l_fc() # Main # . $PSERIES_PLATFORM -if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then +if [[ $platform = $PLATFORM_POWERNV ]]; then echo "$OFPATHNAME: is not supported on the $platform_name platform" exit 1 fi diff --git a/scripts/pseries_platform b/scripts/pseries_platform index e693a5b..8bf388a 100644 --- a/scripts/pseries_platform +++ b/scripts/pseries_platform @@ -3,7 +3,7 @@ SOURCE_FILE="pseries_platform" PLATFORM_FILE=/proc/cpuinfo export PLATFORM_UNKNOWN=0 -export PLATFORM_POWERKVM_HOST=1 +export PLATFORM_POWERNV=1 export PLATFORM_POWERKVM_GUEST=2 export PLATFORM_PSERIES_LPAR=3 @@ -11,10 +11,10 @@ export platform_name="Unknown" export platform=$PLATFORM_UNKNOWN if grep -q "PowerNV" $PLATFORM_FILE; then - platform_name="PowerKVM Host" - platform=$PLATFORM_POWERKVM_HOST + platform_name="PowerNV Host" + platform=$PLATFORM_POWERNV elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then - platform_name="PowerKVM pSeries Guest" + platform_name="Power KVM pSeries Guest" platform=$PLATFORM_POWERKVM_GUEST elif grep -q "pSeries" $PLATFORM_FILE; then platform_name="PowerVM pSeries LPAR" diff --git a/scripts/rtas_dump b/scripts/rtas_dump index a5a68f8..9907c31 100755 --- a/scripts/rtas_dump +++ b/scripts/rtas_dump @@ -73,7 +73,7 @@ eval '%ENV=('.$1.')' if `bash -c " $perldumpenv"` =~ /^\s*\{(.*)\}\s*$/mxs; -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV'}) { print "rtas_dump: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff --git a/scripts/snap b/scripts/snap index dc8abe1..f58b77e 100755 --- a/scripts/snap +++ b/scripts/snap @@ -341,7 +341,7 @@ if (<$input> =~ /Ubuntu/) { exit 1; } -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV_HOST'}) { print "snap: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff --git a/scripts/update_flash b/scripts/update_flash index a1f2bbb..aca2c8a 100755 --- a/scripts/update_flash +++ b/scripts/update_flash @@ -414,7 +414,7 @@ case "$platform" in $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) echo "update_flash: is not supported on the $platform_name platform" exit 1;; - $PLATFORM_POWERKVM_HOST) + $PLATFORM_POWERNV) if [ ! -r "$UPDATE_FLASH_NV" ]; then error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." fi diff --git a/src/common/pseries_platform.c b/src/common/pseries_platform.c index 31dbedb..2353271 100644 --- a/src/common/pseries_platform.c +++ b/src/common/pseries_platform.c @@ -15,8 +15,8 @@ const char *power_platform_name[] = { "Unknown", - "PowerKVM Host", - "PowerKVM pSeries Guest", + "PowerNV", + "Power KVM pSeries Guest", "PowerVM pSeries LPAR", /* Add new platforms name here */ }; @@ -35,7 +35,7 @@ get_platform(void) while (fgets(line, LENGTH, fp)) { if (strstr(line, "PowerNV")) { - rc = PLATFORM_POWERKVM_HOST; + rc = PLATFORM_POWERNV; break; } else if (strstr(line, "IBM pSeries (emulated by qemu)")) { rc = PLATFORM_POWERKVM_GUEST; diff --git a/src/common/pseries_platform.h b/src/common/pseries_platform.h index 1a3dff5..aef92f8 100644 --- a/src/common/pseries_platform.h +++ b/src/common/pseries_platform.h @@ -10,7 +10,7 @@ enum { PLATFORM_UNKNOWN = 0, - PLATFORM_POWERKVM_HOST, + PLATFORM_POWERNV, PLATFORM_POWERKVM_GUEST, PLATFORM_PSERIES_LPAR, /* Add new platforms here */ diff --git a/src/drmgr/drmgr.c b/src/drmgr/drmgr.c index b3e9a3c..394b0d7 100644 --- a/src/drmgr/drmgr.c +++ b/src/drmgr/drmgr.c @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c index 22d1346..0118355 100644 --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -850,7 +850,7 @@ main(int argc, char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/rtas_event_decode.c b/src/rtas_event_decode.c index afc34ee..ca96ec4 100644 --- a/src/rtas_event_decode.c +++ b/src/rtas_event_decode.c @@ -132,7 +132,7 @@ main(int argc , char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c index 32bab76..3ad9ebc 100644 --- a/src/set_poweron_time.c +++ b/src/set_poweron_time.c @@ -221,7 +221,7 @@ int main(int argc, char **argv) { switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); return 1; -- 2.1.4 |
From: Michael E. <mp...@el...> - 2015-06-05 11:21:02
|
On Fri, 2015-06-05 at 11:30 +0200, Dinar valeev wrote: > From: Dinar Valeev <dv...@su...> > > Name OPAL platform correctly.. Bare metal systems are not > PowerKVM (which is IBM distro), but PowerNV. Did you mean to use: PLATFORM_POWERNV PLATFORM_POWERKNV PLATFORM_POWERNVM ? > diff --git a/scripts/update_flash b/scripts/update_flash > index a1f2bbb..a38b776 100755 > --- a/scripts/update_flash > +++ b/scripts/update_flash > @@ -414,7 +414,7 @@ case "$platform" in > $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) > echo "update_flash: is not supported on the $platform_name platform" > exit 1;; > - $PLATFORM_POWERKVM_HOST) > + $PLATFORM_POWERKNV) > if [ ! -r "$UPDATE_FLASH_NV" ]; then > error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." > fi > diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c > index 32bab76..3caf1b5 100644 > --- a/src/set_poweron_time.c > +++ b/src/set_poweron_time.c > @@ -221,7 +221,7 @@ int main(int argc, char **argv) { > > switch (get_platform()) { > case PLATFORM_UNKNOWN: > - case PLATFORM_POWERKVM_HOST: > + case PLATFORM_POWERNVM: > fprintf(stderr, "%s: is not supported on the %s platform\n", > argv[0], platform_name); > return 1; cheers |
From: Dinar v. <k0...@op...> - 2015-06-05 09:31:03
|
From: Dinar Valeev <dv...@su...> Name OPAL platform correctly.. Bare metal systems are not PowerKVM (which is IBM distro), but PowerNV. Signed-off-by: Dinar Valeev <dv...@su...> --- scripts/ofpathname | 2 +- scripts/pseries_platform | 8 ++++---- scripts/rtas_dump | 2 +- scripts/snap | 2 +- scripts/update_flash | 2 +- src/common/pseries_platform.c | 6 +++--- src/common/pseries_platform.h | 2 +- src/drmgr/drmgr.c | 2 +- src/drmgr/lsslot.c | 2 +- src/rtas_event_decode.c | 2 +- src/set_poweron_time.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/scripts/ofpathname b/scripts/ofpathname index 97032bb..e64b31d 100755 --- a/scripts/ofpathname +++ b/scripts/ofpathname @@ -1471,7 +1471,7 @@ of2l_fc() # Main # . $PSERIES_PLATFORM -if [[ $platform = $PLATFORM_POWERKVM_HOST ]]; then +if [[ $platform = $PLATFORM_POWERNV ]]; then echo "$OFPATHNAME: is not supported on the $platform_name platform" exit 1 fi diff --git a/scripts/pseries_platform b/scripts/pseries_platform index e693a5b..8bf388a 100644 --- a/scripts/pseries_platform +++ b/scripts/pseries_platform @@ -3,7 +3,7 @@ SOURCE_FILE="pseries_platform" PLATFORM_FILE=/proc/cpuinfo export PLATFORM_UNKNOWN=0 -export PLATFORM_POWERKVM_HOST=1 +export PLATFORM_POWERNV=1 export PLATFORM_POWERKVM_GUEST=2 export PLATFORM_PSERIES_LPAR=3 @@ -11,10 +11,10 @@ export platform_name="Unknown" export platform=$PLATFORM_UNKNOWN if grep -q "PowerNV" $PLATFORM_FILE; then - platform_name="PowerKVM Host" - platform=$PLATFORM_POWERKVM_HOST + platform_name="PowerNV Host" + platform=$PLATFORM_POWERNV elif grep -q "IBM pSeries (emulated by qemu)" $PLATFORM_FILE; then - platform_name="PowerKVM pSeries Guest" + platform_name="Power KVM pSeries Guest" platform=$PLATFORM_POWERKVM_GUEST elif grep -q "pSeries" $PLATFORM_FILE; then platform_name="PowerVM pSeries LPAR" diff --git a/scripts/rtas_dump b/scripts/rtas_dump index a5a68f8..9907c31 100755 --- a/scripts/rtas_dump +++ b/scripts/rtas_dump @@ -73,7 +73,7 @@ eval '%ENV=('.$1.')' if `bash -c " $perldumpenv"` =~ /^\s*\{(.*)\}\s*$/mxs; -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV'}) { print "rtas_dump: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff --git a/scripts/snap b/scripts/snap index dc8abe1..f58b77e 100755 --- a/scripts/snap +++ b/scripts/snap @@ -341,7 +341,7 @@ if (<$input> =~ /Ubuntu/) { exit 1; } -if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERKVM_HOST'}) { +if ($ENV{'platform'} == $ENV{'PLATFORM_UNKNOWN'} || $ENV{'platform'} == $ENV{'PLATFORM_POWERNV_HOST'}) { print "snap: is not supported on the $ENV{'platform_name'} platform\n"; exit 1; } diff --git a/scripts/update_flash b/scripts/update_flash index a1f2bbb..a38b776 100755 --- a/scripts/update_flash +++ b/scripts/update_flash @@ -414,7 +414,7 @@ case "$platform" in $PLATFORM_UNKNOWN | $PLATFORM_POWERKVM_GUEST) echo "update_flash: is not supported on the $platform_name platform" exit 1;; - $PLATFORM_POWERKVM_HOST) + $PLATFORM_POWERKNV) if [ ! -r "$UPDATE_FLASH_NV" ]; then error $E_PERM "Couldn't find $UPDATE_FLASH_NV file." fi diff --git a/src/common/pseries_platform.c b/src/common/pseries_platform.c index 31dbedb..2353271 100644 --- a/src/common/pseries_platform.c +++ b/src/common/pseries_platform.c @@ -15,8 +15,8 @@ const char *power_platform_name[] = { "Unknown", - "PowerKVM Host", - "PowerKVM pSeries Guest", + "PowerNV", + "Power KVM pSeries Guest", "PowerVM pSeries LPAR", /* Add new platforms name here */ }; @@ -35,7 +35,7 @@ get_platform(void) while (fgets(line, LENGTH, fp)) { if (strstr(line, "PowerNV")) { - rc = PLATFORM_POWERKVM_HOST; + rc = PLATFORM_POWERNV; break; } else if (strstr(line, "IBM pSeries (emulated by qemu)")) { rc = PLATFORM_POWERKVM_GUEST; diff --git a/src/common/pseries_platform.h b/src/common/pseries_platform.h index 1a3dff5..aef92f8 100644 --- a/src/common/pseries_platform.h +++ b/src/common/pseries_platform.h @@ -10,7 +10,7 @@ enum { PLATFORM_UNKNOWN = 0, - PLATFORM_POWERKVM_HOST, + PLATFORM_POWERNV, PLATFORM_POWERKVM_GUEST, PLATFORM_PSERIES_LPAR, /* Add new platforms here */ diff --git a/src/drmgr/drmgr.c b/src/drmgr/drmgr.c index b3e9a3c..394b0d7 100644 --- a/src/drmgr/drmgr.c +++ b/src/drmgr/drmgr.c @@ -312,7 +312,7 @@ int main(int argc, char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c index 22d1346..0118355 100644 --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -850,7 +850,7 @@ main(int argc, char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/rtas_event_decode.c b/src/rtas_event_decode.c index afc34ee..ca96ec4 100644 --- a/src/rtas_event_decode.c +++ b/src/rtas_event_decode.c @@ -132,7 +132,7 @@ main(int argc , char *argv[]) switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNV: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); exit(1); diff --git a/src/set_poweron_time.c b/src/set_poweron_time.c index 32bab76..3caf1b5 100644 --- a/src/set_poweron_time.c +++ b/src/set_poweron_time.c @@ -221,7 +221,7 @@ int main(int argc, char **argv) { switch (get_platform()) { case PLATFORM_UNKNOWN: - case PLATFORM_POWERKVM_HOST: + case PLATFORM_POWERNVM: fprintf(stderr, "%s: is not supported on the %s platform\n", argv[0], platform_name); return 1; -- 2.1.4 |
From: Bharata B R. <bha...@gm...> - 2015-05-27 08:49:02
|
On Thu, May 14, 2015 at 10:03 PM, Nathan Fontenot <nf...@li...> wrote: > When adding a LMB we need to update the affinity as part of the add process. > The affinity for the LMB we are adding is conveyed in the > ibm,associativity property for the device tree node of the LMB we are adding. > > To clarify, a little history. Previously LMB information in the device tree > was done as a node per LMB in the form memory@XXX, and all of the information > about the LMB as properties under this node. When we moved to using the > ibm,dynamic-reconfiguration-memory node to convey LMB information the > ibm,dynamic-memory property provides an index for each LMB into the > ibm,associativity-lookup-arrays property. This is where we determine the > affinity for each LMB. > > In order to update the affinity for a LMB we are adding we have to call > configure connector to get the memory@XXX node and its properties for the > LMB we are adding (yes, rtas did not change this part), find the > ibm,associativity property, then find the entry in the associativity > lookup array that matches it. We then update the ibm,dynamic-memory > property with the proper index into the associativity lookup array. > > Signed-off-by: Nathan Fontenot <nf...@li...> Tested-by: Bharata B Rao <bh...@li...> Tested with out of the tree memory hotplug patches in QEMU and now I am able to hotplug memory to nodes other than node 0. |
From: Michael R. <md...@li...> - 2015-05-18 23:55:56
|
For each invocation involving '-c phb', if a numerical value is given for -s do a lookup through PHB list to find the corresponding DRC name. Signed-off-by: Michael Roth <md...@li...> --- src/drmgr/drslot_chrp_phb.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/drmgr/drslot_chrp_phb.c b/src/drmgr/drslot_chrp_phb.c index 5fb25cb..3ed109c 100644 --- a/src/drmgr/drslot_chrp_phb.c +++ b/src/drmgr/drslot_chrp_phb.c @@ -456,8 +456,14 @@ phb_add_error: int valid_phb_options(struct options *opts) { - if (opts->usr_drc_name == NULL) { - say(ERROR, "A drc name must be specified\n"); + /* The -s option can specify a drc name or drc index */ + if (opts->usr_drc_name && !strncmp(opts->usr_drc_name, "0x", 2)) { + opts->usr_drc_index = strtoul(opts->usr_drc_name, NULL, 16); + opts->usr_drc_name = NULL; + } + + if (opts->usr_drc_name == NULL && !opts->usr_drc_index) { + say(ERROR, "A drc name or index must be specified\n"); return -1; } @@ -482,6 +488,18 @@ drslot_chrp_phb(struct options *opts) return rc; } + if (!opts->usr_drc_name) { + struct dr_connector *drc_list = get_drc_info(OFDT_BASE); + opts->usr_drc_name = drc_index_to_name(opts->usr_drc_index, + drc_list); + if (!opts->usr_drc_name) { + say(ERROR, + "Could not locate DRC name for DRC index: 0x%x", + opts->usr_drc_index); + return -1; + } + } + switch(opts->action) { case ADD: rc = add_phb(opts); -- 1.9.1 |
From: Michael R. <md...@li...> - 2015-05-18 23:55:54
|
Currently we fail to release a PHB to firmware if we're unable to remove the PHB's interrupt-controller node from the guest device tree. However, according to update_phb_ic_info(): "... there can be more ICs than PHBs on a system. In this case, some ICs won't have my-drc-index." In such cases, we don't assign the 'interrupt-controller*' path to the PHB's OF node, so simply skip the IC node removal (it either doesn't exist, or is not not owned by this PHB) when this occurs and proceed with releasing the PHB. Signed-off-by: Michael Roth <md...@li...> --- src/drmgr/drslot_chrp_phb.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/drmgr/drslot_chrp_phb.c b/src/drmgr/drslot_chrp_phb.c index eda10eb..5fb25cb 100644 --- a/src/drmgr/drslot_chrp_phb.c +++ b/src/drmgr/drslot_chrp_phb.c @@ -75,9 +75,11 @@ release_phb(struct dr_node *phb) if (rc) return rc; - rc = remove_device_tree_nodes(phb->phb_ic_ofdt_path); - if (rc) - return rc; + if (phb->phb_ic_ofdt_path[0] != '\0') { + rc = remove_device_tree_nodes(phb->phb_ic_ofdt_path); + if (rc) + return rc; + } rc = release_drc(phb->drc_index, PHB_DEV); -- 1.9.1 |
From: Michael R. <md...@li...> - 2015-05-18 23:55:52
|
Signed-off-by: Michael Roth <md...@li...> --- src/drmgr/common_pci.c | 35 +++++++++++++++++++++++++++-------- src/drmgr/drpci.h | 1 + src/drmgr/drslot_chrp_phb.c | 13 ++++++++++++- 3 files changed, 40 insertions(+), 9 deletions(-) diff --git a/src/drmgr/common_pci.c b/src/drmgr/common_pci.c index 119c352..04a8a35 100644 --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -1433,6 +1433,28 @@ release_hp_resource(struct dr_node *node) } /** + * release_hp_children_from_node + * + * @param parent_slot dr_node of slot to release children from + * @returns 0 on success, !0 otherwise + */ +int +release_hp_children_from_node(struct dr_node *slot) +{ + struct dr_node *child; + int rc; + + for (child = slot->children; child; child = child->next) { + rc = release_hp_resource(child); + if (rc) + return rc; + } + + return 0; +} + + +/** * release_hp_children * * @param parent_drc_name @@ -1441,7 +1463,7 @@ release_hp_resource(struct dr_node *node) int release_hp_children(char *parent_drc_name) { - struct dr_node *hp_list, *slot, *child; + struct dr_node *hp_list, *slot; int rc; hp_list = get_hp_nodes(); @@ -1450,16 +1472,13 @@ release_hp_children(char *parent_drc_name) break; if (slot == NULL) { - free_node(hp_list); - return -EINVAL; + rc = -EINVAL; + goto out; } - for (child = slot->children; child; child = child->next) { - rc = release_hp_resource(child); - if (rc) - return rc; - } + rc = release_hp_children_from_node(slot); +out: free_node(hp_list); return (rc < 0) ? rc : 0; } diff --git a/src/drmgr/drpci.h b/src/drmgr/drpci.h index f5221fc..b103c96 100644 --- a/src/drmgr/drpci.h +++ b/src/drmgr/drpci.h @@ -65,6 +65,7 @@ int get_hp_adapter_status(char *); int set_hp_adapter_status(uint, char *); int pci_rescan_bus(); int pci_remove_device(struct dr_node *); +int release_hp_children_from_node(struct dr_node *); int release_hp_children(char *); int dlpar_remove_slot(const char *); int dlpar_add_slot(const char *); diff --git a/src/drmgr/drslot_chrp_phb.c b/src/drmgr/drslot_chrp_phb.c index 466ed11..eda10eb 100644 --- a/src/drmgr/drslot_chrp_phb.c +++ b/src/drmgr/drslot_chrp_phb.c @@ -247,6 +247,7 @@ remove_phb(struct options *opts) { struct dr_node *phb; struct dr_node *child; + struct dr_node *hp_list; int rc = 0; phb = get_node_by_name(opts->usr_drc_name, PHB_NODES); @@ -262,14 +263,24 @@ remove_phb(struct options *opts) } /* Now, disable any hotplug children */ + hp_list = get_hp_nodes(); + for (child = phb->children; child; child = child->next) { + struct dr_node *slot; + if (child->dev_type == PCI_HP_DEV) { rc = disable_hp_children(child->drc_name); if (rc) say(ERROR, "failed to disable hotplug children\n"); - rc = release_hp_children(child->drc_name); + /* find dr_node corresponding to child slot's drc_name */ + for (slot = hp_list; slot; slot = slot->next) + if (!strcmp(child->drc_name, slot->drc_name)) + break; + + /* release any hp children from the slot */ + rc = release_hp_children_from_node(slot); if (rc && rc != -EINVAL) { say(ERROR, "failed to release hotplug children\n"); -- 1.9.1 |
From: Michael R. <md...@li...> - 2015-05-18 23:55:51
|
Current code assumes that slots under a PHB are populated during PHB removal. As a result, we attempt to unconfigure the slot/adapter by powering it off, then checking for an 'unconfigured' state via get_hp_adaptor_status/DR_ENTITY_SENSE. However, if the slot is empty well get an 'emtpy' state instead. We can avoid this by simply not attempting to unconfigure/poweroff an adapter if the slot is empty, but it's possible we rely on this in some cases to safely power-off slots. Instead, simply allow DR_ENTITY_SENSE to report 'empty' after power-off in addition to 'unconfigured'. Signed-by-off: Michael Roth <md...@li...> --- src/drmgr/common_pci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/drmgr/common_pci.c b/src/drmgr/common_pci.c index 64ca08f..119c352 100644 --- a/src/drmgr/common_pci.c +++ b/src/drmgr/common_pci.c @@ -1492,9 +1492,12 @@ enable_hp_children(char *drc_name) int disable_hp_children(char *drc_name) { if (get_hp_adapter_status(drc_name) != NOT_CONFIG) { + int status; + set_hp_adapter_status(PHP_UNCONFIG_ADAPTER, drc_name); + status = get_hp_adapter_status(drc_name); - if (get_hp_adapter_status(drc_name) != NOT_CONFIG) + if (status != NOT_CONFIG && status != EMPTY) return 1; } return 0; -- 1.9.1 |
From: Michael R. <md...@li...> - 2015-05-18 23:55:49
|
The following patches address a number of issue that arise when unplugging PHBs from a QEMU/PowerKVM pSeries guest. Most are due to minor differences in how PHBs are allocated in QEMU (lots of empty PCI slots) vs. PowerVM (1 slot per PHB, generally pre-populated with a device). The last patch is to simplify automation of PHB unplug/hotplug in rtas_errd, which currently relies on numerical DRC indexes for PCI/LMB hotplug (patch not yet posted, as it relies on these changes), as well as for parity with current drmgr functionality with PCI/LMB command syntax. QEMU patches for PHB hotplug are available here: http://thread.gmane.org/gmane.comp.emulators.qemu/333360 There are still in review, but the powerpc-utils bits are not expected to change and follow the same format as PCI/LMB. |
From: Paul C. <pc...@us...> - 2015-05-15 15:59:40
|
On 05/15/2015 09:00 AM, Nathan Fontenot wrote: > On 05/14/2015 02:33 PM, Paul Clarke wrote: >> On 05/14/2015 11:31 AM, Nathan Fontenot wrote: >>> This patch adds additional information to the output produced >>> by the lsslot command for dynamic reconfiguration memory. The >>> default output with this patch will add the address, drc index, >>> and associativity for each LMB. >>> >>> #> lsslot -c mem >>> Dynamic Reconfiguration Memory (LMB size 0x10000000) >>> LMB2: >>> DRC Index: 80000001 Address: 10000000 >>> Removable: Yes Associativity: (index: 1) 0 1 2 2 >>> Section(s): 1 >>> -- snip -- >>> >>> Additionally, this patch allows users to specify the -d 4 option >>> to lsslot for memory which will print information about all possible >>> LMBs, not just the LMBs owned by the system. >> >> Is this supposed to read "print information about all LMBs installed in the system, not just the LMBs visible to the operating system" ? > > I think we could go with either wording. The number of possible LMBs is > the max number of LMBs that can be possibly dlpar added to the lpar. > When a partition is booted the device tree has information about all > of these possible LMBs, even if they are not currently assigned to the > partition. > > The wording I chose mirrors how I think of them, but am open to change > if you think your wording is a better explanation. To me, of course, my wording is clearer. :-) I was trying to clarify what "all possible LMBs" meant, and that "LMBs owned by the system" really wasn't for "the system" as a whole, but just for the operating system instance in which the command is executing. (I hope I'm actually getting those respective meanings correct.) PC |
From: Nathan F. <nf...@li...> - 2015-05-15 14:00:14
|
On 05/14/2015 02:33 PM, Paul Clarke wrote: > > > On 05/14/2015 11:31 AM, Nathan Fontenot wrote: >> This patch adds additional information to the output produced >> by the lsslot command for dynamic reconfiguration memory. The >> default output with this patch will add the address, drc index, >> and associativity for each LMB. >> >> #> lsslot -c mem >> Dynamic Reconfiguration Memory (LMB size 0x10000000) >> LMB2: >> DRC Index: 80000001 Address: 10000000 >> Removable: Yes Associativity: (index: 1) 0 1 2 2 >> Section(s): 1 >> -- snip -- >> >> Additionally, this patch allows users to specify the -d 4 option >> to lsslot for memory which will print information about all possible >> LMBs, not just the LMBs owned by the system. > > Is this supposed to read "print information about all LMBs installed in the system, not just the LMBs visible to the operating system" ? > I think we could go with either wording. The number of possible LMBs is the max number of LMBs that can be possibly dlpar added to the lpar. When a partition is booted the device tree has information about all of these possible LMBs, even if they are not currently assigned to the partition. The wording I chose mirrors how I think of them, but am open to change if you think your wording is a better explanation. -Nathan |
From: Kamalesh B. <kam...@li...> - 2015-05-15 06:38:13
|
On 05/15/2015 11:01 AM, Naveen N. Rao wrote: >> >Both retrans_time and retrans_time_ms behave synonymously. i.e., if you >> >modify one file the value gets reflected in another. >> >We can avoid the warning from snap, by copying the non deprecated version >> >and still we could have the required debugging >> >information. > Ah, nice. > Assuming we're only skipping these files under /proc/sys and/or chances > of similarly named files in paths we care about is none: > Acked-by: Naveen N. Rao<nav...@li...> Thanks for the review. AFAIK, both retrans_time and base_reachable_time are network tunable, living under /proc. We might not end up accidentally losing any other diagnostic data, while safely ignoring both of the deprecated files. Thanks, Kamalesh. |
From: Naveen N. R. <nav...@li...> - 2015-05-15 05:32:25
|
On 2015/05/14 09:16PM, Kamalesh Babulal wrote: > > > On 05/14/2015 04:29 PM, Naveen N. Rao wrote: > >>Teach snap to ignore deprecated sysctl network files, while > >>>gathering information from /proc. Reading deprecated file, > >>>throws warnings in /var/log/message like: > >>>kernel: process `snap' is using deprecated sysctl (syscall) > >>>net.ipv6.neigh.default.retrans_time; Use net.ipv6.neigh.default.retrans_time_ms instead.` > >Are you sure you want to ignore these just to prevent those warnings? > >Those could still be used by older applications and kernel will still > >effect changes based on these. > > Both retrans_time and retrans_time_ms behave synonymously. i.e., if you > modify one file the value gets reflected in another. > We can avoid the warning from snap, by copying the non deprecated version > and still we could have the required debugging > information. Ah, nice. Assuming we're only skipping these files under /proc/sys and/or chances of similarly named files in paths we care about is none: Acked-by: Naveen N. Rao <nav...@li...> Thanks, Naveen |
From: Paul C. <pc...@us...> - 2015-05-14 19:33:39
|
On 05/14/2015 11:31 AM, Nathan Fontenot wrote: > This patch adds additional information to the output produced > by the lsslot command for dynamic reconfiguration memory. The > default output with this patch will add the address, drc index, > and associativity for each LMB. > > #> lsslot -c mem > Dynamic Reconfiguration Memory (LMB size 0x10000000) > LMB2: > DRC Index: 80000001 Address: 10000000 > Removable: Yes Associativity: (index: 1) 0 1 2 2 > Section(s): 1 > -- snip -- > > Additionally, this patch allows users to specify the -d 4 option > to lsslot for memory which will print information about all possible > LMBs, not just the LMBs owned by the system. Is this supposed to read "print information about all LMBs installed in the system, not just the LMBs visible to the operating system" ? PC |
From: Nathan F. <nf...@li...> - 2015-05-14 16:33:40
|
When adding a LMB we need to update the affinity as part of the add process. The affinity for the LMB we are adding is conveyed in the ibm,associativity property for the device tree node of the LMB we are adding. To clarify, a little history. Previously LMB information in the device tree was done as a node per LMB in the form memory@XXX, and all of the information about the LMB as properties under this node. When we moved to using the ibm,dynamic-reconfiguration-memory node to convey LMB information the ibm,dynamic-memory property provides an index for each LMB into the ibm,associativity-lookup-arrays property. This is where we determine the affinity for each LMB. In order to update the affinity for a LMB we are adding we have to call configure connector to get the memory@XXX node and its properties for the LMB we are adding (yes, rtas did not change this part), find the ibm,associativity property, then find the entry in the associativity lookup array that matches it. We then update the ibm,dynamic-memory property with the proper index into the associativity lookup array. Signed-off-by: Nathan Fontenot <nf...@li...> --- src/drmgr/drslot_chrp_mem.c | 72 ++++++++++++++++++++++++++++++++++++------- 1 file changed, 60 insertions(+), 12 deletions(-) diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index 0a5b84e..ce58c42 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -544,6 +544,56 @@ get_available_lmb(struct options *opts, struct dr_node *start_lmb) return usable_lmb; } +static void update_drconf_affinity(struct dr_node *lmb, + struct drconf_mem *drmem) +{ + struct of_node *node; + struct of_property *prop; + uint32_t assoc_prop_sz; + uint32_t *assoc_prop; + uint32_t assoc_entries; + uint32_t assoc_entry_sz; + uint32_t *prop_val; + int i; + + /* find the ibm,associativity property */ + node = lmb->lmb_of_node; + for (prop = node->properties; prop; prop = prop->next) { + if (!strcmp(prop->name, "ibm,associativity")) + break; + } + + if (!prop) + return; + + /* find the associtivity index atrrays */ + assoc_prop_sz = get_property_size(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays"); + assoc_prop = zalloc(assoc_prop_sz); + if (!assoc_prop) + return; + + get_property(DYNAMIC_RECONFIG_MEM, "ibm,associativity-lookup-arrays", + assoc_prop, assoc_prop_sz); + + assoc_entries = be32toh(assoc_prop[0]); + assoc_entry_sz = be32toh(assoc_prop[1]); + + prop_val = (uint32_t *)prop->value; + for (i = 0; i < assoc_entries; i++) { + if (memcmp(&assoc_prop[(i * assoc_entry_sz) + 2], &prop_val[1], + assoc_entry_sz * sizeof(uint32_t))) + continue; + + /* found it */ + drmem->assoc_index = htobe32(i); + break; + } + + free(assoc_prop); + return; +} + /** * update_drconf_node * @brief update the ibm,dynamic-memory property for added/removed memory @@ -580,10 +630,12 @@ update_drconf_node(struct dr_node *lmb, struct lmb_list_head *lmb_list, continue; } - if (action == ADD) + if (action == ADD) { drmem->flags |= be32toh(DRMEM_ASSIGNED); - else + update_drconf_affinity(lmb, drmem); + } else { drmem->flags &= be32toh(~DRMEM_ASSIGNED); + } break; } @@ -660,6 +712,12 @@ add_device_tree_lmb(struct dr_node *lmb, struct lmb_list_head *lmb_list) { int rc; + lmb->lmb_of_node = configure_connector(lmb->drc_index); + if (lmb->lmb_of_node == NULL) { + release_drc(lmb->drc_index, MEM_DEV); + return -1; + } + if (lmb_list->drconf_buf) { errno = 0; rc = update_drconf_node(lmb, lmb_list, ADD); @@ -672,11 +730,6 @@ add_device_tree_lmb(struct dr_node *lmb, struct lmb_list_head *lmb_list) */ say(DEBUG, "Assuming older kernel, trying to add " "node\n"); - lmb->lmb_of_node = configure_connector(lmb->drc_index); - if (lmb->lmb_of_node == NULL) { - release_drc(lmb->drc_index, MEM_DEV); - return -1; - } sprintf(lmb->ofdt_path, "%s/%s", OFDT_BASE, lmb->lmb_of_node->name); @@ -687,11 +740,6 @@ add_device_tree_lmb(struct dr_node *lmb, struct lmb_list_head *lmb_list) } } else { /* Add the new nodes to the device tree */ - lmb->lmb_of_node = configure_connector(lmb->drc_index); - if (lmb->lmb_of_node == NULL) { - release_drc(lmb->drc_index, MEM_DEV); - return -1; - } sprintf(lmb->ofdt_path, "%s/%s", OFDT_BASE, lmb->lmb_of_node->name); rc = add_device_tree_nodes(OFDT_BASE, lmb->lmb_of_node); |
From: Nathan F. <nf...@li...> - 2015-05-14 16:31:20
|
This patch adds additional information to the output produced by the lsslot command for dynamic reconfiguration memory. The default output with this patch will add the address, drc index, and associativity for each LMB. #> lsslot -c mem Dynamic Reconfiguration Memory (LMB size 0x10000000) LMB2: DRC Index: 80000001 Address: 10000000 Removable: Yes Associativity: (index: 1) 0 1 2 2 Section(s): 1 -- snip -- Additionally, this patch allows users to specify the -d 4 option to lsslot for memory which will print information about all possible LMBs, not just the LMBs owned by the system. This patch also adds the ability to print the information for a specific LMB by specifyinf its drc index with the -s option. #> lsslot -c mem -s 0x80000011 Dynamic Reconfiguration Memory (LMB size 0x10000000) LMB191: DRC Index: 800000be Address: be0000000 Removable: No Associativity: (index: 1) 0 1 2 2 Section(s): 190 Signed-off-by: Nathan Fontenot <nf...@li...> --- Updates for v2: - Added documentation updates to man page and lsslot usage. - Reduced the lines per lmb output man/lsslot.8 | 8 ++- src/drmgr/drslot_chrp_mem.c | 1 src/drmgr/lsslot.c | 136 +++++++++++++++++++++++++++++++++++-------- src/drmgr/ofdt.h | 2 + 4 files changed, 118 insertions(+), 29 deletions(-) diff --git a/man/lsslot.8 b/man/lsslot.8 index 7e87bf1..684d4fe 100644 --- a/man/lsslot.8 +++ b/man/lsslot.8 @@ -35,8 +35,9 @@ Display occupied slots, valid for "pci" slots only. .B \-p Display caches, valid for "cpu" slots only. .TP -.B \-s <slot> -Display characteristics of the specified slot. +.B \-s [<slot> | <drc index>] +Display characteristics of the specified slot or the LMB with the specified +drc index. .TP .B \-F <delimiter> Specified a single character to delimit the output. The @@ -44,7 +45,8 @@ heading is not displayed and the columns are delimited by the specified character. .TP .B \-d -Enable debugging output. +Enable debugging output. When displaying memory information this flag will +also enable printing information about LMBs not currently owned by the system. .TP .B \-w <timeout> Specify a timeout when attempting to acquire locks. diff --git a/src/drmgr/drslot_chrp_mem.c b/src/drmgr/drslot_chrp_mem.c index 02ca978..0a5b84e 100644 --- a/src/drmgr/drslot_chrp_mem.c +++ b/src/drmgr/drslot_chrp_mem.c @@ -313,6 +313,7 @@ get_dynamic_reconfig_lmbs(struct lmb_list_head *lmb_list) sprintf(lmb->ofdt_path, DYNAMIC_RECONFIG_MEM); lmb->lmb_size = lmb_sz; lmb->lmb_address = be64toh(drmem->address); + lmb->lmb_aa_index = be32toh(drmem->assoc_index); if (be32toh(drmem->flags) & DRMEM_ASSIGNED) { found++; diff --git a/src/drmgr/lsslot.c b/src/drmgr/lsslot.c index 22d1346..629a230 100644 --- a/src/drmgr/lsslot.c +++ b/src/drmgr/lsslot.c @@ -64,16 +64,20 @@ usage(void) "\"pci\" slots only.\n"); fprintf(stderr, " -p Display caches, valid for \"cpu\" " "slots only.\n"); - fprintf(stderr, " -s <slot>\n"); + fprintf(stderr, " -s [<slot> | <drc index>]\n"); fprintf(stderr, " Display characteristics of the " - "specified slot.\n"); + "specified slot or the LMB\n"); + fprintf(stderr, " associated with drc index.\n"); fprintf(stderr, " -F <delimiter>\n"); fprintf(stderr, " Specified a single character to " "delimit the output. The \n"); fprintf(stderr, " heading is not displayed and the " "columns are delimited by the\n"); fprintf(stderr, " specified character.\n"); - fprintf(stderr, " -d Enable debugging output.\n"); + fprintf(stderr, " -d Enable debugging output. When " + "displaying LMB information\n"); + fprintf(stderr, " this will enable printing of LMBs " + "not owned by the system.\n"); fprintf(stderr, " -w <timeout>\n"); fprintf(stderr, " Specify a timeout when attempting to " "acquire locks.\n"); @@ -699,8 +703,88 @@ lsslot_chrp_phb(struct cmd_opts *opts) return 0; } +int print_drconf_mem(struct cmd_opts *opts, struct lmb_list_head *lmb_list) +{ + struct dr_node *lmb; + struct mem_scn *scn; + int scn_offset = strlen("/sys/devices/system/memory/memory"); + char *aa_buf; + __be32 *aa; + int aa_size, aa_list_sz; + int i, rc; + uint32_t drc_index = 0; + + aa_size = get_property_size(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays"); + aa_buf = zalloc(aa_size); + rc = get_property(DYNAMIC_RECONFIG_MEM, + "ibm,associativity-lookup-arrays", aa_buf, aa_size); + if (rc) { + say(ERROR, "Could not get associativity information.\n"); + return -1; + } + + aa = (__be32 *)aa_buf; + /* skip past the number of associativity lists */ + aa++; + aa_list_sz = be32toh(*aa++); + + if (opts->s_name) + drc_index = strtol(opts->s_name, NULL, 0); + + printf("Dynamic Reconfiguration Memory (LMB size 0x%x)\n", + lmb_list->lmbs->lmb_size); + + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; + int aa_start, aa_end; + + if (drc_index && drc_index != lmb->drc_index) + continue; + else if ((output_level < 4) && !lmb->is_owned) + continue; + + printf("%s: %s\n", lmb->drc_name, + lmb->is_owned ? "" : "Not Owned"); + + printf(" DRC Index: %x Address: %lx\n", + lmb->drc_index, lmb->lmb_address); + printf(" Removable: %s Associativity: ", + lmb->is_removable ? "Yes" : "No "); + + if (lmb->lmb_aa_index == 0xffffffff) { + printf("Not Set\n"); + } else { + printf("(index: %d) ", lmb->lmb_aa_index); + aa_start = lmb->lmb_aa_index * aa_list_sz; + aa_end = aa_start + aa_list_sz; + for (i = aa_start; i < aa_end; i++) + printf("%d ", be32toh(aa[i])); + printf("\n"); + } + + if (lmb->is_owned) { + printf(" Section(s):"); + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } + + printf("\n"); + } + } + + free(aa_buf); + return 0; +} + int -lsslot_chrp_mem(void) +lsslot_chrp_mem(struct cmd_opts *opts) { struct lmb_list_head *lmb_list; struct dr_node *lmb; @@ -712,40 +796,40 @@ lsslot_chrp_mem(void) if (lmb_list == NULL || lmb_list->lmbs == NULL) return -1; - printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); if (lmb_list->drconf_buf) { - printf("ibm,dynamic-reconfiguration-memory\n"); - printf("%-5s %c %s\n", "Name", 'R', "Sections"); - printf("%-5s %c %s\n", "----", '-', "--------"); + print_drconf_mem(opts, lmb_list); } else { + printf("lmb size: 0x%x\n", lmb_list->lmbs->lmb_size); printf("%-20s %-5s %c %s\n", "Memory Node", "Name", 'R', "Sections"); printf("%-20s %-5s %c %s\n", "-----------", "----", '-', "--------"); - } - for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { - int first = 1; + for (lmb = lmb_list->lmbs; lmb; lmb = lmb->next) { + int first = 1; - if (!lmb->is_owned) - continue; + if (!lmb->is_owned) + continue; - if (!lmb_list->drconf_buf) - printf("%-20s ", &lmb->ofdt_path[lmb_offset]); + if (!lmb_list->drconf_buf) + printf("%-20s ", &lmb->ofdt_path[lmb_offset]); - printf("%-5s %c ", lmb->drc_name, - lmb->is_removable ? 'Y' : 'N'); + printf("%-5s %c ", lmb->drc_name, + lmb->is_removable ? 'Y' : 'N'); - for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { - if (first) { - printf(" %s", &scn->sysfs_path[scn_offset]); - first = 0; - } else - printf(", %s", &scn->sysfs_path[scn_offset]); - } + for (scn = lmb->lmb_mem_scns; scn; scn = scn->next) { + if (first) { + printf(" %s", + &scn->sysfs_path[scn_offset]); + first = 0; + } else + printf(", %s", + &scn->sysfs_path[scn_offset]); + } - printf("\n"); + printf("\n"); + } } free_lmbs(lmb_list); @@ -888,7 +972,7 @@ main(int argc, char *argv[]) break; case MEM: - rc = lsslot_chrp_mem(); + rc = lsslot_chrp_mem(&opts); break; case PORT: diff --git a/src/drmgr/ofdt.h b/src/drmgr/ofdt.h index 954377b..c728507 100644 --- a/src/drmgr/ofdt.h +++ b/src/drmgr/ofdt.h @@ -77,12 +77,14 @@ struct dr_node { struct mem_info { uint64_t _address; uint32_t _lmb_size; + uint32_t _lmb_aa_index; struct mem_scn *_mem_scns; struct of_node *_of_node; } _smem; #define lmb_address _node_u._smem._address #define lmb_size _node_u._smem._lmb_size +#define lmb_aa_index _node_u._smem._lmb_aa_index #define lmb_mem_scns _node_u._smem._mem_scns #define lmb_of_node _node_u._smem._of_node |
From: Kamalesh B. <kam...@li...> - 2015-05-14 15:47:52
|
On 05/14/2015 04:29 PM, Naveen N. Rao wrote: >> Teach snap to ignore deprecated sysctl network files, while >> >gathering information from /proc. Reading deprecated file, >> >throws warnings in /var/log/message like: >> >kernel: process `snap' is using deprecated sysctl (syscall) >> >net.ipv6.neigh.default.retrans_time; Use net.ipv6.neigh.default.retrans_time_ms instead.` > Are you sure you want to ignore these just to prevent those warnings? > Those could still be used by older applications and kernel will still > effect changes based on these. Both retrans_time and retrans_time_ms behave synonymously. i.e., if you modify one file the value gets reflected in another. We can avoid the warning from snap, by copying the non deprecated version and still we could have the required debugging information. Thanks,, Kamalesh. |
From: Naveen N. R. <nav...@li...> - 2015-05-14 11:00:49
|
On 2015/05/14 01:46PM, Kamalesh Babulal wrote: > Teach snap to ignore deprecated sysctl network files, while > gathering information from /proc. Reading deprecated file, > throws warnings in /var/log/message like: > kernel: process `snap' is using deprecated sysctl (syscall) > net.ipv6.neigh.default.retrans_time; Use net.ipv6.neigh.default.retrans_time_ms instead.` Are you sure you want to ignore these just to prevent those warnings? Those could still be used by older applications and kernel will still effect changes based on these. - Naveen |