Return to course pageReturn to index

Final

You may use any resource that existed prior to this exam opening, including websites, books, etc; but should not consult friends, tutors, forums, or other interactive help for this exam.

You must not share any information about this exam (even how you felt about it) with any party (even others who have taken it) until after it closes at 2020-05-07 23:59 EDT.

The following ask about adding limitations to computer functionality.

Question 1 (dropped) (see above)

Suppose we want to limit the use of the xorq command to only certain users or operation modes. This would require modification of

Question 2 (0 / 1 pt; mean 0.78) (see above)

Suppose we want to limit all user-mode programs so they can only access to files have an even number of letters in their names. This would require modification of

Question 3 (0 / 1 pt; mean 0.59) (see above)

Suppose we want to throttle bandwidth so each user could only send 1MB of network traffic per minute. This would require modification of

The following ask about interrupts and related concepts

Question 4 (0 / 1 pt; mean 0.45) (see above)

What's the difference between an interrupt number and a system call number?

  1. interrupt number is (usually) hardware to software, but system call number is software to software

Question 5 (0.44 / 1 pt; mean 0.71) (see above)

The following are all true of interrupts; which are also true of signals?

We have often noted each of the following things about memory this semester; these questions ask how they have been refined by our understanding of virtual memory

Question 6 (0 / 1 pt; mean 0.27) (see above)

Linux on x86-64 splits memory in half: the lower half is user-mode and the upper half is kernel-mode

Question 7 (0 / 1 pt; mean 0.78) (see above)

The call stack (the one handled by pushq, callq, etc) grows toward smaller addresses

Question 8 (dropped) (see above)

When a process is suspended, allowing other processes to use the processor, its memory is inaccessibly.

Consider the 4-level page table hierarchy we discussed Intel processors using, with a 4K pages, 48-bit virtual addresses, and 52-bit physical addresses

Question 9 (0 / 1 pt; mean 0.58) (see above)

If I run movq (%rax), %rbx when (%rax) is on a page that is not in the TLB, how many memory accesses does the instruction perform? Answer as a base-10 integer, like "1" or "39"

Answer:
Key: 5
Question 10 (0 / 1 pt; mean 0.71) (see above)

If I run movq (%rax), %rbx when (%rax) is on a page that is in the TLB, how many memory accesses does the instruction perform? Answer as a base-10 integer, like "1" or "39"

Answer:
Key: 1
Question 11 (0 / 1 pt; mean 0.53) (see above)

If my code accesses the 50-bit address 0x2100010001000

Question 12 (0 / 1 pt; mean 0.53)

If a disk read is performed via Direct Memory Access (DMA),

The following ask about the ability of devices on a bus to interact. In particular, assume that a bus-topology network connects the keyboard, disk, network card, and processor.

Assume that any special status a bus-connected component can have (hub position, master status, etc) is held by the processor and not the other components.

Question 13 (0 / 1 pt; mean 0.48) (see above)

Suppose I create a nefarious disk that is programmed to log every keystroke you make. Assume I put any computing power needed for this task inside the disk hardware.

Question 14 (dropped) (see above)

Suppose I create a nefarious disk that is programmed to send your files to me over your Internet connection. Assume I put any computing power needed for this task inside the disk hardware, but do not have network connectivity in the disk itself.

HTTPS delivered web requests and replies using TLS, TCP, and IP. The TLS encrypts the request and reply body, but does not encrypt the IP and TCP headers.

Question 15 (0 / 1 pt; mean 0.59) (see above)

Why does TLS not encrypt the IP header?

Question 16 (0 / 1 pt; mean 0.71) (see above)

Why does TLS not encrypt the TCP header?

  1. we could have had the OS handle all decrption and then route to the program, but that would mean a program couldn't hide information from the OS and other programs on the same computer or use an encryption method the OS did not yet have built-in

The following ask about digital signatures

Question 17 (0 / 1 pt; mean 0.76) (see above)

Which of the following is used to sign a document?

Question 18 (0 / 1 pt; mean 0.55) (see above)

Which of the following is used to verify the signature of a document?

Question 19 (0 / 1 pt; mean 0.73) (see above)

A digital certificate is

The following ask about caches, in particular the memory cache hierarchy

Question 20 (0 / 1 pt; mean 0.81) (see above)

Why do caches have larger blocks that a single access will need?

Question 21 (0 / 1 pt; mean 0.52) (see above)

Why do caches have multiple lines per set?

Question 22 (0 / 1 pt; mean 0.51) (see above)

Why do caches have multiple small sets instead of one large one?

Question 23 (0 / 0.5 pt; mean 0.39) (see above)

Why are some caches write-back?

Question 24 (0 / 0.5 pt; mean 0.2) (see above)

Why are some caches write-through?

Question 25 (0 / 1 pt; mean 0.7)

Which of the following best describes Amdahl's Law?

Question 26 (0.5 / 1 pt; mean 0.89)

Which two of the following correctly describe concurrency and parallelism?

Question 27 (0.5 / 1 pt; mean 0.86)

Which of the following are true of synchronization primitives?

Most synchronization primitives can be created using several other primitives and a few auxiliary data structures. Which of the following is closest to implementing barriers with other pthreads primitives?

Question 28 (0.57 / 1 pt; mean 0.73) (see above)

The pthread_barrier_t needs a condition variable for threads to wait on, a mutex to lock access to other variables, and which of the following?

Question 29 (0 / 1 pt; mean 0.72) (see above)

If our pthread_barrier_t was implemented as

lock the mutex
manipulate variables
if (variables suggest should wait) {
    wait on condition variable
} else {
    release all waiting threads
}
unlock the mutex

what would go wrong? Assume the barrier requires at least two threads to continue.

Question 30 (0 / 1 pt; mean 0.58) (see above)

If our pthread_barrier_t was implemented as

lock the mutex
manipulate variables
if (variables suggest should wait) {
    unlock the mutex
    wait on condition variable
} else {
    unlock the mutex
    release all waiting threads
}

what would go wrong? Assume the barrier requires at least two threads to continue.

The following ask about Dining Philosophers and its solutions documented in Lab 09.

Question 31 (0 / 1 pt; mean 0.25) (see above)

The "arbitrator" solution to dining philosophers ensures there is no deadlock by removing which of the necessary conditions of deadlock?

  1. I can hold the arbitration mutex while waiting for a chopstick

Question 32 (0 / 1 pt; mean 0.61) (see above)

The "resource hirearchy" solution to dining philosophers ensures there is no deadlock by removing which of the necessary conditions of deadlock?

Question 33 (0 / 1 pt; mean 0.83)

Pipelining ____ throughput and ____ latency.

Question 34 (0 / 1 pt; mean 0.8)

Out of order execution ____ throughput and ____ latency.

  1. Technically false, but often described as true because it lets us get a head-start on some instructions so the fact that they have a similar or increased latency is compensated by earlier starts

  2. Technically true: a single instruction has more steps to go through (register renaming, etc) than it would if not out-of-order, requiring more time

Question 35 (0.33 / 1 pt; mean 0.82)

Speculative execution can increase the performance of

Both Spectre and Meltdown exploits included (a compiled or language-specifc version of) the code

y = arr[(*x) * 4096]

where x was a pointer to an address that should not be accessible, but whose value was leaked by the exploit; arr was a pointer to memory owned by the attacker; and y was a register owned by the attacker.

Question 36 (0 / 1 pt; mean 0.66) (see above)

After running the above code, how do these exploits learn the contents of *x?

Question 37 (0 / 1 pt; mean 0.6) (see above)

Why the 4096 multiplicand?

Return to course pageReturn to index