From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8F9A1C43467 for ; Mon, 12 Oct 2020 13:58:49 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8A65C2080D for ; Mon, 12 Oct 2020 13:58:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=axtens.net header.i=@axtens.net header.b="i6WKsPqg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8A65C2080D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4C90dc2dnYzDqcL for ; Tue, 13 Oct 2020 00:58:44 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=axtens.net (client-ip=2607:f8b0:4864:20::444; helo=mail-pf1-x444.google.com; envelope-from=dja@axtens.net; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=axtens.net Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=axtens.net header.i=@axtens.net header.a=rsa-sha256 header.s=google header.b=i6WKsPqg; dkim-atps=neutral Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4C90KG0N16zDqFh for ; Tue, 13 Oct 2020 00:44:33 +1100 (AEDT) Received: by mail-pf1-x444.google.com with SMTP id n14so13547056pff.6 for ; Mon, 12 Oct 2020 06:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=JVO7BM4liPODbMvZybShk9kUG4Gu+5T3+lghusytKic=; b=i6WKsPqgXmFIgN/wf/I5/sU3rUCFxp4PnlH5lV5oIaARcKa5Qo26uOUNHzR+uwpF8L 0hDgOrjH2JQ+Xu+YssrUvSA3qmK8HD/DOkwzEyI+fccqOHkPmIa+nlIht9LUGXu1ihLA 4W6ob9nHXqX0SNOfQqQdYxkvbg49csqR/lHa0= 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:in-reply-to:references:date :message-id:mime-version; bh=JVO7BM4liPODbMvZybShk9kUG4Gu+5T3+lghusytKic=; b=lnjQiRN+PSvpZlKfnRyN+zqN9cycEGDZF7mKgmarqOyFqnZnfK83HqGOub4u1k8f2+ TkhMIxEPxOa2+ov/sGpavZgVawV/Sc7wn3/kz8/xs7y1MQ3mlenTixudq1Zg2aU0SA3k fanC6F5DmMqbFlhJK3+i/1Q5wjG+XJt49Kb6otGZjJ57p9OaFRvCtadSNaWKw0eriASz /jyOTcQWt71tb1rloCUl8I4g6Ia/HyKccEEWLeJBjq0uHaDdipi60aOpdsEI2aveZMCQ tqqte9cIERZRBctkcWZ8T0WjRuCy/d3tQOvOC2oFW4QjK4BsZk9aC2iNML414Fhxt07d yX7w== X-Gm-Message-State: AOAM5328C51wf+BuWJNgIGZf8uEQHAnGHxAybu32+mhlFQxf5Ztc/UZi DG8FxUYV+YxPWMqfUhnWgNOyXw== X-Google-Smtp-Source: ABdhPJzttQpQfEQykQ/3IKzWpnneq1hHE0v90amxbj6PjGQgy6a0aKrMQUXpCGBT6zVLSKR+k1ETrA== X-Received: by 2002:a17:90a:c58f:: with SMTP id l15mr12618238pjt.93.1602510258667; Mon, 12 Oct 2020 06:44:18 -0700 (PDT) Received: from localhost (2001-44b8-111e-5c00-0872-db87-61b3-e44b.static.ipv6.internode.on.net. [2001:44b8:111e:5c00:872:db87:61b3:e44b]) by smtp.gmail.com with ESMTPSA id c3sm20068219pfn.23.2020.10.12.06.44.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Oct 2020 06:44:18 -0700 (PDT) From: Daniel Axtens To: Ravi Bangoria , mpe@ellerman.id.au Subject: Re: [PATCH v5 1/5] powerpc/sstep: Emulate prefixed instructions only when CPU_FTR_ARCH_31 is set In-Reply-To: <20201011050908.72173-2-ravi.bangoria@linux.ibm.com> References: <20201011050908.72173-1-ravi.bangoria@linux.ibm.com> <20201011050908.72173-2-ravi.bangoria@linux.ibm.com> Date: Tue, 13 Oct 2020 00:44:14 +1100 Message-ID: <877drvwocx.fsf@dja-thinkpad.axtens.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ravi.bangoria@linux.ibm.com, jniethe5@gmail.com, bala24@linux.ibm.com, paulus@samba.org, sandipan@linux.ibm.com, naveen.n.rao@linux.vnet.ibm.com, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Archived-At: List-Archive: Hi, To review this, I looked through the supported instructions to see if there were any that I thought might have been missed. I didn't find any other v3.1 ones, although I don't have a v3.1 ISA to hand so I was basically looking for instructions I didn't recognise. I did, however, find a number of instructions that are new in ISA 3.0 that aren't guarded: - addpcis - lxvl/stxvl - lxvll/stxvll - lxvwsx - stxvx - lxsipzx - lxvh8x - lxsihzx - lxvb16x/stxvb16x - stxsibx - stxsihx - lxvb16x - lxsd/stxsd - lxssp/stxssp - lxv/stxv Also, I don't know how bothered we are about P7, but if I'm reading the ISA correctly, lqarx/stqcx. are not supported before ISA 2.07. Likewise a number of the vector instructions like lxsiwzx and lxsiwax (and the companion stores). I realise it's not really the point of this particular patch, so I don't think this should block acceptance. What I would like to know - and maybe this is something where we need mpe to weigh in - is whether we need consistent guards for 2.07 and 3.0. We have some 3.0 guards already but clearly not everywhere. With all that said - the patch does what it says it does, and looks good to me: Reviewed-by: Daniel Axtens Kind regards, Daniel > From: Balamuruhan S > > Unconditional emulation of prefixed instructions will allow > emulation of them on Power10 predecessors which might cause > issues. Restrict that. > > Fixes: 3920742b92f5 ("powerpc sstep: Add support for prefixed fixed-point arithmetic") > Fixes: 50b80a12e4cc ("powerpc sstep: Add support for prefixed load/stores") > Signed-off-by: Balamuruhan S > Signed-off-by: Ravi Bangoria > --- > arch/powerpc/lib/sstep.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/arch/powerpc/lib/sstep.c b/arch/powerpc/lib/sstep.c > index e9dcaba9a4f8..e6242744c71b 100644 > --- a/arch/powerpc/lib/sstep.c > +++ b/arch/powerpc/lib/sstep.c > @@ -1346,6 +1346,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, > switch (opcode) { > #ifdef __powerpc64__ > case 1: > + if (!cpu_has_feature(CPU_FTR_ARCH_31)) > + return -1; > + > prefix_r = GET_PREFIX_R(word); > ra = GET_PREFIX_RA(suffix); > rd = (suffix >> 21) & 0x1f; > @@ -2733,6 +2736,9 @@ int analyse_instr(struct instruction_op *op, const struct pt_regs *regs, > } > break; > case 1: /* Prefixed instructions */ > + if (!cpu_has_feature(CPU_FTR_ARCH_31)) > + return -1; > + > prefix_r = GET_PREFIX_R(word); > ra = GET_PREFIX_RA(suffix); > op->update_reg = ra; > -- > 2.26.2