Thread (31 messages) 31 messages, 4 authors, 2018-11-20

Re: [PATCH v7 03/13] arch/x86: Re-arrange RDT init code

From: Borislav Petkov <bp@alien8.de>
Date: 2018-11-14 19:05:50
Also in: lkml

On Fri, Nov 09, 2018 at 08:52:29PM +0000, Moger, Babu wrote:
quoted hunk ↗ jump to hunk
Separate the call sequence for rdt_quirks and MBA feature.
This is in preparation to handle vendor differences in these
call sequences.

Signed-off-by: Babu Moger <babu.moger@amd.com>
---
 arch/x86/kernel/cpu/resctrl.c | 29 +++++++++++++++++++++++------
 1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/arch/x86/kernel/cpu/resctrl.c b/arch/x86/kernel/cpu/resctrl.c
index 5d526dc45751..fd5320dddddc 100644
--- a/arch/x86/kernel/cpu/resctrl.c
+++ b/arch/x86/kernel/cpu/resctrl.c
@@ -794,6 +794,16 @@ static bool __init rdt_cpu_has(int flag)
 	return ret;
 }
 
+static __init bool rdt_mba_config(void)
+{
+	if (rdt_cpu_has(X86_FEATURE_MBA)) {
+		if (rdt_get_mem_config(&rdt_resources_all[RDT_RESOURCE_MBA]))
+			return true;
Or simpler:

        if (rdt_cpu_has(X86_FEATURE_MBA))
                return rdt_get_mem_config(&rdt_resources_all[RDT_RESOURCE_MBA]);

        return false;

as rdt_get_mem_config() already returns bool.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help