aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorThomas Richter <[email protected]>2024-08-08 10:58:56 +0200
committerVasily Gorbik <[email protected]>2024-08-21 16:17:01 +0200
commit742a7557164bbde9f3263aeebc581fb985fe7dbc (patch)
treeefc2448681365329c344cecf42340e0f7c2d4225 /arch
parent073ef6b2041075e08c780db34f67e6daf884c9f8 (diff)
s390/cpum_sf: Ignore lsctl() return code in sf_disable()
sf_disable() returns the condition code of instruction lsctl (load sampling controls). However the parameter to lsctl() in sf_disable() is a sample control block containing all zeroes. This invocation of lsctl() does not fail and returns always zero even when there is no authorization for sampling on the machine. In short, sampling can be always turned off. Ignore the return code of sf_disable() and change the function return to void. Signed-off-by: Thomas Richter <[email protected]> Acked-by: Sumanth Korikkar <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Vasily Gorbik <[email protected]> Cc: Alexander Gordeev <[email protected]> Signed-off-by: Vasily Gorbik <[email protected]>
Diffstat (limited to 'arch')
-rw-r--r--arch/s390/kernel/perf_cpum_sf.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/s390/kernel/perf_cpum_sf.c b/arch/s390/kernel/perf_cpum_sf.c
index d87d58f2ec1b..13ab77e5ef21 100644
--- a/arch/s390/kernel/perf_cpum_sf.c
+++ b/arch/s390/kernel/perf_cpum_sf.c
@@ -170,12 +170,12 @@ static inline unsigned long *get_next_sdbt(unsigned long *s)
/*
* sf_disable() - Switch off sampling facility
*/
-static int sf_disable(void)
+static void sf_disable(void)
{
struct hws_lsctl_request_block sreq;
memset(&sreq, 0, sizeof(sreq));
- return lsctl(&sreq);
+ lsctl(&sreq);
}
/*
@@ -620,13 +620,12 @@ static void setup_pmc_cpu(void *flags)
if (err)
break;
cpuhw->flags |= PMU_F_RESERVED;
- err = sf_disable();
+ sf_disable();
break;
case PMC_RELEASE:
cpuhw->flags &= ~PMU_F_RESERVED;
- err = sf_disable();
- if (!err)
- deallocate_buffers(cpuhw);
+ sf_disable();
+ deallocate_buffers(cpuhw);
break;
}
if (err) {