亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tpm-tis-device

?? xen 3.2.2 源碼
??
?? 第 1 頁 / 共 3 頁
字號:
# HG changeset patch# User kaf24@localhost.localdomain# Node ID d60b709724f48397b95da3d56299213cae391789# Parent  bbcac2aea0e8196cd75a3bf6dbe57bebf8c1e5b2[QEMU] Add a TIS device model compliant to the 1.2 TPM specification.It implements all registers necessary to make the Linux TIS driverwork (tpm_tis.c). All of the basic registers supported by this type ofdevice are implemented. Also the locality selection has beenimplemented, but has not been tested. The legacy registers asdescribed in the specification are not supported.Current caveat: The device has so far not yet been integrated with thevirtual TPM available in the repository. It will require changes tothe virtual TPM spawned by the vTPM manager to offer an additional messageinterface. The TIS interface itself then needs to have an additionaltransport implemented. (see vTPMTransmit array).The relevant specification for the device model can be found here:https://www.trustedcomputinggroup.org/groups/pc_client/TCG_PCClientTPMSpecification_1-20_1-00_FINAL.pdfSigned-off-by: Stefan Berger <stefanb@us.ibm.com>Index: ioemu/Makefile.target===================================================================--- ioemu.orig/Makefile.target	2007-05-10 15:19:29.000000000 +0100+++ ioemu/Makefile.target	2007-05-10 15:19:29.000000000 +0100@@ -400,6 +400,7 @@ VL_OBJS+= piix4acpi.o VL_OBJS+= xenstore.o VL_OBJS+= xen_platform.o+VL_OBJS+= tpm_tis.o CPPFLAGS += -DHAS_AUDIO endif ifeq ($(TARGET_BASE_ARCH), ppc)Index: ioemu/hw/pc.c===================================================================--- ioemu.orig/hw/pc.c	2007-05-10 15:19:28.000000000 +0100+++ ioemu/hw/pc.c	2007-05-10 15:19:29.000000000 +0100@@ -730,6 +730,9 @@         }     } +    if (has_tpm_device())+        tpm_tis_init(&pic_set_irq_new, isa_pic, 11);+     kbd_init();     DMA_init(0); #ifdef HAS_AUDIOIndex: ioemu/hw/tpm_tis.c===================================================================--- /dev/null	1970-01-01 00:00:00.000000000 +0000+++ ioemu/hw/tpm_tis.c	2007-05-10 15:19:29.000000000 +0100@@ -0,0 +1,1128 @@+/*+ * tpm_tis.c - QEMU emulator for a 1.2 TPM with TIS interface+ *+ * Copyright (C) 2006 IBM Corporation+ *+ * Author: Stefan Berger <stefanb@us.ibm.com>+ *         David Safford <safford@us.ibm.com>+ *+ * This program is free software; you can redistribute it and/or+ * modify it under the terms of the GNU General Public License as+ * published by the Free Software Foundation, version 2 of the+ * License.+ *+ *+ * Implementation of the TIS interface according to specs at+ * https://www.trustedcomputinggroup.org/groups/pc_client/TCG_PCClientTPMSpecification_1-20_1-00_FINAL.pdf+ *+ */++#include <sys/types.h>+#include <sys/stat.h>+#include <sys/socket.h>+#include <sys/un.h>+#include <fcntl.h>+#include <errno.h>+#include "vl.h"++//#define DEBUG_TPM++#define TPM_MAX_PKT	              4096++#define VTPM_BAD_INSTANCE             (uint32_t)0xffffffff++#define TIS_ADDR_BASE                 0xFED40000++/* tis registers */+#define TPM_REG_ACCESS                0x00+#define TPM_REG_INT_ENABLE            0x08+#define TPM_REG_INT_VECTOR            0x0c+#define TPM_REG_INT_STATUS            0x10+#define TPM_REG_INTF_CAPABILITY       0x14+#define TPM_REG_STS                   0x18+#define TPM_REG_DATA_FIFO             0x24+#define TPM_REG_DID_VID               0xf00+#define TPM_REG_RID                   0xf04++#define STS_VALID                    (1 << 7)+#define STS_COMMAND_READY            (1 << 6)+#define STS_TPM_GO                   (1 << 5)+#define STS_DATA_AVAILABLE           (1 << 4)+#define STS_EXPECT                   (1 << 3)+#define STS_RESPONSE_RETRY           (1 << 1)++#define ACCESS_TPM_REG_VALID_STS     (1 << 7)+#define ACCESS_ACTIVE_LOCALITY       (1 << 5)+#define ACCESS_BEEN_SEIZED           (1 << 4)+#define ACCESS_SEIZE                 (1 << 3)+#define ACCESS_PENDING_REQUEST       (1 << 2)+#define ACCESS_REQUEST_USE           (1 << 1)+#define ACCESS_TPM_ESTABLISHMENT     (1 << 0)++#define INT_ENABLED                  (1 << 31)+#define INT_DATA_AVAILABLE           (1 << 0)+#define INT_LOCALITY_CHANGED         (1 << 2)+#define INT_COMMAND_READY            (1 << 7)++#define INTERRUPTS_SUPPORTED         (INT_LOCALITY_CHANGED | \+                                      INT_DATA_AVAILABLE   | \+                                      INT_COMMAND_READY)+#define CAPABILITIES_SUPPORTED       ((1 << 4) |            \+                                      INTERRUPTS_SUPPORTED)++enum {+  STATE_IDLE = 0,+  STATE_READY,+  STATE_COMPLETION,+  STATE_EXECUTION,+  STATE_RECEPTION+};++#define NUM_LOCALITIES   5+#define NO_LOCALITY      0xff++#define IS_VALID_LOC(x) ((x) < NUM_LOCALITIES)++#define TPM_DID          0x0001+#define TPM_VID          0x0001+#define TPM_RID          0x0001++/* if the connection to the vTPM should be closed after a successfully+   received response; set to '0' to allow keeping the connection */+#define FORCE_CLOSE      0++/* local data structures */++typedef struct TPMTx {+    int fd[2];+} tpmTx;++typedef struct TPMBuffer {+    uint8_t instance[4];      /* instance number in network byte order */+    uint8_t buf[TPM_MAX_PKT];+} __attribute__((packed)) tpmBuffer;++/* locality data */+typedef struct TPMLocal {+    uint32_t state;+    uint8_t access;+    uint8_t sts;+    uint32_t inte;+    uint32_t ints;+} tpmLoc;++/* overall state of the TPM interface; 's' marks as save upon suspension */+typedef struct TPMState {+    uint32_t offset;            /* s */+    tpmBuffer buffer;           /* s */+    uint8_t active_loc;         /* s */+    uint8_t aborting_locty;+    uint8_t next_locty;+    uint8_t irq_pending;        /* s */+    tpmLoc loc[NUM_LOCALITIES]; /* s */+    QEMUTimer *poll_timer;+    SetIRQFunc *set_irq;+    void *irq_opaque;+    int irq;+    int poll_attempts;+    uint32_t vtpm_instance;  /* vtpm inst. number; determined from xenstore*/+    int Transmitlayer;+    tpmTx tpmTx;+} tpmState;+++/* local prototypes */+static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg);+static int TPM_Receive(tpmState *s, tpmBuffer *buffer);+static uint32_t vtpm_instance_from_xenstore(void);+static void tis_poll_timer(void *opaque);+static void tis_prep_next_interrupt(tpmState *s);+static void tis_raise_irq(tpmState *s, uint8_t locty, uint32_t irqmask);+static void close_vtpm_channel(tpmState *s, int force);+static void open_vtpm_channel(tpmState *s);+static void tis_attempt_receive(tpmState *s, uint8_t locty);++/* transport layer functions: local sockets */+static int create_local_socket(tpmState *s, uint32_t vtpm_instance);+static int write_local_socket(tpmState *s, const tpmBuffer *);+static int read_local_socket(tpmState *s, tpmBuffer *);+static int close_local_socket(tpmState *s, int force);+static int has_channel_local_socket(tpmState *s);+#define LOCAL_SOCKET_PATH      "/var/vtpm/vtpm_all.socket"+++#define NUM_TRANSPORTS 1++struct vTPM_transmit {+    int (*open) (tpmState *s, uint32_t vtpm_instance);+    int (*write) (tpmState *s, const tpmBuffer *);+    int (*read) (tpmState *s, tpmBuffer *);+    int (*close) (tpmState *s, int);+    int (*has_channel) (tpmState *s);+} vTPMTransmit[NUM_TRANSPORTS] = {+    { .open = create_local_socket,+      .write = write_local_socket,+      .read = read_local_socket,+      .close = close_local_socket,+      .has_channel = has_channel_local_socket,+    }+};+++#define IS_COMM_WITH_VTPM(s)                            \+     ((s)->Transmitlayer >= 0 &&                        \+      vTPMTransmit[(s)->Transmitlayer].has_channel(s))+++/**********************************************************************+ helper functions+ *********************************************************************/++static inline uint32_t tpm_get_size_from_buffer(const uint8_t *buffer)+{+    uint32_t len = (buffer[4] << 8) + buffer[5];+    return len;+}++static inline void tpm_initialize_instance(tpmState *s, uint32_t instance)+{+    s->buffer.instance[0] = (instance >> 24) & 0xff;+    s->buffer.instance[1] = (instance >> 16) & 0xff;+    s->buffer.instance[2] = (instance >>  8) & 0xff;+    s->buffer.instance[3] = (instance >>  0) & 0xff;+}++/*+ * open communication channel with a vTPM+ */+static void open_vtpm_channel(tpmState *s)+{+    int idx;+    /* search a usable transmit layer */+    for (idx = 0; idx < NUM_TRANSPORTS; idx++) {+        if (1 == vTPMTransmit[idx].open(s, s->vtpm_instance)) {+            /* found one */+            s->Transmitlayer = idx;+            break;+        }+    }+}++/*+ * close the communication channel with the vTPM+ */+static inline void close_vtpm_channel(tpmState *s, int force)+{+    if (1 == vTPMTransmit[s->Transmitlayer].close(s, force)) {+        s->Transmitlayer = -1;+    }+}++static inline uint8_t locality_from_addr(target_phys_addr_t addr)+{+    return (uint8_t)((addr >> 12) & 0x7);+}+++/**********************************************************************+    low-level transmission layer methods+ *********************************************************************/++/*+ * the 'open' method that creates the filedescriptor for communicating+ * only one is needed for reading and writing+ */+static int create_local_socket(tpmState *s, uint32_t vtpm_instance)+{+    int success = 1;+    if (s->tpmTx.fd[0] < 0) {+        s->tpmTx.fd[0] = socket(PF_LOCAL, SOCK_STREAM, 0);++        if (has_channel_local_socket(s)) {+            struct sockaddr_un addr;+            memset(&addr, 0x0, sizeof(addr));+            addr.sun_family = AF_LOCAL;+            strcpy(addr.sun_path, LOCAL_SOCKET_PATH);+            if (connect(s->tpmTx.fd[0],+                        (struct sockaddr *)&addr,+                        sizeof(addr)) != 0) {+                close_local_socket(s, 1);+                success = 0;+            } else {+                /* put filedescriptor in non-blocking mode for polling */+                int flags = fcntl(s->tpmTx.fd[0], F_GETFL);+                fcntl(s->tpmTx.fd[0], F_SETFL, flags | O_NONBLOCK);+            }+#ifdef DEBUG_TPM+            if (success)+                fprintf(logfile,"Successfully connected using local socket "+                                LOCAL_SOCKET_PATH ".\n");+            else+                fprintf(logfile,"Could not connect to local socket "+                                LOCAL_SOCKET_PATH ".\n");+#endif+        } else {+            success = 0;+        }+    }+    return success;+}++/*+ * the 'write' method for sending requests to the vTPM+ * four bytes with the vTPM instance number are prepended to each request+ * the locality in which the command was sent is transmitted in the+ * highest 3 bits+ */+static int write_local_socket(tpmState *s, const tpmBuffer *buffer)+{+    uint32_t size = tpm_get_size_from_buffer(buffer->buf);+    int len;++    len = write(s->tpmTx.fd[0],+                buffer->instance,+                sizeof(buffer->instance) + size);+    if (len == sizeof(buffer->instance) + size) {+        return len;+    } else {+        return -1;+    }+}++/*+ * the 'read' method for receiving of responses from the TPM+ * this function expects that four bytes with the instance number+ * are received from the vTPM+ */+static int read_local_socket(tpmState *s, tpmBuffer *buffer)+{+    int off;+#ifdef DEBUG_TPM+    fprintf(logfile, "Reading from fd %d\n", s->tpmTx.fd[0]);+#endif+    off = read(s->tpmTx.fd[0],+               buffer->instance,+               sizeof(buffer->instance)+TPM_MAX_PKT);+#ifdef DEBUG_TPM+    fprintf(logfile, "Read %d bytes\n", off);+#endif+    return off;+}++/*+ * the 'close' method+ * shut down communication with the vTPM+ * 'force' = 1 indicates that the socket *must* be closed+ * 'force' = 0 indicates that a connection may be maintained+ */+static int close_local_socket(tpmState *s, int force)+{+    if (force) {+        close(s->tpmTx.fd[0]);+#ifdef DEBUG_TPM+        fprintf(logfile,"Closed connection with fd %d\n",s->tpmTx.fd[0]);+#endif+        s->tpmTx.fd[0] = -1;+        return 1; /* socket was closed */+    }+#ifdef DEBUG_TPM+    fprintf(logfile,"Keeping connection with fd %d\n",s->tpmTx.fd[0]);+#endif+    return 0;+}++/*+ * the 'has_channel' method that checks whether there's a communication+ * channel with the vTPM+ */+static int has_channel_local_socket(tpmState *s)+{+    return (s->tpmTx.fd[0] > 0);+}++/**********************************************************************/++/*+ * read a byte of response data

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩电影网1区2区| 亚洲精品五月天| 国产一区二区在线看| 日韩精品自拍偷拍| 狠狠狠色丁香婷婷综合激情| 精品成人私密视频| 成人性视频免费网站| 亚洲国产精品精华液ab| 丁香五精品蜜臀久久久久99网站| 国产欧美一区二区三区在线老狼| jlzzjlzz亚洲日本少妇| 一区二区高清视频在线观看| 欧美精品欧美精品系列| 美女网站视频久久| 国产精品伦理在线| 欧美性极品少妇| 狠狠v欧美v日韩v亚洲ⅴ| 国产视频一区二区三区在线观看| 波多野结衣亚洲一区| 亚洲国产日韩在线一区模特| 欧美sm美女调教| kk眼镜猥琐国模调教系列一区二区| 亚洲激情男女视频| 日韩三级精品电影久久久| 高清shemale亚洲人妖| 一区二区三区波多野结衣在线观看| 9191久久久久久久久久久| 国产一区二三区好的| 亚洲女人的天堂| 亚洲精品一区二区三区在线观看| 国产二区国产一区在线观看| 亚洲一区在线免费观看| www激情久久| 日本高清不卡一区| 国产美女一区二区| 亚洲国产精品久久人人爱 | 国产精品区一区二区三区| 在线亚洲高清视频| 国产福利一区二区| 日韩电影网1区2区| 亚洲蜜臀av乱码久久精品蜜桃| 日韩一区二区三区在线观看| 99久久久免费精品国产一区二区| 婷婷综合五月天| 亚洲欧洲精品成人久久奇米网| 7777精品伊人久久久大香线蕉完整版 | 蜜桃久久av一区| 中文字幕一区二区三| 精品美女一区二区| 欧美视频一区二区在线观看| 国产成人久久精品77777最新版本| 性感美女久久精品| 亚洲日本va午夜在线影院| 欧美精品一区二区三区久久久 | 国产黄人亚洲片| 日日欢夜夜爽一区| 亚洲另类春色校园小说| 久久在线观看免费| 欧美一区二区高清| 欧美中文字幕一区二区三区 | 在线视频国内自拍亚洲视频| 国产一区二区成人久久免费影院 | 日韩一区二区高清| 欧美无砖专区一中文字| 99久久久精品免费观看国产蜜| 精品在线观看免费| 热久久久久久久| 亚洲高清视频的网址| 夜夜爽夜夜爽精品视频| ...中文天堂在线一区| 国产精品网站一区| 久久天天做天天爱综合色| 精品毛片乱码1区2区3区| 欧美一区二区日韩一区二区| 欧美日本在线视频| 欧美视频一区二区三区| 欧美日韩在线一区二区| 91看片淫黄大片一级在线观看| 不卡的看片网站| 成人精品视频.| 99精品视频中文字幕| 99久久综合狠狠综合久久| caoporm超碰国产精品| 波多野结衣精品在线| zzijzzij亚洲日本少妇熟睡| 不卡av免费在线观看| 91麻豆文化传媒在线观看| 色婷婷香蕉在线一区二区| 91国产成人在线| 欧美日韩另类国产亚洲欧美一级| 欧美日韩中文字幕一区二区| 欧美男女性生活在线直播观看| 欧美精三区欧美精三区| 欧美一区二区精品在线| 精品国产91亚洲一区二区三区婷婷| 日韩一区二区在线播放| 久久久噜噜噜久久人人看| 亚洲制服丝袜在线| 亚洲综合网站在线观看| 日韩成人伦理电影在线观看| 精品影视av免费| 国产成人av一区| 色菇凉天天综合网| 欧美一区日韩一区| 国产偷v国产偷v亚洲高清| 亚洲私人黄色宅男| 偷拍与自拍一区| 国产一区二区三区久久久| 99久久久无码国产精品| 欧美乱熟臀69xxxxxx| www亚洲一区| 一级精品视频在线观看宜春院| 日韩电影一二三区| 不卡的电视剧免费网站有什么| 欧美在线免费播放| 精品国产免费久久| 亚洲在线成人精品| 狠狠色综合日日| 99re免费视频精品全部| 日韩视频免费观看高清完整版| 亚洲国产高清不卡| 日韩av电影免费观看高清完整版 | 91美女视频网站| 精品美女一区二区| 亚洲在线视频一区| 国产一区二区伦理片| 欧美性一二三区| 精品国产乱码久久久久久夜甘婷婷 | 玉米视频成人免费看| 久久99国产精品免费| 在线视频国产一区| 国产精品全国免费观看高清| 日本成人中文字幕在线视频| av在线这里只有精品| 日韩三级av在线播放| 一区二区三区精密机械公司| 国产乱码字幕精品高清av| 精品视频在线视频| 亚洲欧洲色图综合| 国产精品996| 日韩视频免费观看高清在线视频| 亚洲欧美激情小说另类| 国产伦理精品不卡| 日韩欧美成人午夜| 亚洲线精品一区二区三区| 成人短视频下载| 精品国产一区二区三区四区四| 亚洲一区二区三区自拍| 91在线观看免费视频| 国产日韩精品视频一区| 麻豆视频一区二区| 欧美精品第1页| 一区二区三区在线免费观看| 成人av网站在线| 久久九九全国免费| 国产一区二区精品久久| 日韩欧美一级二级| 免费的成人av| 制服丝袜中文字幕亚洲| 亚洲不卡在线观看| 91成人免费在线| 亚洲一区在线观看免费观看电影高清| av一本久道久久综合久久鬼色| 久久精品亚洲精品国产欧美| 国产一区二区在线影院| 精品久久99ma| 精品一区二区三区不卡 | 日韩欧美一级特黄在线播放| 亚洲a一区二区| 欧美日韩一区二区三区四区| 亚洲精品成人悠悠色影视| 一本大道久久a久久精品综合| 中文字幕在线观看不卡视频| 成人黄色片在线观看| 国产精品免费aⅴ片在线观看| 成人精品国产免费网站| 中文字幕视频一区| 91精品福利视频| 亚洲高清不卡在线| 91精品国产一区二区三区蜜臀| 免费观看一级特黄欧美大片| 91精品国产乱| 激情五月激情综合网| 国产精品天干天干在线综合| 99久久免费精品| 亚洲成人你懂的| 精品久久久久久亚洲综合网| 国产精品自拍在线| 中文字幕日韩欧美一区二区三区| 91日韩在线专区| 亚洲成av人片| 久久亚洲二区三区| 99视频精品免费视频| 午夜不卡av免费| 久久久综合视频| 在线观看亚洲专区| 麻豆成人免费电影| 国产精品久久午夜| 欧美日韩高清一区二区| 国产精一品亚洲二区在线视频|