From: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, mpe@ellerman.id.au, msuchanek@suse.de
Subject: [TESTS] Create 'enabled_flush_types' boot option, and short-circuit LPM
Date: Wed, 14 Mar 2018 19:40:43 -0300 [thread overview]
Message-ID: <1521067243-19520-7-git-send-email-mauricfo@linux.vnet.ibm.com> (raw)
In-Reply-To: <1521067243-19520-1-git-send-email-mauricfo@linux.vnet.ibm.com>
fallback -> fallback:
# dmesg -c | grep rfi-flush
[ 0.000000] rfi-flush (debug): enabled flush types: 0x0
[ 0.000000] rfi-flush: fallback displacement flush available
[ 0.000000] rfi-flush: patched 8 locations (fallback displacement flush)
# echo > /sys/kernel/mobility/migration
# dmesg -c | grep rfi-flush
[ 32.525443] rfi-flush: fallback displacement flush available
[ 32.526269] rfi-flush: patched 8 locations (fallback displacement flush)
fallback -> instructions:
# dmesg -c | grep rfi-flush
[ 0.000000] rfi-flush (debug): enabled flush types: 0x0
[ 0.000000] rfi-flush: fallback displacement flush available
[ 0.000000] rfi-flush: patched 8 locations (fallback displacement flush)
# echo 24 > /sys/kernel/debug/powerpc/rfi_flush
# dmesg -c | grep rfi-flush
[ 30.984247] rfi-flush (debug): enabled flush types: 0xc
# echo > /sys/kernel/mobility/migration
# dmesg -c | grep rfi-flush
[ 51.554357] rfi-flush: fallback displacement flush available
[ 51.554360] rfi-flush: ori type flush available
[ 51.554361] rfi-flush: mttrig type flush available
[ 51.554366] rfi-flush: patched 8 locations (ori+mttrig type flush)
instructions -> instructions:
# dmesg -c | grep rfi-flush
[ 0.000000] rfi-flush (debug): enabled flush types: 0xc
[ 0.000000] rfi-flush: fallback displacement flush available
[ 0.000000] rfi-flush: ori type flush available
[ 0.000000] rfi-flush: mttrig type flush available
[ 0.000000] rfi-flush: patched 8 locations (ori+mttrig type flush)
# echo > /sys/kernel/mobility/migration
# dmesg -c | grep rfi-flush
[ 55.100566] rfi-flush: fallback displacement flush available
[ 55.100570] rfi-flush: ori type flush available
[ 55.100571] rfi-flush: mttrig type flush available
[ 55.100575] rfi-flush: patched 8 locations (ori+mttrig type flush)
instructions -> fallback:
# dmesg -c | grep rfi-flush
[ 0.000000] rfi-flush (debug): enabled flush types: 0xc
[ 0.000000] rfi-flush: fallback displacement flush available
[ 0.000000] rfi-flush: ori type flush available
[ 0.000000] rfi-flush: mttrig type flush available
[ 0.000000] rfi-flush: patched 8 locations (ori+mttrig type flush)
# echo 1111 > /sys/kernel/debug/powerpc/rfi_flush
# dmesg -c | grep rfi-flush
[ 18.730782] rfi-flush (debug): enabled flush types: 0x0
# echo > /sys/kernel/mobility/migration
# dmesg -c | grep rfi-flush
[ 27.120071] rfi-flush: fallback displacement flush available
[ 27.120078] rfi-flush: patched 8 locations (fallback displacement flush)
debugfs switch:
# echo 0 > /sys/kernel/debug/powerpc/rfi_flush
# echo 1 > /sys/kernel/debug/powerpc/rfi_flush
# dmesg -c | grep rfi-flush
[ 106.031993] rfi-flush: patched 8 locations (no flush)
[ 109.670966] rfi-flush: patched 8 locations (fallback displacement flush)
ori type only:
# echo 8 > /sys/kernel/debug/powerpc/rfi_flush
# echo 0 > /sys/kernel/debug/powerpc/rfi_flush
# echo 1 > /sys/kernel/debug/powerpc/rfi_flush
# dmesg -c | grep rfi-flush
[ 308.988958] rfi-flush (debug): enabled flush types: 0x4
[ 314.206548] rfi-flush: patched 8 locations (no flush)
[ 316.349916] rfi-flush: patched 8 locations (ori type flush)
mttrig type only:
# echo 16 > /sys/kernel/debug/powerpc/rfi_flush
# echo 0 > /sys/kernel/debug/powerpc/rfi_flush
# echo 1 > /sys/kernel/debug/powerpc/rfi_flush
# dmesg -c | grep rfi-flush
[ 355.993189] rfi-flush (debug): enabled flush types: 0x8
[ 360.644291] rfi-flush: patched 8 locations (no flush)
[ 365.300547] rfi-flush: patched 8 locations (mttrig type flush)
Signed-off-by: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
---
arch/powerpc/kernel/setup_64.c | 29 +++++++++++++++++++++++++++++
arch/powerpc/platforms/pseries/mobility.c | 4 ++++
2 files changed, 33 insertions(+)
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 4ec4a27..9c9568e 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -816,6 +816,24 @@ static void *l1d_flush_fallback_area;
static bool no_rfi_flush;
bool rfi_flush;
+static int __init handle_enabled_flush_types(char *p)
+{
+ int rc;
+ enum l1d_flush_type types;
+
+ rc = kstrtoul(p, 0, (long unsigned int *)&types);
+ if (!rc) {
+ enabled_flush_types = types;
+ pr_info("rfi-flush (debug): enabled flush types: 0x%x\n", enabled_flush_types);
+ } else {
+ enabled_flush_types = L1D_FLUSH_NONE;
+ pr_info("rfi-flush (debug): enabled flush types is invalid\n");
+ }
+
+ return rc;
+}
+early_param("enabled_flush_types", handle_enabled_flush_types);
+
static int __init handle_no_rfi_flush(char *p)
{
pr_info("rfi-flush: disabled on command line.");
@@ -883,6 +901,8 @@ static void init_fallback_flush(void)
void setup_rfi_flush(enum l1d_flush_type types, bool enable)
{
+ types |= enabled_flush_types;
+
if (types & L1D_FLUSH_FALLBACK) {
pr_info("rfi-flush: fallback displacement flush available\n");
init_fallback_flush();
@@ -909,6 +929,15 @@ static int rfi_flush_set(void *data, u64 val)
enable = true;
else if (val == 0)
enable = false;
+ else if (val == 1111) {
+ enable = true;
+ enabled_flush_types = 0;
+ pr_info("rfi-flush (debug): enabled flush types: 0x%x\n", enabled_flush_types);
+ } else if (val >= 2) {
+ enable = true;
+ enabled_flush_types = val >> 1;
+ pr_info("rfi-flush (debug): enabled flush types: 0x%x\n", enabled_flush_types);
+ }
else
return -EINVAL;
diff --git a/arch/powerpc/platforms/pseries/mobility.c b/arch/powerpc/platforms/pseries/mobility.c
index 8a8033a..2a8458a 100644
--- a/arch/powerpc/platforms/pseries/mobility.c
+++ b/arch/powerpc/platforms/pseries/mobility.c
@@ -326,6 +326,7 @@ int pseries_devicetree_update(s32 scope)
void post_mobility_fixup(void)
{
+#if 0
int rc;
int activate_fw_token;
@@ -348,6 +349,7 @@ void post_mobility_fixup(void)
printk(KERN_ERR "Post-mobility device tree update "
"failed: %d\n", rc);
+#endif
/* Possibly switch to a new RFI flush type */
pseries_setup_rfi_flush();
@@ -358,6 +360,7 @@ static ssize_t migration_store(struct class *class,
struct class_attribute *attr, const char *buf,
size_t count)
{
+#if 0
u64 streamid;
int rc;
@@ -374,6 +377,7 @@ static ssize_t migration_store(struct class *class,
if (rc)
return rc;
+#endif
post_mobility_fixup();
return count;
}
--
2.7.4
prev parent reply other threads:[~2018-03-14 22:41 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-14 22:40 [PATCH v3 0/5] Setup RFI flush after PowerVM LPM migration Mauricio Faria de Oliveira
2018-03-14 22:40 ` [PATCH v3 1/5] rfi-flush: Move the logic to avoid a redo into the debugfs code Mauricio Faria de Oliveira
2018-03-15 20:36 ` Murilo Opsfelder Araujo
2018-03-16 8:52 ` Michal Suchánek
2018-03-16 16:42 ` Mauricio Faria de Oliveira
2018-03-28 14:13 ` [v3, " Michael Ellerman
2018-03-14 22:40 ` [PATCH v3 2/5] rfi-flush: Make it possible to call setup_rfi_flush() again Mauricio Faria de Oliveira
2018-03-14 22:40 ` [PATCH v3 3/5] rfi-flush: Always enable fallback flush on pseries Mauricio Faria de Oliveira
2018-03-14 22:40 ` [PATCH v3 4/5] rfi-flush: Differentiate enabled and patched flush types Mauricio Faria de Oliveira
2018-03-14 22:40 ` [PATCH v3 5/5] rfi-flush: Call setup_rfi_flush() after LPM migration Mauricio Faria de Oliveira
2018-03-14 22:40 ` Mauricio Faria de Oliveira [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1521067243-19520-7-git-send-email-mauricfo@linux.vnet.ibm.com \
--to=mauricfo@linux.vnet.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=msuchanek@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).