Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3413071pxb; Mon, 16 Nov 2020 14:06:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzomDRHgG/nCXPnaMj7wmTn0I3Yz0AD2fj1bUVxWI7H3Eo3JFiKAJHwIw7oBBpz5j86bfk8 X-Received: by 2002:a17:906:1390:: with SMTP id f16mr16718416ejc.504.1605564401444; Mon, 16 Nov 2020 14:06:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605564401; cv=none; d=google.com; s=arc-20160816; b=CrCcFWfYMRS020vcydEm6xphnYVcb8JT7yQIcb3Nu7xqA6iKHxjlB/48+M+PhHlsCa rwxS15d7wFHU8jzhXuX5Z3g824ckITTLQ9sX7itzkNutiMvL+e3RFsfJ5yj8ggHRMo+p 2U0eIDDLnzrd+n7iZShdldsXI84zfSWFURSRaCXR8KNehLVLjm7I9yQ32ywM9KtByBJr DXWXb4zBQlYLAKcijVIDAGeLDN0j3fCktWafOONrFCFnYR6bHV/GPpfIklgl1dejbU6q RN+rW5nxR6jUwgpEZL/3sGyP/2hpZzVRq2b8xEKho/pVEdIh5DVwxAQKnVgJPWRVI/Hl WDHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=VkNULh6T8WGzhvvLk7gt6UgWlaPp9scoTi7y2EvfOrw=; b=WffVbIGu+d4fhsl5wAy5D9ndLABjVylABc1VEsY27SEUsmptE3q5wN2bdhuEVcU1UY ageSimzSLTqJwubQf+QAfv+xMg7WUjGFf29XChJxU14HU230wNzDiCDoWHVuNnjcHpOC PTcUOCXv8km/9kQdtNq3c0opovc/Jf6tDGnpoevICwO5h5jPKc25mPdHuoIHVu02c6Ys U/Cb2e5vIJKTTasldcAiwFMqz2HzgF8t2Vj5obXpYCSWWRvzD/P0Tff/GsFQxrh7Mgni sCZN9QbcqRVnmNnOykshsV1C0NQoT91lDsRIpYcnLmAyArKJH9t34q20xmO8f8PLlTsG KL9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KoYgKlns; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id rn17si14100311ejb.282.2020.11.16.14.06.19; Mon, 16 Nov 2020 14:06:41 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=KoYgKlns; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732148AbgKPUSe (ORCPT + 99 others); Mon, 16 Nov 2020 15:18:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732371AbgKPUQg (ORCPT ); Mon, 16 Nov 2020 15:16:36 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A5EC0613CF for ; Mon, 16 Nov 2020 12:16:36 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1605557794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VkNULh6T8WGzhvvLk7gt6UgWlaPp9scoTi7y2EvfOrw=; b=KoYgKlnsSI3ZVU0QCsl7GYWhd59PSz3fuP3NRLjGhrJcGZnQBvCxA8J5fh/I25gsJ527g3 PJFz+kB6UToF+2Al6TKqhjXBOoNnRUa8itFmGWM8G/L2ucx8EG607kO37YpFdR1PLx3L8p ohaXv8fAsfTXukEbM/Dq8nKsYQmfQS4DvgRcUpOeOFGmysRSGCIj+9hEnLAPllmDpFl2vv TY1CoSkLLjqUAmZlWHJ0Rzdz9K0yXpAb4Sg/6LjZr7Q6b2WaIEZ++PngpRlkV8/txPujf7 XQuolQbr6A1TGUxjlie4Etwr8ez4lKE/DaIauxU7jyaGg4XNtm7gFFZ79QYwWA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1605557794; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=VkNULh6T8WGzhvvLk7gt6UgWlaPp9scoTi7y2EvfOrw=; b=hg2rHj8mxp/rZKBA6gpK7SViC925O4JtN1IYdBpjroSdDPS8U+QQSzX/0DE2WPLpd3Mwu1 POSkX6rjSxf8TjBA== To: Max Filippov , linux-xtensa@linux-xtensa.org Cc: Chris Zankel , linux-kernel@vger.kernel.org, Max Filippov Subject: Re: [PATCH v2] xtensa/mm/highmem: Make generic kmap_atomic() work correctly In-Reply-To: <20201116193253.23875-1-jcmvbkbc@gmail.com> References: <20201116193253.23875-1-jcmvbkbc@gmail.com> Date: Mon, 16 Nov 2020 21:16:34 +0100 Message-ID: <87pn4dxdjx.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 16 2020 at 11:32, Max Filippov wrote: > From: Thomas Gleixner > > The conversion to the generic kmap_atomic() implementation missed the fact > that xtensa's fixmap works bottom up while all other implementations work > top down. There is no real reason why xtensa needs to work that way. > > Cure it by: > > - Using the generic fix_to_virt()/virt_to_fix() functions which work top > down > - Adjusting the mapping defines > - Using the generic index calculation for the non cache aliasing case > - Making the cache colour offset reverse so the effective index is correct > > While at it, remove the outdated and misleading comment above the fixmap > enum which originates from the initial copy&pasta of this code from i386. > > Reported-by: Max Filippov > Fixes: 629ed3f7dad2 ("xtensa/mm/highmem: Switch to generic kmap atomic") > Signed-off-by: Thomas Gleixner > Signed-off-by: Max Filippov > Tested-by: Max Filippov > --- > Changes v1->v2: > - fix off-by-one error in kmap_idx calculation Duh. Indeed. Thanks for following up and helping with this. Much appreciated! tglx