Netbsd on Marvell Armada XP System on a Chip

Total Page:16

File Type:pdf, Size:1020Kb

Netbsd on Marvell Armada XP System on a Chip NetBSD on Marvell Armada XP System on a Chip Zbigniew Bodek [email protected] EuroBSDCon 2013, Malta 1 NetBSD on Marvell Armada XP System on a Chip Presentation outline ‣ Justification for choice ‣ Hardware overview ‣ Porting to a modern ARM ‣ Prerequisites ‣ Essentials ‣ Device drivers ‣ Validation ‣ Integration to mainline NetBSD ‣ Comparison with the mainline FreeBSD 2 NetBSD on Marvell Armada XP System on a Chip Justification for choice ‣ Why should we be interested in ARM? 3 NetBSD on Marvell Armada XP System on a Chip Justification for choice ‣ Why should we be interested in ARM? ‣ Industry trend to save energy ‣ High performance solutions = new markets 4 NetBSD on Marvell Armada XP System on a Chip Justification for choice ‣ Why should we be interested in ARM? ‣ Industry trend to save energy ‣ High performance solutions = new markets ‣ Why we invested our work in ? 5 NetBSD on Marvell Armada XP System on a Chip Justification for choice ‣ Why should we be interested in ARM? ‣ Industry trend to save energy ‣ High performance solutions = new markets ‣ Why we invested our work in ? ‣ Customer requirement ‣ Known of it’s portability ‣ Friendly license ‣ Active community ‣ Good alternative to ”other similar” 6 NetBSD on Marvell Armada XP System on a Chip Justification for choice ‣ Advantages ‣ Building for ARMv7 supported ‣ Memory management supported ‣ Whole set of drivers for older Marvell chips ‣ Disadvantages ‣ No settled support for ARMv7 platform (at the time) ‣ No SMP for ARM 7 NetBSD on Marvell Armada XP System on a Chip Hardware overview ‣ Marvell Armada XP ‣ Quad core PJ4Bv7 ‣ 2MB shared L2 cache ‣ Hardware cache coherency, I/O coherency ‣ Integrated storage (USB 2.0, SATA II, NAND, NOR...) ‣ High speed networking (NETA) ‣ PCI-Express ‣ Cryptographic engines ‣ DMA engines ‣ Advanced power management 8 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Prerequisites ‣ Arrange booting environment ‣ Define code base ‣ Compiler availability ‣ Support for similar platform 6.0-RC1 / BEAGLE 6.0.1 / ARMADAXP 9 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Prerequisites ‣ Understand work to be done ‣ Is the CPU core supported? ‣ Is the SoC family supported? ‣ Is the particular board supported? ‣ What peripheral devices are supported? ‣ Armada XP ➡ New CPU core - PJ4B ➡ New SoC family - Armada XP ➡ New evaluation boards ➡ Some peripherals matching existing drivers 10 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Prerequisites ‣ Arrange configuration files ‣ Processor specific under sys/arch/arm/marvell/files.marvell ‣ Defines core device specification for whole chip family ‣ Evaluation board specific under sys/arch/evbarm/conf/ ‣ Board specific files and option definitions → files.armadaxp ‣ Extra specification for Makefile → mk.armadaxp ‣ Set of board specific configuration options → std.armadaxp ‣ Kernel configuration file → ARMADAXP 11 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ CPU core support ‣ What does it mean? 12 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ CPU core support ‣ What does it mean? NetBSD/arm utilizes a set of ”cpu functions” defined in: sys/arch/arm/include/cpufunc.h (see struct cpu_functions) ‣ Function wrappers for basic CPU-related operations such as: ‣ cache manipulation routines ‣ core detection and configuration (including MMU) ‣ read/write buffers, branch predictor management ‣ other 13 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ CPU core support ‣ Do not increase redundancy - sufficient CPU functions can be reused ‣ Remember of the core bugs and/or erratum Example: ENTRY(pj4b_setttb) !/* Cache synchronization is not required as this core has PIPT caches */ !dsb #if defined(L2CACHE_ENABLE) && defined(AURORA_L2_PT_WALK) !orr!r2, r0, #TTB_FLAGS_UP #else !bic!r2, r0, #0x18 #endif !mcr!p15, 0, r0, c2, c0, 0!/* load new TTB */ !mov!r0, #0 !isb !mcr!p15, 0, r0, c8, c7, 0!/* invalidate I+D TLBs */ !RET 14 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ CPU core support 1. Create custom CPU functions sys/arch/arm/arm/cpufunc_asm_pj4b.S 2.Add new CPU to configuration files sys/arch/arm/conf/files.arm sys/arch/evbarm/conf/ARMADAXP 3.Add CPU class and CPU ID to auto-detection sys/arch/arm/arm32/cpu.c 4.Fill-up cpu_functions structure with the desired CPU ops 4.1.Implement <cpu>_setup routine 15 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Start code Assumptions: • Basic SoC initialization is done by firmware • First part of the kernel to be executed • Start code file and object is defined in mk.armadaxp • Written in Assembly language: • To allow relocation • No environment for C code Goals to achieve: • Remap kernel to the true VA • Redirect to locore.S for stack initialization 16 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Start code VA PA MMU ON 0xC0000000 MMU OFF 0x00000000 17 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Machine initialization initarm() from sys/arch/evbarm/armadaxp/armadaxp_machdep.c • First C code executed • Includes all actions that need to be performed before jumping to main() Goals to achieve: • Bootstrap virtual memory! • Create initial page tables • pmap_bootstrap() • Map devices for bus_space_map() • Allocate and create mappings for exception vectors page, message buffer, stack, etc. • Inform UVM about the available pages 18 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Machine initialization initarm() from sys/arch/evbarm/armadaxp/armadaxp_machdep.c • First C code executed • Includes all actions that need to be performed before jumping to main() Goals to achieve: • Initialize all crucial chip features • CPU (functions) • Decoding windows • Clocks (time base) • Interrupts (preconfigure) • L2 cache • I/O cache coherency 19 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Machine initialization initarm() from sys/arch/evbarm/armadaxp/armadaxp_machdep.c • First C code executed • Includes all actions that need to be performed before jumping to main() Goals to achieve: • Other important configurations • Abort handlers • Stack pointer • System console • KGDB 20 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ L2 cache management CPU CACHE L1 CACHE L2 CACHE 21 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ L2 cache management 1. Set L2 policy (LRU, WB) 2. Enable cache and TLB maintenance broadcast 3. Invalidate cache 4. Set PoC and PoU 5. Finally... enable L2 cache ‣ CPU functions for cache maintenance will do the rest 22 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ I/O cache coherency ‣ The Coherency Fabric • i.a. forwards transactions initiated by the I/O devices and tagged with a shared attribute onto the processors snoop engine. On-chip caches can then snoop these transactions ↓ COHERENT DMA 23 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ I/O cache coherency ‣ The Coherency Fabric CPU L2 CACHE L1 CACHE DRAM COHERENCY FABRIC controller BUS DEV DEV 24 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ I/O cache coherency ‣ Adjustments (hacks) to the bus_dma and pmap ‣ Set the pages attributes to shared ‣ Override default non-coherent settings in ‣ _bus_dmamap_load_mbuf() ‣ _bus_dmamap_load_buffer() ‣ Add HW synchronization barrier to ‣ _bus_dmamap_sync() NO NEED FOR SW CACHE MAINTENANCE ON I/O! 25 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Atomic operations ‣ Issues with atomic byte swapping required for locking Deprecated swp and swpb instructions resulted in undefined instruction exceptions in kernel. • Exchanged to ldrex strex pair • Added barriers after acquiring the lock & before releasing ‣ More issues with the building distribution. Undefined instructions (swp & swpb) in shared libraries. • Need for passing ARM_ARCH_7 definition to distribution build • Inserting barrier instruction opcode for non-kernel builds DMB ! .word 0xf57ff05f 26 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Interrupts Multiprocessor Interrupt Controller CPU HW prioritization 4 MPIC 1 2 4 2 DEV0 DEV1 DEV2 DEV3 27 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Interrupts Multiprocessor Interrupt Controller • Great for implementing NetBSD SPL mechanism • Increasing/decreasing prio done in HW • Controller takes care of proper interrupts notification • Much faster and simpler than the solution for older Marvell chips • All pic_ops needed to be implemented - establishing - blocking - unblocking 28 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Marvell SoC abstract bus (mvsoc) ‣ Armada XP support attached to the existing mvsoc ‣ mvsoc bus uses direct configuration method ‣ Resource description is not taken from the array dynamically created by config(8) basing on the configuration nodes from kernel configuration file ‣ All resources are defined in advance ‣ Bus needs to probe drivers to know their existence 29 NetBSD on Marvell Armada XP System on a Chip Porting to a modern ARM ‣ Essentials ‣ Marvell SoC abstract bus (mvsoc) ‣ Generic bus for all Marvell platforms ‣ Unified autoconfiguration process ‣ Unified
Recommended publications
  • Active-Active Firewall Cluster Support in Openbsd
    Active-Active Firewall Cluster Support in OpenBSD David Gwynne School of Information Technology and Electrical Engineering, University of Queensland Submitted for the degree of Bachelor of Information Technology COMP4000 Special Topics Industry Project February 2009 to leese, who puts up with this stuff ii Acknowledgements I would like to thank Peter Sutton for allowing me the opportunity to do this work as part of my studies at the University of Queensland. A huge thanks must go to Ryan McBride for answering all my questions about pf and pfsync in general, and for the many hours working with me on this problem and helping me test and debug the code. Thanks also go to Theo de Raadt, Claudio Jeker, Henning Brauer, and everyone else at the OpenBSD network hackathons who helped me through this. iii Abstract The OpenBSD UNIX-like operating system has developed several technologies that make it useful in the role of an IP router and packet filtering firewall. These technologies include support for several standard routing protocols such as BGP and OSPF, a high performance stateful IP packet filter called pf, shared IP address and fail-over support with CARP (Common Address Redundancy Protocol), and a protocol called pfsync for synchronisation of the firewalls state with firewalls over a network link. These technologies together allow the deployment of two or more computers to provide redundant and highly available routers on a network. However, when performing stateful filtering of the TCP protocol with pf, the routers must be configured in an active-passive configuration due to the current semantics of pfsync.
    [Show full text]
  • Freebsd and Netbsd on APM86290 System on Chip
    FreeBSD and NetBSD on APM86290 System on Chip Zbigniew Bodek Semihalf [email protected] Abstract Single chip computers conquered not only the world of mobile devices, but are extensively be- This paper covers recent development ing used in the modern telecommunication sys- work on porting FreeBSD/powerpc and tems as they provide high performance data NetBSD/evbppc to the new APM86290 processing and a large number of capabilities system-on-chip from AppliedMicro. The combined with the low energy consumption and APM86290 is a dual core device compliant reasonable price. PowerPC is a superscalar, with the Book-E definition of the PowerPC RISC-like computer architecture, originally in- architecture, presenting a number of periph- troduced by Apple-IBM-Motorola (AIM) al- erals integrated in a single chip and labour liance. Initially designed for personal comput- efficiency improved by implementation of a ers, it became popular for embedded systems, message passing architecture. servers, super-computers, and gaming. The article focuses on presenting the dif- Fast evolving telecommunication industry ferences and similarities between FreeBSD and demands from the modern chips more and more NetBSD systems in the context of porting them packet processing power, along with the so- to an embedded architecture. The material phisticated capabilities concerning packet clas- briefly describes the influence of the innova- sification, security extensions, and acceleration tive inter-circuit communication architecture, subsystems designed to offload CPUs from the and data flow in the APM86290 chip on de- compute-intensive data servicing. vice drivers development. In particular the pa- per talks about the new architecture’s impact Every processor, even the most sophisti- on the FreeBSD’s and NetBSD’s drivers infras- cated one, is just an empty vessel without an tructure in example of the networking driver.
    [Show full text]
  • HP C User's Guide for Openvms Systems
    HP C User’s Guide for OpenVMS Systems Order Number: AA–PUNZM–TK January 2005 This guide describes using the HP C compiler on OpenVMS systems. It contains information on HP C program development in the OpenVMS environment, HP C features specific to OpenVMS systems, and cross-system portability concerns. Revision/Update Information: This revised guide supersedes the Compaq C User’s Guide for OpenVMS Systems Order No. AA–PUNZL–TK, Version 6.5. Operating System and Version: OpenVMS I64 Version 8.2 or higher OpenVMS Alpha Version 7.3-2 or higher Software Version: HP C Version 7.1 for OpenVMS Systems Hewlett-Packard Company Palo Alto, California © Copyright 2005 Hewlett-Packard Development Company, L.P. Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice. The only warranties for HP products and services are set forth in the express warranty statements accompanying such products and services. Nothing herein should be construed as constituting an additional warranty. HP shall not be liable for technical or editorial errors or omissions contained herein. UNIX is a registered trademark of The Open Group. X/Open is a registered trademark of X/Open Company Ltd. in the UK and other countries. Intel and Itanium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
    [Show full text]
  • Real-Time Audio Servers on BSD Unix Derivatives
    Juha Erkkilä Real-Time Audio Servers on BSD Unix Derivatives Master's Thesis in Information Technology June 17, 2005 University of Jyväskylä Department of Mathematical Information Technology Jyväskylä Author: Juha Erkkilä Contact information: [email protected].fi Title: Real-Time Audio Servers on BSD Unix Derivatives Työn nimi: Reaaliaikaiset äänipalvelinsovellukset BSD Unix -johdannaisjärjestelmissä Project: Master's Thesis in Information Technology Page count: 146 Abstract: This paper covers real-time and interprocess communication features of 4.4BSD Unix derived operating systems, and especially their applicability for real- time audio servers. The research ground of bringing real-time properties to tradi- tional Unix operating systems (such as 4.4BSD) is covered. Included are some design ideas used in BSD-variants, such as using multithreaded kernels, and schedulers that can provide real-time guarantees to processes. Factors affecting the design of real- time audio servers are considered, especially the suitability of various interprocess communication facilities as mechanisms to pass audio data between applications. To test these mechanisms on a real operating system, an audio server and a client utilizing these techniques is written and tested on an OpenBSD operating system. The performance of the audio server and OpenBSD is analyzed, with attempts to identify some bottlenecks of real-time operation in the OpenBSD system. Suomenkielinen tiivistelmä: Tämä tutkielma kattaa reaaliaikaisuus- ja prosessien väliset kommunikaatio-ominaisuudet, keskittyen 4.4BSD Unix -johdannaisiin käyt- töjärjestelmiin, ja erityisesti siihen kuinka hyvin nämä soveltuvat reaaliaikaisille äänipalvelinsovelluksille. Tutkimusalueeseen sisältyy reaaliaikaisuusominaisuuk- sien tuominen perinteisiin Unix-käyttöjärjestelmiin (kuten 4.4BSD:hen). Mukana on suunnitteluideoita, joita on käytetty joissakin BSD-varianteissa, kuten säikeis- tetyt kernelit, ja skedulerit, jotka voivat tarjota reaaliaikaisuustakeita prosesseille.
    [Show full text]
  • Index Images Download 2006 News Crack Serial Warez Full 12 Contact
    index images download 2006 news crack serial warez full 12 contact about search spacer privacy 11 logo blog new 10 cgi-bin faq rss home img default 2005 products sitemap archives 1 09 links 01 08 06 2 07 login articles support 05 keygen article 04 03 help events archive 02 register en forum software downloads 3 security 13 category 4 content 14 main 15 press media templates services icons resources info profile 16 2004 18 docs contactus files features html 20 21 5 22 page 6 misc 19 partners 24 terms 2007 23 17 i 27 top 26 9 legal 30 banners xml 29 28 7 tools projects 25 0 user feed themes linux forums jobs business 8 video email books banner reviews view graphics research feedback pdf print ads modules 2003 company blank pub games copyright common site comments people aboutus product sports logos buttons english story image uploads 31 subscribe blogs atom gallery newsletter stats careers music pages publications technology calendar stories photos papers community data history arrow submit www s web library wiki header education go internet b in advertise spam a nav mail users Images members topics disclaimer store clear feeds c awards 2002 Default general pics dir signup solutions map News public doc de weblog index2 shop contacts fr homepage travel button pixel list viewtopic documents overview tips adclick contact_us movies wp-content catalog us p staff hardware wireless global screenshots apps online version directory mobile other advertising tech welcome admin t policy faqs link 2001 training releases space member static join health
    [Show full text]
  • Asiabsdcon 2008 Proceedings
    AsiaBSDCon 2008 Proceedings March 27-30, 2008 Tokyo, Japan Copyright c 2008 AsiaBSDCon 2008. All rights reserved. Unauthorized republication is prohibited. Published in Japan, March 2008 In Memory of Jun-ichiro “itojun” Hagino Our friend and colleague Jun-ichiro “itojun” Hagino (a BSD hacker famous for IPv6 implemen- tation, and CTO of ipv6samurais.com) was working as a member of our program committee, but he passed away on October 29th 2007. Itojun was a valued member of the BSD community both for his technical and personal contributions to various projects over his career. We who are working on AsiaBSDCon would like to express our condolences to Itojun’s family and friends and also to dedicate this year’s conference to his memory. INDEX P1A: PC-BSD: FreeBSD on the Desktop 001 Matt Olander (iXsystems) P1B: Tracking FreeBSD in a Commercial Setting 027 M. Warner Losh (Cisco Systems, Inc.) P3A: Gaols: Implementing Jails Under the kauth Framework 033 Christoph Badura (The NetBSD Foundation) P3B: BSD implementations of XCAST6 041 Yuji IMAI, Takahiro KUROSAWA, Koichi SUZUKI, Eiichi MURAMOTO, Katsuomi HAMAJIMA, Hajimu UMEMOTO, and Nobuo KAWAGUTI (XCAST fan club, Japan) P4A: Using FreeBSD to Promote Open Source Development Methods 049 Brooks Davis, Michael AuYeung, and Mark Thomas (The Aerospace Corporation) P4B: Send and Receive of File System Protocols: Userspace Approach With puffs 055 Antti Kantee (Helsinki University of Technology, Finland) P5A: Logical Resource Isolation in the NetBSD Kernel 071 Kristaps Džonsons (Centre for Parallel Computing, Swedish Royal Institute of Technology) P5B: GEOM—in Infrastructure We Trust 081 Pawel Jakub Dawidek (The FreeBSD Project) P6A: A Portable iSCSI Initiator 093 Alistair Crooks (The NetBSD Foundation) P8A: OpenBSD Network Stack Internals 109 Claudio Jeker (The OpenBSD Project) P8B: Reducing Lock Contention in a Multi-Core System 115 Randall Stewart (Cisco Systems, Inc.) P9A: Sleeping Beauty—NetBSD on Modern Laptops 127 Jörg Sonnenberger and Jared D.
    [Show full text]
  • Getting Started with Openbsd Device Driver Development
    Getting started with OpenBSD device driver development Stefan Sperling <[email protected]> EuroBSDcon 2017 Clarifications (1/2) Courtesy of Jonathan Gray (jsg@): We don't want source code to firmware We want to be able to redistribute firmware freely Vendor drivers are often poorly written, we need to be able to write our own We want documentation on the hardware interfaces Source code is not documentation OpenBSD Device Drivers 2/46 Clarifications (2/2) I would like to add: Device driver code runs in our kernel Firmware code runs on a peripheral device, not in our kernel When we say \Binary Blobs" we are talking about closed-source device drivers, not firmware Firmware often runs with high privileges; use at your own risk If you do not want closed-source firmware, then don't buy and use hardware which needs it We are software developers, we do not build hardware We will not sign NDAs Please talk to hardware vendors and advocate for change; the current situation is very bad for free software OpenBSD Device Drivers 3/46 This talk is for ... somewhat competent C programmers who use OpenBSD and would like to use a device which lacks support so have an itch to scratch (enhance or write a driver) but are not sure where to start perhaps are not sure how the development process works and will research all further details themselves The idea for this talk came about during conversations I had at EuroBSDcon 2016. Common question: "How do I add support for my laptop's wifi device?" OpenBSD Device Drivers 4/46 Itches I have scratched..
    [Show full text]
  • An Overview of Security in the Freebsd Kernel 131 Dr
    AsiaBSDCon 2014 Proceedings March 13-16, 2014 Tokyo, Japan Copyright c 2014 BSD Research. All rights reserved. Unauthorized republication is prohibited. Published in Japan, March 2014 INDEX P1A: Bold, fast optimizing linker for BSD — Luba Tang P1B: Visualizing Unix: Graphing bhyve, ZFS and PF with Graphite 007 Michael Dexter P2A: LLVM in the FreeBSD Toolchain 013 David Chisnall P2B: NPF - progress and perspective 021 Mindaugas Rasiukevicius K1: OpenZFS: a Community of Open Source ZFS Developers 027 Matthew Ahrens K2: Bambi Meets Godzilla: They Elope 033 Eric Allman P3A: Snapshots, Replication, and Boot-Environments—How new ZFS utilities are changing FreeBSD & PC-BSD 045 Kris Moore P3B: Netmap as a core networking technology 055 Luigi Rizzo, Giuseppe Lettieri, and Michio Honda P4A: ZFS for the Masses: Management Tools Provided by the PC-BSD and FreeNAS Projects 065 Dru Lavigne P4B: OpenBGPD turns 10 years - Design, Implementation, Lessons learned 077 Henning Brauer P5A: Introduction to FreeNAS development 083 John Hixson P5B: VXLAN and Cloud-based networking with OpenBSD 091 Reyk Floeter INDEX P6A: Nested Paging in bhyve 097 Neel Natu and Peter Grehan P6B: Developing CPE Routers based on NetBSD: Fifteen Years of SEIL 107 Masanobu SAITOH and Hiroki SUENAGA P7A: Deploying FreeBSD systems with Foreman and mfsBSD 115 Martin Matuška P7B: Implementation and Modification for CPE Routers: Filter Rule Optimization, IPsec Interface and Ethernet Switch 119 Masanobu SAITOH and Hiroki SUENAGA K3: Modifying the FreeBSD kernel Netflix streaming servers — Scott Long K4: An Overview of Security in the FreeBSD Kernel 131 Dr. Marshall Kirk McKusick P8A: Transparent Superpages for FreeBSD on ARM 151 Zbigniew Bodek P8B: Carve your NetBSD 165 Pierre Pronchery and Guillaume Lasmayous P9A: How FreeBSD Boots: a soft-core MIPS perspective 179 Brooks Davis, Robert Norton, Jonathan Woodruff, and Robert N.
    [Show full text]
  • Modernizing Netbsd Networking Facilities and Interrupt Handling
    Modernizing NetBSD Networking Facilities and Interrupt Handling Ryota Ozaki Kengo Nakahara [email protected] [email protected] Internet Initiative Japan Inc. Internet Initiative Japan Inc. Abstract This paper is organized as follows. Section 2 describes the current status of network processing in NetBSD. Sec- Networking facilities of NetBSD still have a lot of room tion 3 describes how to make networking facilities MP- for improvement, especially the scalability of its network safe; we pick vioif and bridge to explain that in de- processing is one of big issues that we have to address. tail. Section 4 and Section 5 describe how we support We have been working on making the network stack and hardware mentioned above in NetBSD. Section 6 reports network device drivers MP-safe to run NetBSD network- the results of preliminary performance evaluations on our ing facilities run in parallel. Supporting MSI/MSI-X and implementation. At last, Section 7 concludes the paper. multi-queue (with interrupt affinity) features of network devices in NetBSD device drivers is also an important task towards the goal. 2 Current Status of Network Processing This paper describes the current status of NetBSD net- working facilities and our recent work to improve them. In this section, we describe the current status of network The paper also reports the results of preliminary evalu- processing of NetBSD, including how the network facil- ations on our implementation and shows that our imple- ities of NetBSD work on multi-core systems, how tra- mentation scales up well on a multi-core system.
    [Show full text]
  • A Revisitation of Kernel Synchronization Schemes
    A Revisitation of Kernel Synchronization Schemes The Harvard community has made this article openly available. Please share how this access benefits you. Your story matters Citation Small, Christopher and Stephen Manley. 1997. A Revisitation of Kernel Synchronization Schemes. Harvard Computer Science Group Technical Report TR-06-97. Citable link http://nrs.harvard.edu/urn-3:HUL.InstRepos:23996082 Terms of Use This article was downloaded from Harvard University’s DASH repository, and is made available under the terms and conditions applicable to Other Posted Material, as set forth at http:// nrs.harvard.edu/urn-3:HUL.InstRepos:dash.current.terms-of- use#LAA A version of this paper was published in the 1997 USENIX Annual Technical Conference Proceedings. A Revisitation of Kernel Synchronization Schemes Christopher Small and Stephen Manley Harvard University {chris,manley}@eecs.harvard.edu Abstract device. This is traditionally accomplished by communi- cating with an off-chip interrupt controller and masking In an operating system kernel, critical sections of code interrupts. Historically, the routines that perform this must be protected from interruption. This is traditionally service are named splintr, where intr is the name of the accomplished by masking the set of interrupts whose interrupt to disable. A special routine, splhigh, is used to handlers interfere with the correct operation of the criti- disable all interrupts. cal section. Because it can be expensive to communicate Most, if not all, conventional hardware platforms with an off-chip interrupt controller, more complex opti- allow device interrupts to be prioritized and assigned mistic techniques for masking interrupts have been pro- levels; a pending interrupt from a lower-level device can posed.
    [Show full text]
  • Jargon File, Version 4.0.0, 24 Jul 1996
    JARGON FILE, VERSION 4.0.0, 24 JUL 1996 This is the Jargon File, a comprehensive compendium of hacker slang illuminating many aspects of hackish tradition, folklore, and humor. This document (the Jargon File) is in the public domain, to be freely used, shared, and modified. There are (by intention) no legal restraints on what you can do with it, but there are traditions about its proper use to which many hackers are quite strongly attached. Please extend the courtesy of proper citation when you quote the File, ideally with a version number, as it will change and grow over time. (Examples of appropriate citation form: "Jargon File 4.0.0" or "The on-line hacker Jargon File, version 4.0.0, 24 JUL 1996".) The Jargon File is a common heritage of the hacker culture. Over the years a number of individuals have volunteered considerable time to maintaining the File and been recognized by the net at large as editors of it. Editorial responsibilities include: to collate contributions and suggestions from others; to seek out corroborating information; to cross-reference related entries; to keep the file in a consistent format; and to announce and distribute updated versions periodically. Current volunteer editors include: Eric Raymond [email protected] Although there is no requirement that you do so, it is considered good form to check with an editor before quoting the File in a published work or commercial product. We may have additional information that would be helpful to you and can assist you in framing your quote to reflect not only the letter of the File but its spirit as well.
    [Show full text]
  • Downloaded for Free From
    The Design of the NetBSD I/O Subsystems SungWon Chung Pusan National University 2 This book is dedicated to the open-source code developers in the NetBSD community. The original copy of this publication is available in an electronic form and it can be downloaded for free from http://arXiv.org. Copyright (c) 2002 by SungWon Chung. For non-commercial and personal use, this publication may be reproduced, stored in a retrieval system, or transmitted in any form by any means, electronic, mechanical, photocopying, recording or otherwise. For commercial use, no part of this publication can be reproduced by any means without the prior written permission of the author. NetBSD is the registered trademark of The NetBSD Foundation, Inc. Contents Preface 14 I Basics to Learn Filesystem 15 1 Welcome to the World of Kernel ! 17 1.1 How Does a System Call Dive into Kernel from User Program ? . 17 1.1.1 Example: write system call . 17 1.1.2 Ultra SPARC 0x7c CPU Trap . 18 1.1.3 Jump to the File Descriptor Layer . 24 1.1.4 Arriving at Virtual Filesystem Operations . 28 1.2 General Data Structures in Kernel such as List, Hash, Queue, ... 30 1.2.1 Linked-Lists . 30 1.2.2 Tail Queues . 34 1.2.3 Hash . 38 1.3 Waiting and Sleeping in Kernel . 39 1.4 Kernel Lock Manager . 39 1.4.1 simplelock and lock . 39 1.4.2 Simplelock Interfaces . 40 1.4.3 Lock Interfaces . 40 1.5 Kernel Memory Allocation . 43 1.6 Resource Pool Manager .
    [Show full text]