vm

package
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 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.MsgMeta

	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

func (*InvalidationCompleteRsp) Meta added in v1.3.0

Meta returns the meta data associated with the message.

type PTEInvalidationReq added in v1.1.0

type PTEInvalidationReq struct {
	akita.MsgMeta
	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

func (*PTEInvalidationReq) Meta added in v1.3.0

func (m *PTEInvalidationReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

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.MsgMeta

	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

func (*PageMigrationReqToDriver) Meta added in v1.3.0

Meta returns the meta data associated with the message.

type PageMigrationRspFromDriver added in v1.2.2

type PageMigrationRspFromDriver struct {
	akita.MsgMeta

	Vaddr             uint64
	MigrationComplete bool
}

func NewPageMigrationRspFromDriver added in v1.2.2

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

func (*PageMigrationRspFromDriver) Meta added in v1.3.0

Meta returns the meta data associated with the message.

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.MsgMeta
	PID ca.PID
}

func (*TLBFullInvalidateReq) Meta added in v1.3.0

func (m *TLBFullInvalidateReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type TLBPartialInvalidateReq added in v1.1.0

type TLBPartialInvalidateReq struct {
	akita.MsgMeta

	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

func (*TLBPartialInvalidateReq) Meta added in v1.3.0

Meta returns the meta data associated with the message.

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 TranslationReq

type TranslationReq struct {
	akita.MsgMeta
	VAddr uint64
	PID   ca.PID
	GPUID uint64
}

A TranslationReq asks the receiver component to translate the request.

func (*TranslationReq) Meta added in v1.3.0

func (r *TranslationReq) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type TranslationReqBuilder added in v1.3.0

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

TranslationReqBuilder can build translation requests

func (TranslationReqBuilder) Build added in v1.3.0

Build creats a new TranslationReq

func (TranslationReqBuilder) WithDst added in v1.3.0

WithDst sets the destination of the request to build.

func (TranslationReqBuilder) WithGPUID added in v1.3.0

WithGPUID sets the GPU ID of the request to build.

func (TranslationReqBuilder) WithPID added in v1.3.0

WithPID sets the virtual address of the request to build.

func (TranslationReqBuilder) WithSendTime added in v1.3.0

WithSendTime sets the send time of the request to build.:w

func (TranslationReqBuilder) WithSrc added in v1.3.0

WithSrc sets the source of the request to build.

func (TranslationReqBuilder) WithVAddr added in v1.3.0

WithVAddr sets the virtual address of the request to build.

type TranslationRsp added in v1.3.0

type TranslationRsp struct {
	akita.MsgMeta
	RespondTo string // The ID of the request it replies
	Page      Page
}

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

func (*TranslationRsp) Meta added in v1.3.0

func (r *TranslationRsp) Meta() *akita.MsgMeta

Meta returns the meta data associated with the message.

type TranslationRspBuilder added in v1.3.0

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

TranslationRspBuilder can build translation requests

func (TranslationRspBuilder) Build added in v1.3.0

Build creats a new TranslationRsp

func (TranslationRspBuilder) WithDst added in v1.3.0

WithDst sets the destination of the respond to build.

func (TranslationRspBuilder) WithPage added in v1.3.0

WithPage sets the page of the respond to build.

func (TranslationRspBuilder) WithRspTo added in v1.3.0

WithRspTo sets the request ID of the respond to build.

func (TranslationRspBuilder) WithSendTime added in v1.3.0

WithSendTime sets the send time of the message to build.

func (TranslationRspBuilder) WithSrc added in v1.3.0

WithSrc sets the source of the respond to build.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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