In SEV-enabled guest the physical addresses in page table will
have C-bit set, we need to clear the C-bit when walking the page table.
The C-bit position should be available in cpuid Fn8000_001f[EBX]
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
target-i386/helper.c
nes
to decrypt/encrypt the contents.
A sequence looks like:
cpu_phyiscal_memory_rw_debug
cpu_phyiscal_memory_rw_debug_internal
memory_encryption->write
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hw/i386/pc.c |7 +++
hw/i386/pc_sysfw.c |4
2 files
Add a new memory debug attribute, this attribute should be set when
memory read or write access is performed for debugging purposes.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/exec/memattrs.h |4
1 file changed, 4 insertions(+)
diff --git a/include/exec/mema
during guest launch.
to use encrypted guest launch
# $QEMU \
-object sev-receive-info,id=launch0 \
-object sev-send-info,id=send0 \
-object sev-guest-info,id=sev0,launch=launch0,send=send0 \
.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
Makefile.
, RECEIVE_UPDATE and RECEIVE_FINISH commands
- implement SEND_START, SEND_UPDATE and SEND_FINISH commands
- implement SEV guest migration and snapshotting support
- virtio support in SEV guest
Brijesh Singh (16):
memattrs: add debug attrs
exec: add guest RAM read and write ops
exec: add
during launch start process will be used to encrypt the guest memory.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
sev.c | 30 +-
1 file changed, 29 insertions(+), 1 deletion(-)
diff --git a/sev.c b/sev.c
index 226ad76..ead7c5a 100644
--- a/sev.c
Fn8000_001f cpuid provides the memory encryption (aka C-bit)
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
target-i386/cpu.c | 10 ++
1 file changed, 10 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6a1afab..43e698b 100644
--- a/target-i386
update 'info kvm' to display the memory encryption support.
(qemu) info kvm
kvm support: enabled
memory encryption: disabled
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hmp.c|2 ++
qapi-schema.json |7 +--
qmp.c|1 +
3 files chan
-guest,launch-id=unencrypted,id=sev-guest \
-object security-policy,id=memory-encryption=sev-guest,id=mypolicy \
-machine ...,security-policy=mypolicy
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c |7 ++
hw/core/Makefil
The command is used to encrypt a guest memory region using the VM Encryption
Key (VEK) created by LAUNCH_START command. The firmware will also update
the measurement with the contents of the memory region. This measurement
can be retrieved by calling LAUNCH_FINISH command.
Signed-off-by: Brijesh
:
cpu_memory_rw_debug
cpu_physical_memory_rw_debug_internal
sev_debug_encrypt
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
sev.c | 22 +-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/sev.c b/sev.c
index c0f6ae4..8a07c0d 100644
--- a/sev.c
+++ b
APIs then in future
we can define some kind of global debug policy to control debug behavior.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c| 32
include/exec/cpu-common.h | 15 +++
2 files changed, 47 inse
cpu_physical_memory_rw_debug_internal
sev_debug_decrypt
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
sev.c | 22 --
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/sev.c b/sev.c
index 21c491c..c0f6ae4 100644
--- a/sev.c
+++ b/sev.c
@@ -
;
memory_region_init_ram(mem, NULL, "memory", size, NULL);
memory_region_set_ram_ops(mem, ops);
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c| 57 -
include/exec/cpu-common.h |2 +-
include/exec/mem
updates hmp monitor to use debug version of memory access apis when
accessing the guest memory.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
cpus.c|2 +-
disas.c |2 +-
monitor.c |2 +-
target-i386/helper.c
the measurement via 'measurement' property defined
in 'sev-launch-info' object.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
sev.c | 17 +++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/sev.c b/sev.c
index dcd7c48..21c491c 100644
--- a/sev.c
+++ b
will go through the
encryption routines which will encrypt the data as it copies into guest
memory. Similarly after we are done with copying destory the encryption
context.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hw/core/loader.c | 13 +
1 file changed, 13 inse
Hi Michael,
Again it isn't clear how much value does attestation have,
we are assuming arbitrary restrictions on the attacker such
as inability to trigger exits at random times, why not
assume it can't attack guest during boot?
IOW it seems reasonable to just ignore the need for attestation
Hi Paolo,
On 09/13/2016 06:07 PM, Paolo Bonzini wrote:
On 13/09/2016 16:49, Brijesh Singh wrote:
Fn8000_001f cpuid provides the memory encryption (aka C-bit)
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
target-i386/cpu.c |3 +++
1 file changed, 3 insertions(+)
diff
Hi Paolo,
On 09/21/2016 10:58 AM, Paolo Bonzini wrote:
On 21/09/2016 17:55, Brijesh Singh wrote:
I'm working on v2 and getting ready for another review but not sure how
to address this feedback. For now, I can drop this patch from the series
and get other patches reviewed. But I would like
Hi Michael and Paolo,
On 09/13/2016 01:37 PM, Michael S. Tsirkin wrote:
On Tue, Sep 13, 2016 at 10:49:29AM -0400, Brijesh Singh wrote:
Typically linux kernel, initrd and cmdline are build and loaded
into guest memory through linux optionrom. The linux optionrom is
probed and executed
Hi Paolo,
typedef struct {
@@ -3568,6 +3578,7 @@ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
int l;
hwaddr phys_addr;
target_ulong page;
+int mode = is_write ? WRITE_DATA : READ_DATA;
while (len > 0) {
int asidx;
@@ -3583,14 +3594,9 @@ int
So looking at code, i have impression that write will go through the
cpu_physical_memory_write_rom but the read will still go through
address_space_rw which will eventually invoke address_space_read.
Yes, you'd have to modify it a bit. Something like
Sure this will works, thanks for the
On 09/14/2016 04:52 PM, Paolo Bonzini wrote:
On 14/09/2016 23:47, Brijesh Singh wrote:
On 09/14/2016 04:00 PM, Paolo Bonzini wrote:
On 14/09/2016 22:59, Brijesh Singh wrote:
I will look into hooking up the callback into ROM read/write ops. I was
thinking about adding a new argument
On 09/14/2016 04:00 PM, Paolo Bonzini wrote:
On 14/09/2016 22:59, Brijesh Singh wrote:
I will look into hooking up the callback into ROM read/write ops. I was
thinking about adding a new argument in
cpu_physical_memory_write_rom_internal()
void cpu_physical_memory_write_rom(AddressSpace
On 09/14/2016 03:44 PM, Paolo Bonzini wrote:
On 14/09/2016 22:36, Michael S. Tsirkin wrote:
Specifically with debug, if you have debug then clearly you
can dump guest memory. This is what this feature is about.
If we want a hypervisor that can not dump guest memory, let's
add a flag like
On 09/14/2016 03:38 PM, Paolo Bonzini wrote:
On 14/09/2016 22:29, Brijesh Singh wrote:
Does the guest have to check the measured data (e.g. with a hash) too,
to check that it hasn't been tampered with outside the secure
processor's control? Of course this would result in garbage written
Hi Paolo,
On 09/13/2016 06:05 PM, Paolo Bonzini wrote:
On 13/09/2016 16:49, Brijesh Singh wrote:
+/* Register SEV read/write ops for the guest RAM */
+if (kvm_sev_enabled())
+memory_region_set_ram_ops(ram, kvm_sev_get_ram_ops());
If you don't actually need this one except
*/
#define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 })
+/* Access the guest memory for debug purposes */
+#define MEMTXATTRS_SEV_DEBUG ((MemTxAttrs) { .sev_debug = 1 })
#endif
Just make it "debug" and MEMTXATTRS_DEBUG.
Thanks, will fix in v2.
On 09/13/2016 05:59 PM, Paolo Bonzini wrote:
On 13/09/2016 16:50, Brijesh Singh wrote:
In SEV-enabled mode we need to reload the BIOS image on loader reset, this
will ensure that BIOS image gets encrypted and included as part of launch
meausrement on guest reset.
Just to check if I
Hi Michael,
Yes policy is described in chapter 3, page 23. I am open to separate the
fields.
Let me know if something like this works
sev-launch-rule,flags.ks=0,policy.dbg=0,policy.ks=0,policy.nosend=0,...
My question is, does all of it have to be sev specific?
For example, add a generic
Hi Paolo,
On 09/13/2016 05:47 PM, Paolo Bonzini wrote:
On 13/09/2016 16:50, Brijesh Singh wrote:
This patch adds methods to register a callback in qemu_system_reset().
- qemu_register_pre_reset() : function will be called just after
entering into qemu_system_reset
Various commands and parameters are documented [1]
[1] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Spec.pdf
If I understand correctly, the docs describe the firmware
interface. The interface provided by QEMU is not the same thing,
and needs to be documented as well (even if it
Hi Eric,
Thanks for feedback.
# @present: true if KVM acceleration is built into this executable
#
+# @sev: true if SEV is active
Worth expanding what the acronym stands for. Also needs a '(since 2.8)'
designator.
will fix in v2.
+#
# Since: 0.14.0
##
-{ 'struct': 'KvmInfo', 'data':
On 09/13/2016 09:28 PM, Michael S. Tsirkin wrote:
On Tue, Sep 13, 2016 at 10:48:27AM -0400, Brijesh Singh wrote:
The SEV DEBUG_DECRYPT command is used for decrypting a guest memory
for the debugging purposes. Note that debugging is permitting only
when guest policy allows it.
When wouldn't
Hi Michael,
On 09/13/2016 01:39 PM, Michael S. Tsirkin wrote:
On Tue, Sep 13, 2016 at 10:50:06AM -0400, Brijesh Singh wrote:
In SEV-enabled guest dma should be performed on shared pages. Since
the SeaBIOS executes in non PAE mode and does not have access to C-bit
to create a shared page hence
Hi Eduardo,
On 09/13/2016 10:58 AM, Eduardo Habkost wrote:
A typical SEV config file looks like this:
Are those config options documented somewhere?
Various commands and parameters are documented [1]
[1] http://support.amd.com/TechDocs/55766_SEV-KM%20API_Spec.pdf
[sev-launch]
/55766_SEV-KM%20API_Spec.pdf
The following kvm RFC patches defines and implements this command
http://marc.info/?l=kvm=147190852423972=2
http://marc.info/?l=kvm=147190946024236=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h |7 ++
=kvm=147190852423972=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h | 18 ++
sev.c| 34 ++
2 files changed, 52 insertions(+)
diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h
index a
commands before starting the guest.
$ qemu -sev type=encrypted config=guest_02.conf
The config file will contains various parameters (e.g key , policy)
required during guest launch process.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
qemu-options.hx |6 ++
://marc.info/?l=kvm=147191038624432=2
---
TODO:
- send seabios RFC's on seabios mailing list
- implement SEV guest migration command support
- implement SEV snapshotting command support
- virtio support in SEV guest
Brijesh Singh (22):
exec: add guest RAM read/write ops
cpu-common: add debug
In SEV-enabled mode we need to reload the BIOS image on loader reset, this
will ensure that BIOS image gets encrypted and included as part of launch
meausrement on guest reset.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hw/core/loader.c |7 ++-
1 file changed, 6 inse
If guest is launched into SEV-enabled mode then read/write to the
BIOS and RAM memory regions should be performed using the SEV commands.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hw/i386/pc.c |5 +
hw/i386/pc_sysfw.c |6 ++
2 files changed, 11 inse
.
These callback will allow us to hook the SEV launch START and FINISH
commands into qemu_system_reset() handlder to start and finalize the SEV
guest launch process.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/hw/hw.h |2 ++
sev.c | 14 ++
Fn8000_001f cpuid provides the memory encryption (aka C-bit)
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
target-i386/cpu.c |3 +++
1 file changed, 3 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 6a1afab..e039c08 100644
--- a/target-i386/cpu.c
In SEV-enabled guest dma should be performed on shared pages. Since
the SeaBIOS executes in non PAE mode and does not have access to C-bit
to create a shared page hence disable the dma operation when reading
from fw_cfg interface.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hw
DEBUG DECRYPT/ENCRYPT commands
to read/write into guest memory.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c | 11 ++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/exec.c b/exec.c
index 604bd05..b1df25d 100644
--- a/exec.c
+++ b/exec.c
@@ -
The patch adds sev_debug_mode attribute in MemTxAttrs. This attribute
will be set when debug version of memory read/write API's are used in
SEV-enabled guest.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/exec/memattrs.h |4
1 file changed, 4 insertions(+)
diff
abcdef"
dh_pub_qy = "0123456789abcdef0123456789abcdef"
nonce = "0123456789abcdef"
vcpu_count = "1"
vcpu_length = "30"
vcpu_mask = "00ab"
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
Makefile.targe
In SEV-enabled guest the physical addresses in page table will
have C-bit set, we need to clear the C-bit when walking the page table.
The C-bit position should be available in cpuid Fn8000_001f[EBX]
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
target-i386/helper.c
Update the 'info kvm' monitor command to display the SEV status.
(qemu) info kvm
kvm support: enabled
sev support: enabled (running)
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
hmp.c| 14 ++
qapi-schema.json |4 +++-
qmp.c|1 +
3
patches defines and implements this command
http://marc.info/?l=kvm=147190852423972=2
http://marc.info/?l=kvm=147191068524579=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h | 10 ++
sev.c| 23 +++
2 files chang
This patch updates hmp monitor to use cpu_physical_memory_read_debug()
when accessing the guest memory for debug dumps.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
disas.c |2 +-
monitor.c |2 +-
target-i386/monitor.c | 18 ++-
The patch implements kvm_sev_get_ram_ops() which provides guest RAM
read/write callback. Depending on the memory attributes and guest launch
state, the callback will use SEV launch update or SEV debug commands
to read/write into guest memory.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.
://marc.info/?l=kvm=147190859023996=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h |9 +
sev.c| 36
2 files changed, 45 insertions(+)
diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h
;
memory_region_init_ram(mem, NULL, "memory", size, NULL);
memory_region_set_ram_ops(mem, ops);
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c| 304 +++--
include/exec/memory.h | 25
2 files changed
%20API_Spec.pdf
The following KVM RFC patches defines and implements this command
http://marc.info/?l=kvm=147190852423972=2
http://marc.info/?l=kvm=147190856623987=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h | 17 +-
sev.c
=147190861124032=2
http://marc.info/?l=kvm=147190861124032=2
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
include/sysemu/sev.h | 10 ++
sev.c| 23 +++
2 files changed, 33 insertions(+)
diff --git a/include/sysemu/sev.h b/include/sysemu/sev.h
create/set special sev specific MemTxAttrs to indicate that
RAM access is for debugg purposes and use SEV debug commands to
read and write guest memory for debug purposes.
Signed-off-by: Brijesh Singh <brijesh.si...@amd.com>
---
exec.c| 10 ++
include/ex
401 - 459 of 459 matches
Mail list logo