vm

package
v1.2.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2019 License: MIT Imports: 6 Imported by: 8

Documentation

Overview

Package vm provides the models for address translations

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultPageTableFactory

type DefaultPageTableFactory struct{}

DefaultPageTableFactory builds PageTableImpl

func (DefaultPageTableFactory) Build

Build returns a default page table implementation

type InvalidationCompleteRsp added in v1.1.0

type InvalidationCompleteRsp struct {
	*akita.ReqBase

	RespondTo        string // The ID of the request it replies
	InvalidationDone bool
}

func NewInvalidationCompleteRsp added in v1.1.0

func NewInvalidationCompleteRsp(
	time akita.VTimeInSec,
	src, dst akita.Port,
	respondTo string,
) *InvalidationCompleteRsp

type PTEInvalidationReq added in v1.1.0

type PTEInvalidationReq struct {
	*akita.ReqBase
	PID   ca.PID
	Vaddr []uint64
}

func NewPTEInvalidationReq added in v1.1.0

func NewPTEInvalidationReq(
	time akita.VTimeInSec,
	src, dst akita.Port,
	pid ca.PID,
	vAddr []uint64,
) *PTEInvalidationReq

type Page

type Page struct {
	PID         ca.PID
	PAddr       uint64
	VAddr       uint64
	PageSize    uint64
	Valid       bool
	GPUID       uint64
	Unified     bool
	IsMigrating bool
}

A Page is an entry in the page table, maintaining the information about how to translate a virtual address to a physical address

type PageMigrationReqToDriver added in v1.2.2

type PageMigrationReqToDriver struct {
	*akita.ReqBase

	VAddr           uint64
	PhysicalAddress uint64
	PageSize        uint64
	PID             ca.PID
	RequestingGPU   uint64
}

func NewPageMigrationReqToDriver added in v1.2.2

func NewPageMigrationReqToDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationReqToDriver

type PageMigrationRspFromDriver added in v1.2.2

type PageMigrationRspFromDriver struct {
	*akita.ReqBase

	Vaddr             uint64
	MigrationComplete bool
}

func NewPageMigrationRspFromDriver added in v1.2.2

func NewPageMigrationRspFromDriver(
	time akita.VTimeInSec,
	src, dst akita.Port,
) *PageMigrationRspFromDriver

type PageTable

type PageTable interface {
	InsertPage(page *Page)
	RemovePage(vAddr uint64)
	FindPage(vAddr uint64) *Page
}

A PageTable holds the meta-data of the pages.

type PageTableFactory

type PageTableFactory interface {
	Build() PageTable
}

A PageTableFactory builds PageTables

type PageTableImpl

type PageTableImpl struct {
	sync.Mutex
	// contains filtered or unexported fields
}

PageTableImpl is the default implementation of a Page Table

func (*PageTableImpl) FindPage

func (pt *PageTableImpl) FindPage(vAddr uint64) *Page

FindPage returns the page that contains the given virtual address. This function returns nil if the page is not found.

func (*PageTableImpl) InsertPage

func (pt *PageTableImpl) InsertPage(page *Page)

InsertPage put a new page into the PageTable

func (*PageTableImpl) RemovePage

func (pt *PageTableImpl) RemovePage(vAddr uint64)

RemovePage removes the entry in the page table that contains the target address.

type TLBFullInvalidateReq added in v1.1.0

type TLBFullInvalidateReq struct {
	*akita.ReqBase
	PID ca.PID
}

type TLBPartialInvalidateReq added in v1.1.0

type TLBPartialInvalidateReq struct {
	*akita.ReqBase

	VAddr []uint64
	PID   ca.PID
}

A TLBPartialInvalidate asks the receiver TLB to invalidate the list of particular entries. The list can consist anyhere from 0 to N entries

type TLBTracer

type TLBTracer struct {
	// contains filtered or unexported fields
}

A TLBTracer write logs for what happened in a TLB

func NewTLBTracer

func NewTLBTracer(w io.Writer) *TLBTracer

NewTLBTracer produce a new TLBTracer, injecting the dependency of a writer.

func (*TLBTracer) Func

func (t *TLBTracer) Func(ctx *akita.HookCtx)

Func prints the tlb trace information.

type TranslationReadyRsp added in v1.2.2

type TranslationReadyRsp struct {
	*akita.ReqBase

	RespondTo string // The ID of the request it replies
	Page      *Page
}

A TranslationReadyRsp is the respond for a TranslationReq. It carries the physical address.

func NewTranslationReadyRsp added in v1.2.2

func NewTranslationReadyRsp(
	time akita.VTimeInSec,
	src, dst akita.Port,
	respondTo string,
) *TranslationReadyRsp

NewTranslationReadyRsp creates a new TranslationReadyRsp

type TranslationReq

type TranslationReq struct {
	*akita.ReqBase

	VAddr uint64
	PID   ca.PID
	GPUID uint64
}

A TranslationReq asks the receiver component to translate the request.

func NewTranslationReq added in v1.2.2

func NewTranslationReq(
	time akita.VTimeInSec,
	src, dst akita.Port,
	pid ca.PID,
	vAddr uint64,
	GPUID uint64,
) *TranslationReq

NewTranslationReq creates a new translation req

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL