From owner-freebsd-mips@freebsd.org Mon Aug 13 21:20:58 2018 Return-Path: Delivered-To: freebsd-mips@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D028C107E1AC for ; Mon, 13 Aug 2018 21:20:58 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: from mail-it0-x233.google.com (mail-it0-x233.google.com [IPv6:2607:f8b0:4001:c0b::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6A4768DD0E for ; Mon, 13 Aug 2018 21:20:58 +0000 (UTC) (envelope-from jason.harmening@gmail.com) Received: by mail-it0-x233.google.com with SMTP id d10-v6so15262968itj.5 for ; Mon, 13 Aug 2018 14:20:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=hACif/EM+6DM4YmpwKxfp6e/kUCUK94hGzlVOCndJAo=; b=tL99xz7OFgak8Qpf/EvcKC8VaAuiYte/UaRKTnMrruOGMa8vixuXZW1MUcDrabamW3 AhFOpGYQOreewKQ3/IO0zemOOXRAGuO+RBFEBSlmVAl0cj5OnvOZiwjX0+zQnpsiJciN 7cLP/leqcvEF1fDzJMC3wmX+tKjxcct11zupslqdzIFyORhOe+eMYhxc8gACIPetctbv TrZLo4fh2qHetIRLTfNeNcwaAeCPYRV7WFW3o7D2p+lmqJqSfxm06M5AyDupKsAwpevv oPLEZftXzteRdDReqY/EZtqqqYEtvmxjmNOFgOEAh7IzBkMtJNvgQkoxnICqgO1euUfZ pJtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=hACif/EM+6DM4YmpwKxfp6e/kUCUK94hGzlVOCndJAo=; b=Torf6xdhuqR+OTW2ZmJ7XxkDDEA0lzK6its/warsJ9NK31ZXDC5DfuH+ScLRKnbWIL LZmaqYLKTL9ejUgt+ZLbNuTe0xj7Wyv6cNLjOwMLtJHjo0JXtx8VWFUannTli60crBNM 7aGzvmG3U1/q7lNfKf2RE+7UlQV5aXw5/LwSmOOyZby/9zGfcWau9al2rFNsmYFml31e wzbRhcXF9tKRgREWdg0/MxB2Nuea6F6VTMPvCdEuVg+fZa4C/JFVvBrYdL5o4zX8vl9t /PP0F3/isTwnTLHoSyIzZh8v0lUfHS9mGmPsIc3NhmihSBOz8JLzI1LkUYagNXpJ/QzE 3EfQ== X-Gm-Message-State: AOUpUlGcKQfGIY9Tx7U+RkEQrfSdKgrVH9Z461x05CwNfO2WGFaFd2c1 WTljdW2MypG4wHPQQi7a0KUMV62BHbQsWG3O90qFRtY= X-Google-Smtp-Source: AA+uWPzOhO78ucn5IcHUXT6T03OC5BMHTadn7CqhdJL03VUaB97F7RmH06zVQwqshCUU33pBrmhW9EH4FMfg0YjFfZY= X-Received: by 2002:a02:8952:: with SMTP id u18-v6mr16818718jaj.13.1534195257688; Mon, 13 Aug 2018 14:20:57 -0700 (PDT) MIME-Version: 1.0 From: Jason Harmening Date: Mon, 13 Aug 2018 16:20:46 -0500 Message-ID: Subject: MIPS pmap questions To: freebsd-mips@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.27 X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.27 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Aug 2018 21:20:59 -0000 Hi all, There are couple of mips-related things that've been on my todo-list for about 3 years now (!), and I've finally found some time to dig into them. But I have a couple of related questions: 1) I'd like to implement the mips equivalent of r312610 for arm or r310481 for i386. That seems like it would be easy enough to do, but looking through the pmap code I see that pmap_map_lmem*() completely disables local interrupts. That seems a bit heavyweight; other architectures use either critical_enter() or sched_pin() + a mutex for per-CPU operations like this. Does anyone know why it was done this way (maybe something related to TLB interrupt handling)? 2) I'd also like to improve the flexibility of busdma by using pmap_quick* for bouncing and cache maintenance, as done for arm way back in r289759 . That can increase the possibility of having multiple mappings of the same physical page, and I vaguely remember someone on -developers or -arch pointing out that the mips pmap doesn't handle that correctly for all processor variants. In particular, it sounded like some MIPS processors have VIVT caches of sufficient geometry to alias, but the pmap doesn't accommodate that, e.g. by marking mappings of multiply-mapped pages as uncacheable through the PV list. Am I just mis-remembering, or is this something that still needs to be addressed? Thanks, Jason