[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 08/18] s390x: Add SIDA memory ops
From: |
David Hildenbrand |
Subject: |
Re: [PATCH v6 08/18] s390x: Add SIDA memory ops |
Date: |
Wed, 4 Mar 2020 18:39:40 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 |
On 04.03.20 12:42, Janosch Frank wrote:
> Protected guests save the instruction control blocks in the SIDA
> instead of QEMU/KVM directly accessing the guest's memory.
>
> Let's introduce new functions to access the SIDA.
"The new memops are available with KVM_CAP_S390_PROTECTED, so let's
check for that."
>
> Signed-off-by: Janosch Frank <address@hidden>
> ---
> linux-headers/linux/kvm.h | 2 ++
> target/s390x/cpu.h | 7 ++++++-
> target/s390x/kvm.c | 25 +++++++++++++++++++++++++
> target/s390x/kvm_s390x.h | 2 ++
> target/s390x/mmu_helper.c | 14 ++++++++++++++
> 5 files changed, 49 insertions(+), 1 deletion(-)
>
> diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h
> index e36f761194..c30344ab00 100644
> --- a/linux-headers/linux/kvm.h
> +++ b/linux-headers/linux/kvm.h
> @@ -483,6 +483,8 @@ struct kvm_s390_mem_op {
> /* types for kvm_s390_mem_op->op */
> #define KVM_S390_MEMOP_LOGICAL_READ 0
> #define KVM_S390_MEMOP_LOGICAL_WRITE 1
> +#define KVM_S390_MEMOP_SIDA_READ 2
> +#define KVM_S390_MEMOP_SIDA_WRITE 3
> /* flags for kvm_s390_mem_op->flags */
> #define KVM_S390_MEMOP_F_CHECK_ONLY (1ULL << 0)
> #define KVM_S390_MEMOP_F_INJECT_EXCEPTION (1ULL << 1)
This should go into the header sync.
[...]
> index 7e4d9d267c..2578c838f8 100644
> --- a/target/s390x/cpu.h
> +++ b/target/s390x/cpu.h
> @@ -824,7 +824,12 @@ int s390_cpu_virt_mem_rw(S390CPU *cpu, vaddr laddr,
> uint8_t ar, void *hostbuf,
> #define s390_cpu_virt_mem_check_write(cpu, laddr, ar, len) \
> s390_cpu_virt_mem_rw(cpu, laddr, ar, NULL, len, true)
> void s390_cpu_virt_mem_handle_exc(S390CPU *cpu, uintptr_t ra);
> -
> +int s390_cpu_pv_mem_rw(S390CPU *cpu, unsigned int offset, void *hostbuf,
double space after "offset,"
[...]
>
> +int s390_cpu_pv_mem_rw(S390CPU *cpu, unsigned int offset, void *hostbuf,
> + int len, bool is_write)
> +{
> + int ret;
> +
> + if (kvm_enabled()) {
> + ret = kvm_s390_mem_op_pv(cpu, offset, hostbuf, len, is_write);
> + } else {
> + /* Protected Virtualization is a KVM/Hardware only feature */
> + g_assert_not_reached();
> + }
> + return ret;
> +}
I suspect nobody will ever check the return value, correct?
With the things changed
Reviewed-by: David Hildenbrand <address@hidden>
--
Thanks,
David / dhildenb
- Re: [PATCH v6 03/18] s390x: protvirt: Support unpack facility, (continued)
- [PATCH v6 06/18] s390x: protvirt: Inhibit balloon when switching to protected mode, Janosch Frank, 2020/03/04
- [PATCH v6 07/18] s390x: protvirt: KVM intercept changes, Janosch Frank, 2020/03/04
- [PATCH v6 05/18] s390x: protvirt: Handle diag 308 subcodes 0,1,3,4, Janosch Frank, 2020/03/04
- [PATCH v6 08/18] s390x: Add SIDA memory ops, Janosch Frank, 2020/03/04
- Re: [PATCH v6 08/18] s390x: Add SIDA memory ops,
David Hildenbrand <=
- [PATCH v6 15/18] s390x: protvirt: Handle SIGP store status correctly, Janosch Frank, 2020/03/04
- [PATCH v6 10/18] s390x: protvirt: SCLP interpretation, Janosch Frank, 2020/03/04
- [PATCH v6 13/18] s390x: protvirt: Disable address checks for PV guest IO emulation, Janosch Frank, 2020/03/04