From nobody Thu Apr 25 20:09:13 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1486956729780736.0190796915903; Sun, 12 Feb 2017 19:32:09 -0800 (PST) Received: from localhost ([::1]:54334 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cd7N0-0002Uo-CN for importer@patchew.org; Sun, 12 Feb 2017 22:32:06 -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) 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) 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) 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+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" 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(Pow= erPCCPU *cpu, =20 if ((cpu->env.spr[SPR_PVR] & pvr_mask) =3D=3D (pvr & pvr_mask)) { explicit_match =3D true; + break; } else { if (ppc_check_compat(cpu, pvr, best_compat, max_compat)) { best_compat =3D pvr; --=20 2.5.5