[Top] [All Lists]

Re: [PATCH 14/15] mips: panic if vector register partitioning is impleme

To: Paul Burton <>
Subject: Re: [PATCH 14/15] mips: panic if vector register partitioning is implemented
From: David Daney <>
Date: Mon, 27 Jan 2014 10:38:45 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=bN/sF58Hvq7WWdheuIJSKQ4kPHc95jc9I4fXzBQCMl8=; b=p1vMxWDoAD3e04+i6pf2GisgZLhj9ScAEKOB+MzH2mR05Lkc3YB2Jv1igcH37HT4sw CG9kfTuQ7sFxIqDSdW7qfpLd/KHkJ/nzE4r0d63jGIwMlo72h94D/de+cgKt97yWHZXy mO3bhJlB5tNhNcCTzmOSWFWdgqoWe2jLSfkT4nVyUfntZJt7GCxu9vENIS0co+xpQtFa 1UQb9/ity5U9T5K0RVp+tGooTIWBD3bjAafK5MhsyWx7VEgIfCc3o4bRr9PqQUWbiNg6 Z6MA5fpRM4iXcHpwp5x2+5GfvQ6mAEgsVYUJ7Kh1FCIEFR/ygGH2wEVIzG3mQjKGZzBp YPew==
In-reply-to: <>
List-archive: <>
List-help: <>
List-id: linux-mips <>
List-owner: <>
List-post: <>
List-software: Ecartis version 1.0.0
List-subscribe: <>
List-unsubscribe: <>
Original-recipient: rfc822;
References: <> <>
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7
On 01/27/2014 07:23 AM, Paul Burton wrote:
No current systems implementing MSA include support for vector register
partitioning which makes it somewhat difficult to implement support for
it in the kernel. Thus for the moment the kernel includes no such
support. However if the kernel were to be run on a system which
implemented register partitioning then it would not function correctly,
mishandling MSA disabled exceptions. Calling panic when run on a system
with vector register partitioning implemented ensures that we're not
caught out by this later but instead reminded to implement support once
such a system is available.

Signed-off-by: Paul Burton <>
  arch/mips/kernel/cpu-probe.c | 6 +++++-
  1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/arch/mips/kernel/cpu-probe.c b/arch/mips/kernel/cpu-probe.c
index 852e085..003ba3c 100644
--- a/arch/mips/kernel/cpu-probe.c
+++ b/arch/mips/kernel/cpu-probe.c
@@ -1193,9 +1193,13 @@ void cpu_probe(void)
                c->srsets = 1;

-       if (cpu_has_msa)
+       if (cpu_has_msa) {
                c->msa_id = cpu_get_msa_id();

+               if (c->msa_id & MSA_IR_WRPF)
+                       panic("Vector register partitioning unimplemented!");

You should probably use a WARN_ON() instead. There is no reason to crash the kernel for this condition is there?

+       }

  #ifdef CONFIG_64BIT

<Prev in Thread] Current Thread [Next in Thread>