Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2957458pxu; Mon, 7 Dec 2020 22:49:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJyNxbV3P/YREjJOsqmi+jZHejB4k6jqQpxfh/UQRbcAXdHMDGG+bfgdbNQVxwL9B3oci2Dh X-Received: by 2002:a17:906:ce23:: with SMTP id sd3mr22257500ejb.69.1607410169586; Mon, 07 Dec 2020 22:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607410169; cv=none; d=google.com; s=arc-20160816; b=xCq4oc6Ezb8zAIWfXyQ0PHPX1zIyhtS5xZklpreN8dnkgD2mlSo0iVAdESK72cFNsX Q+OiAEXdvEtanS6SUFwVtk4eZsgPKwu6C7tcGfuzuf6gTrVVo2sdep1QkC30uWOqVuwY OMhEBOMeIWn//nZeIGRGwo+WVweNMeYOrkqDvlcdf2D8I8RZjLdiegQQ2TTYqNJdse0n esmm2xEYzqB5nW7vuv5WMXFhEWA/d3TyasENXga1vyikfG1gHN7OZtY+vl/OuNW52Owr 3VhNOwQrwOsJkryw6LTxDtCO3jUVIN3ZobMUbY3mnx/jvCTGEcBSPDvwZfywiNucHftW eq7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=Lvd8cAzLDH8LJeAK8mPGrN7H1Kgg3IA2DbLYAuXC140=; b=He+gqY+8iI3p5G67L4pGHwz9V9g9qYO/no8Kaxkf8CjeQOMBtkSz1kqjsSFLirM0cW dbaUn+DAzqDiXGaLqZQ0Xy8IviUO2ChR8Tv23/1SopyVXZzYi87L6dF8/9Ax/Ttw037U 5dn5dl+qJqSkLpJMZvrNzyIpBUTqAX0XQVE/sXo3AI+qFHOpwfizabcRDpsi4yVTgJWz 5Bm3xj2JlbxgkjXrCSj+l1I9mRR+Nmcf4cq+uZ6Jy/HyDdGWlSEuRiatg2MLHOO+1zZO 8t/kjXtN4FeF9xa/bRuy1k3J5mGUTtZwnwYbrxUcXjsG0dreEmJu9FSNJUKVN8/yNh3F wHdQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z14si714177edr.470.2020.12.07.22.49.07; Mon, 07 Dec 2020 22:49:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726645AbgLHGrR (ORCPT + 99 others); Tue, 8 Dec 2020 01:47:17 -0500 Received: from [157.25.102.26] ([157.25.102.26]:59082 "EHLO orcam.me.uk" rhost-flags-FAIL-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726104AbgLHGrQ (ORCPT ); Tue, 8 Dec 2020 01:47:16 -0500 Received: from bugs.linux-mips.org (eddie.linux-mips.org [IPv6:2a01:4f8:201:92aa::3]) by orcam.me.uk (Postfix) with ESMTPS id 1CB4A2BE0EC; Tue, 8 Dec 2020 06:46:44 +0000 (GMT) Date: Tue, 8 Dec 2020 06:46:41 +0000 (GMT) From: "Maciej W. Rozycki" To: Jinyang He cc: Thomas Bogendoerfer , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] MIPS: KASLR: Fix sync_icache() trapped in loop when synci_step is zero In-Reply-To: <642b9149-6de5-fa04-80e2-aed7367b3cce@loongson.cn> Message-ID: References: <1606878005-11427-1-git-send-email-hejinyang@loongson.cn> <20201202103943.GA9065@alpha.franken.de> <642b9149-6de5-fa04-80e2-aed7367b3cce@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 3 Dec 2020, Jinyang He wrote: > Thus, only one synci operation is required when synci_step is 0 > on Loongson64 platform. I guess that some other platforms have > similar implementations on synci, so add judgment conditions in > `while` to ensure that at least all platforms perform synci > operations once. For those platforms that do not need synci, > they just do one more operation similar to nop. This is non-compliant and looks to me like a risky choice for what was invented to guarantee portability across all MIPS systems. Compliant software will fail with Loongson64 processors unless patched like this piece, and you don't really have control over all user software out there (I would expect issues with JIT engines and the like). If only a single SYNCI operation is ever required why wasn't SYNCI_Step set to some large value instead that would in reality prevent looping over SYNCI from happening? Maciej