From patchwork Mon Feb 13 03:30:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suraj Jitindar Singh X-Patchwork-Id: 9568729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6DDB86045D for ; Mon, 13 Feb 2017 03:31:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56A4527FB0 for ; Mon, 13 Feb 2017 03:31:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4A9D328159; Mon, 13 Feb 2017 03:31:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id CBA5D27FB0 for ; Mon, 13 Feb 2017 03:31:24 +0000 (UTC) Received: from localhost ([::1]:54333 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd7MI-00028o-3I for patchwork-qemu-devel@patchwork.kernel.org; Sun, 12 Feb 2017 22:31:22 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41539) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd7Lt-00026g-I2 for qemu-devel@nongnu.org; Sun, 12 Feb 2017 22:30:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cd7Ls-0004iT-Hr for qemu-devel@nongnu.org; Sun, 12 Feb 2017 22:30:57 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:35292) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cd7Ln-0004hB-Q8; Sun, 12 Feb 2017 22:30:51 -0500 Received: by mail-pg0-x241.google.com with SMTP id 204so8561184pge.2; Sun, 12 Feb 2017 19:30:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=cFbjmCsIA5AkuHsx3A+oowp/4BUifWskLZ54Ijnun4Q=; b=TC5vV/q2ElbHCapjJgp168FPeUiqpJgHT4YvWO11oPmK/leRsf9mFysMTtABQHP5P7 OI3W7hhYRR0OvkyBabQxA8Ox724zjDpFv4Itw9ZAZoTvqw+ewUqYQnhkNcHcllrQl9Oz r46wkAZUTrEUJ4sF4juiBf9c9zYRcEBVn61nyzS+XYu2zWMdwANbpNWZdT5W+Da9G/OC eEymwex61qSNQzmoybOE11kQZbRWLMT0R8oqu6yLqvGOu7aUE0O9Da7ZYzeJlmmS3cYQ qfy66rtl5lgaKKeTJ6+Yn58zGp2UVWTKImsuX4Wf3xG2f3xxT3IUGZoNFrKAiDOqgGue F3+A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=cFbjmCsIA5AkuHsx3A+oowp/4BUifWskLZ54Ijnun4Q=; b=fEe6bJXZNqWVW/tS+RTz1yDBHbbeRYX77oJzJHbZHU0Y0E5WTaRiIW+VYoEUGAHc4I ft2KH1V1bNG1yF4z/XhtfAaT9U3Db6TJb372AInrmQtRTu4MnEylW5i/EeOVnnnAljqW vZLk45Aj3CszA2icwx2T/xYBs07u/doukWZhu4kUSakLF2epZxNQ7pgNLgjJTyzPio3E A5/t41CmBUgATuEeonPI/Za4bFFNoI3vMzO+jPOPyzPDyIt8ZR4ZswpiMJbHwocen1P9 Q2u+q2DSDyZO3CgXEHcFV6GPkkMaOEapewWUlTkAWTH4jfCxHvxizwsHA/HCH2fhcgbZ qtEQ== X-Gm-Message-State: AMke39k6UkMEFgCDO59/MMkDhxbBuJCL8AD1px0j+CgNEXU+goYdsAihdURXrX1iYbkFIQ== X-Received: by 10.99.8.194 with SMTP id 185mr24773224pgi.76.1486956649367; Sun, 12 Feb 2017 19:30:49 -0800 (PST) Received: from surajjs.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id m6sm17241720pfm.22.2017.02.12.19.30.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Feb 2017 19:30:48 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 13 Feb 2017 14:30:27 +1100 Message-Id: <1486956627-11123-1-git-send-email-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.5.5 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [Qemu-ppc] [PATCH] target/ppc: Stop parsing pvr list in H_CAS when exact match found X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: agraf@suse.de, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The pvr-list passed in H_Client_Architecture_Support is used to communicate the supported pvrs of the client program. When an exact match is found you are allowed to stop parsing the list and continue the boot process. Currently while explicit_match is set when we find an exact match, we still set a compat mode based on best_compat irrespective of whether an exact match was found or not. This is wrong since it means we can only ever run in an architected state, not a raw state since we always set a compat mode. We are basically ignoring the case were we find an exact match. Fix the code to stop parsing the pvr list when an exact match is found. This means that best_compat will always be zero in the case of an exact match which means we will not set a compat mode an thus run in raw mode, which is the desired functionality when we have an exact match. Fixes: 152ef803ceb1 ("pseries: Rewrite CAS PVR compatibility logic") Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr_hcall.c | 1 + 1 file changed, 1 insertion(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 590105a..215c385 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1028,6 +1028,7 @@ static target_ulong h_client_architecture_support(PowerPCCPU *cpu, if ((cpu->env.spr[SPR_PVR] & pvr_mask) == (pvr & pvr_mask)) { explicit_match = true; + break; } else { if (ppc_check_compat(cpu, pvr, best_compat, max_compat)) { best_compat = pvr;