From owner-freebsd-mips@FreeBSD.ORG Sat Jul 17 13:50:12 2010 Return-Path: Delivered-To: freebsd-mips@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324BA106567E; Sat, 17 Jul 2010 13:50:12 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8DDA68FC12; Sat, 17 Jul 2010 13:50:11 +0000 (UTC) Received: by fxm13 with SMTP id 13so1703958fxm.13 for ; Sat, 17 Jul 2010 06:50:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:references:in-reply-to :x-enigmail-version:content-type:content-transfer-encoding; bh=zVJvkuxr4NNqTOqG/vLSd3rPQsEihM4RUdzkYWxL+Nw=; b=BHDi2ms0YGwr59Aq/gI+JuTUxtejIaxrz9WcADBlbx+SN+ORZO7mbulQJB8Ya1JU2h CDKjukGRYQx4CYODmXOvHEDWCKtLVVXCIPP9AylAHQCHmHGLsEBzp/pYYaTAhczyumfu RTgXrdX99+SchfoM5qWEcNJEjsDWGdh53Hi2U= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding; b=px//GE8PXRN0S/sH7s0y5BUsK05mjH0wdH5H0UeLT7bpr8hEn8NcrXP1IZEe1+uL4c VaohsLz66Hj//pXf2RrajnjzP3QO7n966zTupp1QoAwT4Phv0WS576nLjcHFbsFM3dm5 GtfzQz/s6Svk8Dpc7GSfDmBcDITHwpRnqAtY8= Received: by 10.223.108.204 with SMTP id g12mr1694405fap.21.1279374610369; Sat, 17 Jul 2010 06:50:10 -0700 (PDT) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua [212.86.226.226]) by mx.google.com with ESMTPS id n27sm1185829fam.20.2010.07.17.06.50.09 (version=SSLv3 cipher=RC4-MD5); Sat, 17 Jul 2010 06:50:09 -0700 (PDT) Sender: Alexander Motin Message-ID: <4C41B4CF.6080409@FreeBSD.org> Date: Sat, 17 Jul 2010 16:49:03 +0300 From: Alexander Motin User-Agent: Thunderbird 2.0.0.23 (X11/20091212) MIME-Version: 1.0 To: "Jayachandran C." References: <4C41A248.8090605@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 0.96.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Neel Natu , freebsd-mips@freebsd.org Subject: Re: [RFC] Event timers on MIPS X-BeenThere: freebsd-mips@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to MIPS List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Jul 2010 13:50:12 -0000 Jayachandran C. wrote: > 2010/7/17 Alexander Motin : >> I've made a patch, updating MIPS timer code (except RMI) to utilize new >> MI event timer infrastructure. I've successfully built QEMU and XLR >> kernels with the patch. Unluckily I can't test how it works, unless >> somebody teach me how to cook QEMU to run it. I also haven't ported RMI >> timers drivers, as I am not sure how that hardware is intended to work. >> >> Patch for HEAD can be found here: >> http://people.freebsd.org/~mav/timers_mips.patch >> >> Could somebody falimiar with MIPS review/test my patch and extend it to >> RMI hardware? > > XLR uses an on-chip PIC clock (running at 66MHz) for cpu 0 and > count/compare clock (running at CPU freq) for the other CPUs, hope > this is supported with the new code. I suppose that one type of timers should run on all CPUs (either one timer per CPU, or one timer for all of them + IPI for distribution). Theoretically you can implement "single" per-CPU timer implemented in different fashion for different CPUs, though I don't understand why it is needed. If these timers are independent, I would register every of them as-is: on-chip PIC clock as global timer (infrastructure will automatically manage rebroadcasting it's events via IPIs) and per-CPU comparators as another per-CPU timer. This give independent hardclock and statclock for less aliased time accounting. > Other than that, I should be able to merge the code into XLR specific > rmi/tick.c rmi/clock.c, if it works on other MIPS platforms. rmi/tick.c looks somewhat strange to me, registering timecounter with the same "MIPS32" name, but with different meaning. -- Alexander Motin