From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515998261202263.5124328391579; Sun, 14 Jan 2018 22:37:41 -0800 (PST) Received: from localhost ([::1]:41144 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayOq-0002b1-7h for importer@patchew.org; Mon, 15 Jan 2018 01:37:40 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKP-0007kq-8q for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKO-0006oI-12 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:05 -0500 Received: from mail-pg0-x241.google.com ([2607:f8b0:400e:c05::241]:42516) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKK-0006lf-OI; Mon, 15 Jan 2018 01:33:00 -0500 Received: by mail-pg0-x241.google.com with SMTP id q67so7503546pga.9; Sun, 14 Jan 2018 22:33:00 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.32.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:32:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YWtrm3s/079NtD4ijUcqtJN5UePjQDnQEuwCoHd/R0c=; b=VxD5yqGM0voloO8u7aycwNRoCs3OjCsYSbfAK1kvdBmZyV9CYir5fkdBQ95V36I8Hr YGwgk/ISDcRKEwLLAMcIktM2fmgv+aj77T5ChimD6OTw3vRDRh/BtFxV/mZ+PUwVxj78 vPJFjc0rM0vwjaEP+3/Zw/rkJ8ia2HLm9Oez4vjvmFDKsyamqM0j0pgwZu7hNhIJXbmO xh7Q2Xre1XuTkd0EYT5QYilZGxgUuOedJHROPrxsjn651P/yfzLagTpMpCXrVCa4jGN3 tyLrjeb2ewIeid2p7Zd5IZJQBgPehW5ibGvAeg4N3MwFlVHuCOiWOkYw1iPZs31lDsuI Stxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=YWtrm3s/079NtD4ijUcqtJN5UePjQDnQEuwCoHd/R0c=; b=oSmjoKKkMJL8c2CDjj5gYwiX4Eb2yg9wYzZ0SJXO5UAI5GWni87uAId+nkGOss4wsL 4KyiM8qm1jTHdFofX98QsORdT1ojJXBr0Xe0UQ6cynZ9fEP0g3KnmgC4nYe89D6k5vTu UMb3sv9+BzOwN7GgqFzyuwdkBW7DGnaMHQC1iAbuoQWSsb1FlHxhpLK0EwfAZlJriHpM NO30UHXfQnKXMtFHKn163yxv8oyli0s3K+6q1PWhASaSa4QVnSb/cf4uegZ2MZPDe2nF ekzSvq9+Cwld+FQ7mIISilNiRntNDEd5CBrFptayFLsw63dQomwKMc3LHg0E/r871VE+ /9pQ== X-Gm-Message-State: AKGB3mIEjcp6R2tgU1GmNquXnN0FPsDWmQaGODLzX705kwo/9SVahjzc 9BEqDrrY557uPbEsa8q8Q/qwhmno X-Google-Smtp-Source: ACJfBould59GckhrCRjUqUz1hpYzuVWgxunSOnEy5WvBqk9A4pK6zGjr+bGEycTScq1BnEh1YiGL8Q== X-Received: by 10.99.65.70 with SMTP id o67mr27055095pga.125.1515997979607; Sun, 14 Jan 2018 22:32:59 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:30 +1100 Message-Id: <20180115063235.7518-2-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::241 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 1/6] target/ppc/kvm: Add cap_ppc_safe_[cache/bounds_check/indirect_branch] X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add three new kvm capabilities used to represent the level of host support for three corresponding workarounds. Host support for each of the capabilities is queried through the new ioctl KVM_PPC_GET_CPU_CHAR which returns four uint64 quantities. The first two, character and behaviour, represent the available characteristics of the cpu and the behaviour of the cpu respectively. The second two, c_mask and b_mask, represent the mask of known bits for the character and beheviour dwords respectively. Signed-off-by: Suraj Jitindar Singh --- include/hw/ppc/spapr.h | 12 +++++++++ linux-headers/asm-powerpc/kvm.h | 8 ++++++ linux-headers/linux/kvm.h | 3 +++ target/ppc/kvm.c | 58 +++++++++++++++++++++++++++++++++++++= ++++ target/ppc/kvm_ppc.h | 18 +++++++++++++ 5 files changed, 99 insertions(+) diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 0f5628f22e..eded0ea57d 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -295,6 +295,18 @@ struct sPAPRMachineState { #define H_DABRX_KERNEL (1ULL<<(63-62)) #define H_DABRX_USER (1ULL<<(63-63)) =20 +/* Values for KVM_PPC_GET_CPU_CHAR & H_GET_CPU_CHARACTERISTICS */ +#define H_CPU_CHAR_SPEC_BAR_ORI31 PPC_BIT(0) +#define H_CPU_CHAR_BCCTRL_SERIALISED PPC_BIT(1) +#define H_CPU_CHAR_L1D_FLUSH_ORI30 PPC_BIT(2) +#define H_CPU_CHAR_L1D_FLUSH_TRIG2 PPC_BIT(3) +#define H_CPU_CHAR_L1D_THREAD_PRIV PPC_BIT(4) +#define H_CPU_CHAR_HON_BRANCH_HINTS PPC_BIT(5) +#define H_CPU_CHAR_THR_RECONF_TRIG PPC_BIT(6) +#define H_CPU_BEHAV_FAVOUR_SECURITY PPC_BIT(0) +#define H_CPU_BEHAV_L1D_FLUSH_PR PPC_BIT(1) +#define H_CPU_BEHAV_BNDS_CHK_SPEC_BAR PPC_BIT(2) + /* Each control block has to be on a 4K boundary */ #define H_CB_ALIGNMENT 4096 =20 diff --git a/linux-headers/asm-powerpc/kvm.h b/linux-headers/asm-powerpc/kv= m.h index 61d6049f4c..5d2cb26848 100644 --- a/linux-headers/asm-powerpc/kvm.h +++ b/linux-headers/asm-powerpc/kvm.h @@ -443,6 +443,14 @@ struct kvm_ppc_rmmu_info { __u32 ap_encodings[8]; }; =20 +/* For KVM_PPC_GET_CPU_CHAR */ +struct kvm_ppc_cpu_char { + __u64 character; /* characteristics of the CPU */ + __u64 behaviour; /* recommended software behaviour */ + __u64 c_mask; /* valid bits in character */ + __u64 b_mask; /* valid bits in behaviour */ +}; + /* Per-vcpu XICS interrupt controller state */ #define KVM_REG_PPC_ICP_STATE (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0x8c) =20 diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h index ce6c2f11f4..c35f1bd363 100644 --- a/linux-headers/linux/kvm.h +++ b/linux-headers/linux/kvm.h @@ -932,6 +932,7 @@ struct kvm_ppc_resize_hpt { #define KVM_CAP_HYPERV_SYNIC2 148 #define KVM_CAP_HYPERV_VP_INDEX 149 #define KVM_CAP_S390_AIS_MIGRATION 150 +#define KVM_CAP_PPC_GET_CPU_CHAR 151 =20 #ifdef KVM_CAP_IRQ_ROUTING =20 @@ -1261,6 +1262,8 @@ struct kvm_s390_ucas_mapping { #define KVM_PPC_CONFIGURE_V3_MMU _IOW(KVMIO, 0xaf, struct kvm_ppc_mmuv3_= cfg) /* Available with KVM_CAP_PPC_RADIX_MMU */ #define KVM_PPC_GET_RMMU_INFO _IOW(KVMIO, 0xb0, struct kvm_ppc_rmmu_inf= o) +/* Available with KVM_CAP_PPC_GET_CPU_CHAR */ +#define KVM_PPC_GET_CPU_CHAR _IOR(KVMIO, 0xb1, struct kvm_ppc_cpu_ch= ar) =20 /* ioctl for vm fd */ #define KVM_CREATE_DEVICE _IOWR(KVMIO, 0xe0, struct kvm_create_device) diff --git a/target/ppc/kvm.c b/target/ppc/kvm.c index 914be687e7..8cce855cab 100644 --- a/target/ppc/kvm.c +++ b/target/ppc/kvm.c @@ -89,6 +89,9 @@ static int cap_mmu_radix; static int cap_mmu_hash_v3; static int cap_resize_hpt; static int cap_ppc_pvr_compat; +static int cap_ppc_safe_cache; +static int cap_ppc_safe_bounds_check; +static int cap_ppc_safe_indirect_branch; =20 static uint32_t debug_inst_opcode; =20 @@ -121,6 +124,7 @@ static bool kvmppc_is_pr(KVMState *ks) } =20 static int kvm_ppc_register_host_cpu_type(MachineState *ms); +static void kvmppc_get_cpu_characteristics(KVMState *s); =20 int kvm_arch_init(MachineState *ms, KVMState *s) { @@ -147,6 +151,7 @@ int kvm_arch_init(MachineState *ms, KVMState *s) cap_mmu_radix =3D kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_RADIX); cap_mmu_hash_v3 =3D kvm_vm_check_extension(s, KVM_CAP_PPC_MMU_HASH_V3); cap_resize_hpt =3D kvm_vm_check_extension(s, KVM_CAP_SPAPR_RESIZE_HPT); + kvmppc_get_cpu_characteristics(s); /* * Note: setting it to false because there is not such capability * in KVM at this moment. @@ -372,6 +377,44 @@ struct ppc_radix_page_info *kvm_get_radix_page_info(vo= id) return radix_page_info; } =20 +static void kvmppc_get_cpu_characteristics(KVMState *s) +{ + struct kvm_ppc_cpu_char c; + int ret; + + /* Assume broken */ + cap_ppc_safe_cache =3D 0; + cap_ppc_safe_bounds_check =3D 0; + cap_ppc_safe_indirect_branch =3D 0; + + ret =3D kvm_vm_check_extension(s, KVM_CAP_PPC_GET_CPU_CHAR); + if (!ret) { + return; + } + ret =3D kvm_vm_ioctl(s, KVM_PPC_GET_CPU_CHAR, &c); + if (ret < 0) { + return; + } + /* Parse and set cap_ppc_safe_cache */ + if (~c.behaviour & c.b_mask & H_CPU_BEHAV_L1D_FLUSH_PR) { + cap_ppc_safe_cache =3D 2; + } else if ((c.character & c.c_mask & H_CPU_CHAR_L1D_THREAD_PRIV) && + (c.character & c.c_mask & (H_CPU_CHAR_L1D_FLUSH_ORI30 | + H_CPU_CHAR_L1D_FLUSH_TRIG2))) { + cap_ppc_safe_cache =3D 1; + } + /* Parse and set cap_ppc_safe_bounds_check */ + if (~c.behaviour & c.b_mask & H_CPU_BEHAV_BNDS_CHK_SPEC_BAR) { + cap_ppc_safe_bounds_check =3D 2; + } else if (c.character & c.c_mask & H_CPU_CHAR_SPEC_BAR_ORI31) { + cap_ppc_safe_bounds_check =3D 1; + } + /* Parse and set cap_ppc_safe_indirect_branch */ + if (c.character & H_CPU_CHAR_BCCTRL_SERIALISED) { + cap_ppc_safe_indirect_branch =3D 2; + } +} + target_ulong kvmppc_configure_v3_mmu(PowerPCCPU *cpu, bool radix, bool gtse, uint64_t proc_tbl) @@ -2456,6 +2499,21 @@ bool kvmppc_has_cap_mmu_hash_v3(void) return cap_mmu_hash_v3; } =20 +int kvmppc_get_cap_safe_cache(void) +{ + return cap_ppc_safe_cache; +} + +int kvmppc_get_cap_safe_bounds_check(void) +{ + return cap_ppc_safe_bounds_check; +} + +int kvmppc_get_cap_safe_indirect_branch(void) +{ + return cap_ppc_safe_indirect_branch; +} + PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void) { uint32_t host_pvr =3D mfpvr(); diff --git a/target/ppc/kvm_ppc.h b/target/ppc/kvm_ppc.h index ecb55493cc..39830baa77 100644 --- a/target/ppc/kvm_ppc.h +++ b/target/ppc/kvm_ppc.h @@ -59,6 +59,9 @@ bool kvmppc_has_cap_fixup_hcalls(void); bool kvmppc_has_cap_htm(void); bool kvmppc_has_cap_mmu_radix(void); bool kvmppc_has_cap_mmu_hash_v3(void); +int kvmppc_get_cap_safe_cache(void); +int kvmppc_get_cap_safe_bounds_check(void); +int kvmppc_get_cap_safe_indirect_branch(void); int kvmppc_enable_hwrng(void); int kvmppc_put_books_sregs(PowerPCCPU *cpu); PowerPCCPUClass *kvm_ppc_get_host_cpu_class(void); @@ -290,6 +293,21 @@ static inline bool kvmppc_has_cap_mmu_hash_v3(void) return false; } =20 +static inline int kvmppc_get_cap_safe_cache(void) +{ + return 0; +} + +static inline int kvmppc_get_cap_safe_bounds_check(void) +{ + return 0; +} + +static inline int kvmppc_get_cap_safe_indirect_branch(void) +{ + return 0; +} + static inline int kvmppc_enable_hwrng(void) { return -1; --=20 2.13.6 From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515998164121907.8576472459594; Sun, 14 Jan 2018 22:36:04 -0800 (PST) Received: from localhost ([::1]:41113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayNE-0001AH-RZ for importer@patchew.org; Mon, 15 Jan 2018 01:36:00 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57320) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKQ-0007mQ-LP for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKP-0006q7-Qb for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:06 -0500 Received: from mail-pg0-x243.google.com ([2607:f8b0:400e:c05::243]:43535) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKN-0006nV-FP; Mon, 15 Jan 2018 01:33:03 -0500 Received: by mail-pg0-x243.google.com with SMTP id f14so7499462pga.10; Sun, 14 Jan 2018 22:33:03 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.32.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:33:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iGUbhPCAMWHjnmrrQbsjO3fODSRLLO/U9kz2waRD9sM=; b=IvQY7/tSTuvcxSVYK7wNYKqkuyjreOfE32rDjJhs4IiTRfE+JOjNhbzVF84w/2STz5 GeNITRoUyyV4TOTAxIoZxGuJ29WetqgyqOwF7I7Hdp9taXOdPg15vcwcP18XOtqqL+3X ZSLtDEb4FhQaerZLBPIfNa5PklxcTeNgt+gGGhBuXSABFywJaOKstftKnFLzGB/MBphH ESwhc+/TtKffO2tXPK4YMWQGPVzXOoVFoeQ7aQiIDsziub4DfLsm1bYTdH8O+1FFSPYe U/wSITHLKlAiQIoSlOAOlqiNoR+oH5y7tJvBfs1EYxAR758webBOds5S6sqO+aBBNaOl 3WeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iGUbhPCAMWHjnmrrQbsjO3fODSRLLO/U9kz2waRD9sM=; b=PYWAcze61R3OeKlGiMdpun18aAErD9pXS+2oVkIVUovEpYIBxrrVbisdQaUOuGCYjY RQt7ViGMPvQtS5OH3Ip+sqmyW3M6Sxpmfn6zD0/qwEpk+riikwmQkgKZjH0gomdYNT0R F59n1ayS53ZY+Bbac5rQdwUpE44uepsRoO8phfYMD0OSdHHzsplvppB3zEJU6ed04AU2 bQLBwIYrleRmfAAqurtOFFoGwq6INwkxMEUzqATc/e6BSSi2BNk2vdfL1A34MTqLV8KO DFtgaG33W3ejTyVREeW/+hdi0ZvHZvatjvVF3UvJh4Nw8/uKnuOynXtxUyV0coVazMT9 xXnQ== X-Gm-Message-State: AKGB3mLZ4+0k/Lq6XLNTKV34C2q21kxR4thVDy9e99zPK4RlY5ak8DH/ WShZ1qtVha4y9K/Gw7cjYhkKoVuT X-Google-Smtp-Source: ACJfBosjpWZSSqxZccWOQcVEENchT4lfeDVLGopSaHcT0utvxp+FTuHzXhbd4i3DoGNBsZt7ByTvyA== X-Received: by 10.101.93.79 with SMTP id e15mr18649742pgt.129.1515997982399; Sun, 14 Jan 2018 22:33:02 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:31 +1100 Message-Id: <20180115063235.7518-3-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::243 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 2/6] target/ppc/spapr_caps: Add support for tristate spapr_capabilities X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" spapr_caps are used to represent the level of support for various capabilities related to the spapr machine type. Currently there is only support for boolean capabilities. Add support for tristate capabilities by implementing their get/set functions. These capabilities can have the values 0, 1 or 2 corresponding to broken, workaround and fixed. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr_caps.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ include/hw/ppc/spapr.h | 4 ++++ 2 files changed, 64 insertions(+) diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index d5c9ce774a..436250d77b 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -73,6 +73,66 @@ static void spapr_cap_set_bool(Object *obj, Visitor *v, = const char *name, spapr->eff.caps[cap->index] =3D value ? SPAPR_CAP_ON : SPAPR_CAP_OFF; } =20 +static void spapr_cap_get_tristate(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + sPAPRCapabilityInfo *cap =3D opaque; + sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); + char *val =3D NULL; + uint8_t value =3D spapr_get_cap(spapr, cap->index); + + switch (value) { + case SPAPR_CAP_BROKEN: + val =3D g_strdup("broken"); + break; + case SPAPR_CAP_WORKAROUND: + val =3D g_strdup("workaround"); + break; + case SPAPR_CAP_FIXED: + val =3D g_strdup("fixed"); + break; + default: + error_setg(errp, "Invalid value (%d) for cap-%s", value, cap->name= ); + return; + } + + visit_type_str(v, name, &val, errp); + g_free(val); +} + +static void spapr_cap_set_tristate(Object *obj, Visitor *v, const char *na= me, + void *opaque, Error **errp) +{ + sPAPRCapabilityInfo *cap =3D opaque; + sPAPRMachineState *spapr =3D SPAPR_MACHINE(obj); + char *val; + Error *local_err =3D NULL; + uint8_t value; + + visit_type_str(v, name, &val, &local_err); + if (local_err) { + error_propagate(errp, local_err); + return; + } + + if (!strcasecmp(val, "broken")) { + value =3D SPAPR_CAP_BROKEN; + } else if (!strcasecmp(val, "workaround")) { + value =3D SPAPR_CAP_WORKAROUND; + } else if (!strcasecmp(val, "fixed")) { + value =3D SPAPR_CAP_FIXED; + } else { + error_setg(errp, "Invalid capability mode \"%s\" for cap-%s", val, + cap->name); + goto out; + } + + spapr->cmd_line_caps[cap->index] =3D true; + spapr->eff.caps[cap->index] =3D value; +out: + g_free(val); +} + static void cap_htm_apply(sPAPRMachineState *spapr, uint8_t val, Error **e= rrp) { if (!val) { diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index eded0ea57d..61bb3632c4 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -69,6 +69,10 @@ typedef enum { /* Bool Caps */ #define SPAPR_CAP_OFF 0x00 #define SPAPR_CAP_ON 0x01 +/* Broken | Workaround | Fixed Caps */ +#define SPAPR_CAP_BROKEN 0x00 +#define SPAPR_CAP_WORKAROUND 0x01 +#define SPAPR_CAP_FIXED 0x02 =20 typedef struct sPAPRCapabilities sPAPRCapabilities; struct sPAPRCapabilities { --=20 2.13.6 From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515998318025945.9799060940778; Sun, 14 Jan 2018 22:38:38 -0800 (PST) Received: from localhost ([::1]:41158 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayPl-0003Yq-6w for importer@patchew.org; Mon, 15 Jan 2018 01:38:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57369) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKW-0007qf-Rr for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKV-0006tT-MZ for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:12 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:42182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKQ-0006q2-82; Mon, 15 Jan 2018 01:33:06 -0500 Received: by mail-pf0-x242.google.com with SMTP id b25so1309085pfd.9; Sun, 14 Jan 2018 22:33:06 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.33.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:33:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Yt40lKC2CHvBNaVNEhOGrdl6r1TgH8tseJVUlTs/AFo=; b=kTxgwatRxOseT0enBTDoJ4/eBzyEGWMGM+hbonKlv0oTMSoDDvjn1PVn60M4wAWsZ6 b9pGfdWjTMJ6CqUlNiKU9bTj4sB/vLo8L4/fs8/GAD2DFHkT5NH/iXMdxai2MfEd/BTb g5yJzEeL+X7CrH4qWuevVZPHY1ledVzhE85dyfYuOo90AxpYvV+UNgXh5zfJBCY9vvUl a3mOYt1JjU9sBmtGEkT7Cl1Q9241Hej0ahhRjtZyjAAWdLr9tqshC2DgfIxFtyU0up4R EQ5F+Oqo/zXemAxzfszZoqJj1KzKYHmUKdB0Xqqx2nDWYO4HGnMW+Xqbe5/yeZlc0rrs VgVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Yt40lKC2CHvBNaVNEhOGrdl6r1TgH8tseJVUlTs/AFo=; b=ZbC29tiCHYh9iwwt8sM/RZLhvnN3uMERmuBuqZB1gMjTjzfnAKkRldMB4cY7A2UtzF fXqSaF06sX9EVMGgx5wcsnTD0E1zFtXv4ONvmRTIhKoc41YCRKU6tdqktXONDSXWJQ3R J2V3C2uzyLsl5CFQ6LCfSJYXwgZ80AUTdRSH9ta4BxPvjtXXyUkUYM9mGFPMG1zChRIM q4DgnjtwQ+TbRQ2im4AZOydLrQVNsgG8tLyrmgjHYwYTUpUwwyrjqUTLCc77F/S2sF/v u9gdRICcLWnQ5j4QAb6CfISw+IzvK9i2IBikKRLxC+mchWtVnE2+b6ES5GvlVIxrwSGA fxdQ== X-Gm-Message-State: AKwxytdzRP8AyEmHZI2tOV0MiWnS3hzlrwhwuzo8NNE3XDQrnbJOxIvy h46f2MDOqqRC6zRT8CmcqM1JDJBq X-Google-Smtp-Source: ACJfBovLq68PYj1xPqNW2/6S5cR6xvDMN0gVvAO1vntnHKwIJWl0E3AlJJlxd7tOsaJmlhgxBm2FWA== X-Received: by 10.99.123.91 with SMTP id k27mr15247865pgn.179.1515997985118; Sun, 14 Jan 2018 22:33:05 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:32 +1100 Message-Id: <20180115063235.7518-4-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 3/6] target/ppc/spapr_caps: Add new tristate cap safe_cache X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add new tristate cap cap-cfpc to represent the cache flush on privilege change capability. Signed-off-by: Suraj Jitindar Singh Reviewed-by: David Gibson --- hw/ppc/spapr.c | 2 ++ hw/ppc/spapr_caps.c | 40 ++++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 5 ++++- 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 3e528fe91e..5d62dc9968 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1791,6 +1791,7 @@ static const VMStateDescription vmstate_spapr =3D { &vmstate_spapr_cap_htm, &vmstate_spapr_cap_vsx, &vmstate_spapr_cap_dfp, + &vmstate_spapr_cap_cfpc, NULL } }; @@ -3863,6 +3864,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) smc->default_caps.caps[SPAPR_CAP_HTM] =3D SPAPR_CAP_OFF; smc->default_caps.caps[SPAPR_CAP_VSX] =3D SPAPR_CAP_ON; smc->default_caps.caps[SPAPR_CAP_DFP] =3D SPAPR_CAP_ON; + smc->default_caps.caps[SPAPR_CAP_CFPC] =3D SPAPR_CAP_BROKEN; spapr_caps_add_properties(smc, &error_abort); } =20 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 436250d77b..bc2b2c3590 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -180,6 +180,18 @@ static void cap_dfp_apply(sPAPRMachineState *spapr, ui= nt8_t val, Error **errp) } } =20 +static void cap_safe_cache_apply(sPAPRMachineState *spapr, uint8_t val, + Error **errp) +{ + if (tcg_enabled() && val) { + /* TODO - for now only allow broken for TCG */ + error_setg(errp, "Requested safe cache capability level not suppor= ted by tcg, try a different value for cap-cfpc"); + } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_cache())) { + error_setg(errp, "Requested safe cache capability level not suppor= ted by kvm, try a different value for cap-cfpc"); + } +} + +#define VALUE_DESC_TRISTATE " (broken, workaround, fixed)" =20 sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D { [SPAPR_CAP_HTM] =3D { @@ -209,6 +221,15 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = =3D { .type =3D "bool", .apply =3D cap_dfp_apply, }, + [SPAPR_CAP_CFPC] =3D { + .name =3D "cfpc", + .description =3D "Cache Flush on Privilege Change" VALUE_DESC_TRIS= TATE, + .index =3D SPAPR_CAP_CFPC, + .get =3D spapr_cap_get_tristate, + .set =3D spapr_cap_set_tristate, + .type =3D "string", + .apply =3D cap_safe_cache_apply, + }, }; =20 static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, @@ -345,6 +366,25 @@ const VMStateDescription vmstate_spapr_cap_dfp =3D { }, }; =20 +static bool spapr_cap_cfpc_needed(void *opaque) +{ + sPAPRMachineState *spapr =3D opaque; + + return spapr->cmd_line_caps[SPAPR_CAP_CFPC] && + (spapr->eff.caps[SPAPR_CAP_CFPC] !=3D spapr->def.caps[SPAPR_CAP= _CFPC]); +} + +const VMStateDescription vmstate_spapr_cap_cfpc =3D { + .name =3D "spapr/cap/cfpc", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D spapr_cap_cfpc_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(mig.caps[SPAPR_CAP_CFPC], sPAPRMachineState), + VMSTATE_END_OF_LIST() + }, +}; + void spapr_caps_reset(sPAPRMachineState *spapr) { sPAPRCapabilities default_caps; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 61bb3632c4..ff476693d1 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -60,8 +60,10 @@ typedef enum { #define SPAPR_CAP_VSX 0x01 /* Decimal Floating Point */ #define SPAPR_CAP_DFP 0x02 +/* Cache Flush on Privilege Change */ +#define SPAPR_CAP_CFPC 0x03 /* Num Caps */ -#define SPAPR_CAP_NUM (SPAPR_CAP_DFP + 1) +#define SPAPR_CAP_NUM (SPAPR_CAP_CFPC + 1) =20 /* * Capability Values @@ -779,6 +781,7 @@ int spapr_caps_pre_save(void *opaque); extern const VMStateDescription vmstate_spapr_cap_htm; extern const VMStateDescription vmstate_spapr_cap_vsx; extern const VMStateDescription vmstate_spapr_cap_dfp; +extern const VMStateDescription vmstate_spapr_cap_cfpc; =20 static inline uint8_t spapr_get_cap(sPAPRMachineState *spapr, int cap) { --=20 2.13.6 From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515998129673731.9777528398365; Sun, 14 Jan 2018 22:35:29 -0800 (PST) Received: from localhost ([::1]:41101 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayMi-0000jp-QZ for importer@patchew.org; Mon, 15 Jan 2018 01:35:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57373) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKX-0007r0-2M for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:14 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKW-0006tq-4N for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:13 -0500 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:41676) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKS-0006rm-UE; Mon, 15 Jan 2018 01:33:09 -0500 Received: by mail-pf0-x242.google.com with SMTP id j3so7595371pfh.8; Sun, 14 Jan 2018 22:33:08 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.33.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:33:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=RLkMFWIb6s0irXUs+zSkbL0IEW/z1i8OpEAnlVEd9WA=; b=pDUV1O+qNrLnnk6Mv7onJygMtwfxMl2fv6RxpfBNS684uEV8uU0Yjtq3490iMV1vCV mr3C4LTGCZXruagoqfzn2qPWLPJDJr0p6IlnD6ooLd3fVNtEWOxkqohjtVZiOXwOggqm PPCAxu+EYLI+Fxw2Z0wyPl8V/YCl0zfl/RTHp615rJjPctYjGtw4xkgff2p6OOAbO1vH 1MKZbsTz7sazBugbnJXZRQhRaYrLSl9snEThoHjYL8+zKa0C4ZPtZTrSbY6gBVXB9z5o z6L9Awg09nfPKI7JqqenY0re6kEifYEoNytYQKVMMhsTBndgkmvH9UT4ZWWzfppsas4i Bcpg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=RLkMFWIb6s0irXUs+zSkbL0IEW/z1i8OpEAnlVEd9WA=; b=P9Aq0mgjavqlTuwN9so9nn0uVucx/DAE/bZAumhS4pCNk24homy/4z/pQ2MBdB7lzQ n3MwEya+ppycpE8SL9K5s7iQwzQnsXhQcw/r+3ekD+KugqmolbWwKDFmWC7yrDORlQOk b4FHlXL4Y2s8djvEWatdrBK0yXx959tEeb1qPhBZk6JWVUVIe5Pmj6BxFLpff8OpYCPj mRbInjaIELubcRM0hTLggukafc+RKPfbxXm2Xy4qK1nnkUA+PFkTHBku6zzitx+ndtpB 4S/e/2YjcY6SOmCXRYqMbjxNcdZQKJFDBPBaXwUo5NnnFnjCQ4oIIf5VxIlQeFbR7+KD JWuA== X-Gm-Message-State: AKGB3mIdGKiVSIEfga19Rgg1GvZt+mfQaLbvjwcYBpvFPnty0RK+eE2D 1cmGFTowJ0NcHsAFVQqnUi/hOitu X-Google-Smtp-Source: ACJfBotruZo18JXcQIEa/icJcMHyrEp6Y7v6r3hSGSDLGrmbYmB2y7FpQ9nx5bmnaZhFeF1J8+/V0w== X-Received: by 10.99.42.83 with SMTP id q80mr26100077pgq.183.1515997987831; Sun, 14 Jan 2018 22:33:07 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:33 +1100 Message-Id: <20180115063235.7518-5-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::242 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 4/6] target/ppc/spapr_caps: Add new tristate cap safe_bounds_check X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add new tristate cap cap-sbbc to represent the speculation barrier bounds checking capability. Signed-off-by: Suraj Jitindar Singh Reviewed-by: David Gibson --- hw/ppc/spapr.c | 2 ++ hw/ppc/spapr_caps.c | 39 +++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 5 ++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 5d62dc9968..02a0cb656b 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1792,6 +1792,7 @@ static const VMStateDescription vmstate_spapr =3D { &vmstate_spapr_cap_vsx, &vmstate_spapr_cap_dfp, &vmstate_spapr_cap_cfpc, + &vmstate_spapr_cap_sbbc, NULL } }; @@ -3865,6 +3866,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) smc->default_caps.caps[SPAPR_CAP_VSX] =3D SPAPR_CAP_ON; smc->default_caps.caps[SPAPR_CAP_DFP] =3D SPAPR_CAP_ON; smc->default_caps.caps[SPAPR_CAP_CFPC] =3D SPAPR_CAP_BROKEN; + smc->default_caps.caps[SPAPR_CAP_SBBC] =3D SPAPR_CAP_BROKEN; spapr_caps_add_properties(smc, &error_abort); } =20 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index bc2b2c3590..518e019cf7 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -191,6 +191,17 @@ static void cap_safe_cache_apply(sPAPRMachineState *sp= apr, uint8_t val, } } =20 +static void cap_safe_bounds_check_apply(sPAPRMachineState *spapr, uint8_t = val, + Error **errp) +{ + if (tcg_enabled() && val) { + /* TODO - for now only allow broken for TCG */ + error_setg(errp, "Requested safe bounds check capability level not= supported by tcg, try a different value for cap-sbbc"); + } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_bounds_check())= ) { + error_setg(errp, "Requested safe bounds check capability level not= supported by kvm, try a different value for cap-sbbc"); + } +} + #define VALUE_DESC_TRISTATE " (broken, workaround, fixed)" =20 sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D { @@ -230,6 +241,15 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = =3D { .type =3D "string", .apply =3D cap_safe_cache_apply, }, + [SPAPR_CAP_SBBC] =3D { + .name =3D "sbbc", + .description =3D "Speculation Barrier Bounds Checking" VALUE_DESC_= TRISTATE, + .index =3D SPAPR_CAP_SBBC, + .get =3D spapr_cap_get_tristate, + .set =3D spapr_cap_set_tristate, + .type =3D "string", + .apply =3D cap_safe_bounds_check_apply, + }, }; =20 static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, @@ -385,6 +405,25 @@ const VMStateDescription vmstate_spapr_cap_cfpc =3D { }, }; =20 +static bool spapr_cap_sbbc_needed(void *opaque) +{ + sPAPRMachineState *spapr =3D opaque; + + return spapr->cmd_line_caps[SPAPR_CAP_SBBC] && + (spapr->eff.caps[SPAPR_CAP_SBBC] !=3D spapr->def.caps[SPAPR_CAP= _SBBC]); +} + +const VMStateDescription vmstate_spapr_cap_sbbc =3D { + .name =3D "spapr/cap/sbbc", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D spapr_cap_sbbc_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(mig.caps[SPAPR_CAP_SBBC], sPAPRMachineState), + VMSTATE_END_OF_LIST() + }, +}; + void spapr_caps_reset(sPAPRMachineState *spapr) { sPAPRCapabilities default_caps; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index ff476693d1..c65be62e92 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -62,8 +62,10 @@ typedef enum { #define SPAPR_CAP_DFP 0x02 /* Cache Flush on Privilege Change */ #define SPAPR_CAP_CFPC 0x03 +/* Speculation Barrier Bounds Checking */ +#define SPAPR_CAP_SBBC 0x04 /* Num Caps */ -#define SPAPR_CAP_NUM (SPAPR_CAP_CFPC + 1) +#define SPAPR_CAP_NUM (SPAPR_CAP_SBBC + 1) =20 /* * Capability Values @@ -782,6 +784,7 @@ extern const VMStateDescription vmstate_spapr_cap_htm; extern const VMStateDescription vmstate_spapr_cap_vsx; extern const VMStateDescription vmstate_spapr_cap_dfp; extern const VMStateDescription vmstate_spapr_cap_cfpc; +extern const VMStateDescription vmstate_spapr_cap_sbbc; =20 static inline uint8_t spapr_get_cap(sPAPRMachineState *spapr, int cap) { --=20 2.13.6 From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1515998415943784.0509115958491; Sun, 14 Jan 2018 22:40:15 -0800 (PST) Received: from localhost ([::1]:41338 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayRF-00055j-QI for importer@patchew.org; Mon, 15 Jan 2018 01:40:09 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKZ-0007tP-9k for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKY-0006vV-9g for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:15 -0500 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:41677) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKV-0006tC-IU; Mon, 15 Jan 2018 01:33:11 -0500 Received: by mail-pf0-x243.google.com with SMTP id j3so7595403pfh.8; Sun, 14 Jan 2018 22:33:11 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.33.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:33:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NFGhpTW/z2P/NR9I2tUoR6Sj2CkQXtkOBAkEdAHtjx4=; b=FuSj6weyjrUQHh2XlFXfl2x0l6URsYHDzlYE33I6eCEAwl1no4dgiheZf3JztMUppt YiFyXzisCGXZEZjuq9qd1DEIHMUYW6BvgSQLhwDd2Utos7FvzKzbf+eRcLNiuGC9pEED UGlAd1VOgEZHOGNmfiq5dfOeSK8+wZ7QPH/TyUOX/BCe+anU4oKXjNtMuAMW8eIUN4SU e4k8jSYrNd5mgY23onu40Z8jfIWutp2bz/QABu822UyIAff+VFq/lxFVANAwg8t6excA iH67M2AY1RRRBehrT/inlfvcu4GqbvBElSkPuLC6rrFU8QYrwhKzpPzgXKJ/CI8Oy8HO Io9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NFGhpTW/z2P/NR9I2tUoR6Sj2CkQXtkOBAkEdAHtjx4=; b=DcBwYF0b6k2XxY4oumPRLBk56mZUbeDHaQRVCy2bvG/KD3mvXYLIatQ5glEz1xdiZy B2LlR/nj1Hp6H1cEnGyENjQs/dBxBpYJ2WY8q4QP8e6YKSR7TXv5kFO4kbSAvtRU3ybx 7RgFynIraY4F00/8RSTjieC9inkb+3ydReFrMyp52cS9k6rwwETTwaizGhaUs4h/JTMK 2h/9zGP84FzMBHwdmn/c0JuOUYS2XTj3NMMB2vMBrFrIt4vOGpAl+79tfGr3SKHAbZN0 J5MUZzjZU2hepBkgFO9tuX58B+KLOXnBVbDYBt1qTHHaWevCXYGBwmVYTUrwiAzIa7qv CyBA== X-Gm-Message-State: AKwxytfRLOZj+aGFoGAjqSZuv7+6Yx+bKd5OvWYItFGfSbxjBs1SEyeD 31oEagIzo2s+9zwlzEaUn5sexVM/ X-Google-Smtp-Source: ACJfBotucF+WhwI12bB4gYHBHIdmLQkcaIFucooek+44Y9LUqYgDULb5X37NOA98D8PKVTJw3QLx4A== X-Received: by 10.101.90.71 with SMTP id z7mr17146154pgs.15.1515997990509; Sun, 14 Jan 2018 22:33:10 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:34 +1100 Message-Id: <20180115063235.7518-6-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::243 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 5/6] target/ppc/spapr_caps: Add new tristate cap safe_indirect_branch X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Add new tristate cap cap-ibs to represent the indirect branch serialisation capability. Signed-off-by: Suraj Jitindar Singh Reviewed-by: David Gibson --- hw/ppc/spapr.c | 2 ++ hw/ppc/spapr_caps.c | 39 +++++++++++++++++++++++++++++++++++++++ include/hw/ppc/spapr.h | 5 ++++- 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index 02a0cb656b..269c1c7857 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1793,6 +1793,7 @@ static const VMStateDescription vmstate_spapr =3D { &vmstate_spapr_cap_dfp, &vmstate_spapr_cap_cfpc, &vmstate_spapr_cap_sbbc, + &vmstate_spapr_cap_ibs, NULL } }; @@ -3867,6 +3868,7 @@ static void spapr_machine_class_init(ObjectClass *oc,= void *data) smc->default_caps.caps[SPAPR_CAP_DFP] =3D SPAPR_CAP_ON; smc->default_caps.caps[SPAPR_CAP_CFPC] =3D SPAPR_CAP_BROKEN; smc->default_caps.caps[SPAPR_CAP_SBBC] =3D SPAPR_CAP_BROKEN; + smc->default_caps.caps[SPAPR_CAP_IBS] =3D SPAPR_CAP_BROKEN; spapr_caps_add_properties(smc, &error_abort); } =20 diff --git a/hw/ppc/spapr_caps.c b/hw/ppc/spapr_caps.c index 518e019cf7..0b36333a85 100644 --- a/hw/ppc/spapr_caps.c +++ b/hw/ppc/spapr_caps.c @@ -202,6 +202,17 @@ static void cap_safe_bounds_check_apply(sPAPRMachineSt= ate *spapr, uint8_t val, } } =20 +static void cap_safe_indirect_branch_apply(sPAPRMachineState *spapr, + uint8_t val, Error **errp) +{ + if (tcg_enabled() && val) { + /* TODO - for now only allow broken for TCG */ + error_setg(errp, "Requested safe indirect branch capability level = not supported by tcg, try a different value for cap-ibs"); + } else if (kvm_enabled() && (val > kvmppc_get_cap_safe_indirect_branch= ())) { + error_setg(errp, "Requested safe indirect branch capability level = not supported by kvm, try a different value for cap-ibs"); + } +} + #define VALUE_DESC_TRISTATE " (broken, workaround, fixed)" =20 sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] =3D { @@ -250,6 +261,15 @@ sPAPRCapabilityInfo capability_table[SPAPR_CAP_NUM] = =3D { .type =3D "string", .apply =3D cap_safe_bounds_check_apply, }, + [SPAPR_CAP_IBS] =3D { + .name =3D "ibs", + .description =3D "Indirect Branch Serialisation" VALUE_DESC_TRISTA= TE, + .index =3D SPAPR_CAP_IBS, + .get =3D spapr_cap_get_tristate, + .set =3D spapr_cap_set_tristate, + .type =3D "string", + .apply =3D cap_safe_indirect_branch_apply, + }, }; =20 static sPAPRCapabilities default_caps_with_cpu(sPAPRMachineState *spapr, @@ -424,6 +444,25 @@ const VMStateDescription vmstate_spapr_cap_sbbc =3D { }, }; =20 +static bool spapr_cap_ibs_needed(void *opaque) +{ + sPAPRMachineState *spapr =3D opaque; + + return spapr->cmd_line_caps[SPAPR_CAP_IBS] && + (spapr->eff.caps[SPAPR_CAP_IBS] !=3D spapr->def.caps[SPAPR_CAP_= IBS]); +} + +const VMStateDescription vmstate_spapr_cap_ibs =3D { + .name =3D "spapr/cap/ibs", + .version_id =3D 1, + .minimum_version_id =3D 1, + .needed =3D spapr_cap_ibs_needed, + .fields =3D (VMStateField[]) { + VMSTATE_UINT8(mig.caps[SPAPR_CAP_IBS], sPAPRMachineState), + VMSTATE_END_OF_LIST() + }, +}; + void spapr_caps_reset(sPAPRMachineState *spapr) { sPAPRCapabilities default_caps; diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index c65be62e92..549d7a4134 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -64,8 +64,10 @@ typedef enum { #define SPAPR_CAP_CFPC 0x03 /* Speculation Barrier Bounds Checking */ #define SPAPR_CAP_SBBC 0x04 +/* Indirect Branch Serialisation */ +#define SPAPR_CAP_IBS 0x05 /* Num Caps */ -#define SPAPR_CAP_NUM (SPAPR_CAP_SBBC + 1) +#define SPAPR_CAP_NUM (SPAPR_CAP_IBS + 1) =20 /* * Capability Values @@ -785,6 +787,7 @@ extern const VMStateDescription vmstate_spapr_cap_vsx; extern const VMStateDescription vmstate_spapr_cap_dfp; extern const VMStateDescription vmstate_spapr_cap_cfpc; extern const VMStateDescription vmstate_spapr_cap_sbbc; +extern const VMStateDescription vmstate_spapr_cap_ibs; =20 static inline uint8_t spapr_get_cap(sPAPRMachineState *spapr, int cap) { --=20 2.13.6 From nobody Sat May 4 03:20:24 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 151599829682222.78205006306689; Sun, 14 Jan 2018 22:38:16 -0800 (PST) Received: from localhost ([::1]:41153 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayPM-000368-0c for importer@patchew.org; Mon, 15 Jan 2018 01:38:12 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eayKd-0007xn-N7 for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:20 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eayKa-0006yC-Km for qemu-devel@nongnu.org; Mon, 15 Jan 2018 01:33:19 -0500 Received: from mail-pf0-x241.google.com ([2607:f8b0:400e:c00::241]:43215) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eayKY-0006v7-Bw; Mon, 15 Jan 2018 01:33:14 -0500 Received: by mail-pf0-x241.google.com with SMTP id y26so24528pfi.10; Sun, 14 Jan 2018 22:33:14 -0800 (PST) Received: from surajjs1.ozlabs.ibm.com ([122.99.82.10]) by smtp.gmail.com with ESMTPSA id 13sm62362864pfs.112.2018.01.14.22.33.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Jan 2018 22:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DkAYN0O+PPYb3iuig7/J9eeqPTU7VTFQTWb71D7+GI4=; b=WQhfCVGBsO/ic57so6i1po/K9vJycLfTyRJmxC9ghSBxLqLNBt6zAbHbNe1DTtJnHD T3cW5BTucmOPQ8gNAPmU9e+XIANwUt66yf5z43UnUed02qlLsVvNPTN39BNU0bq0oKlf uIjrQP+crCR9lB5brKKLLMwNsZV1ynWK5AxBOCHvu/zY1beqynaEm8GUcEolzxUIMbu+ oAvmgVLMESMMo2CFIES0f0jOjLONYmwNxUeKg87eu0EQytdovY4blsvUNj7SnXOZix8K 129jEPSssyvL/Wia+u0rXLxm7VTgO0WeO2cEgwoh07CMIkocybDFtVF1wkMVT327FGUM Bptw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DkAYN0O+PPYb3iuig7/J9eeqPTU7VTFQTWb71D7+GI4=; b=tCeG769WCWJkhYmQD+EZo+5kw7c5lYbtImECNjLcxLtt/TcYzRBIB9z86ZzuDidj3Z WdiXbVXfcWqPnF5jecQS5W11CtqTc849tql5Ef2FVQvoNdraZ8Kt9V8L3IhxNYzDNFTd Kd1kSP2vTyYFFijN0+qlmizcDigWXPF53mnhSV35t3mZtjdp4bOrcUglzCMvufj6WvNG zaAYzVxEtVDd6RbHHXcwoXVokOvG2bZFZ2DiwwChgcJSYrtOmv4JvhkNhZU3MyO+ous3 7mLE4ENQnR2hWCUFv9vy2mJYgJV50fjsMZE7zLcB7vNSXT0zE0MkiN6SZSOVEDQwbX2G bH/Q== X-Gm-Message-State: AKGB3mLpNdqXaBccNKK7vp5Dyz5H/ItGKhIp8vzVutEwcZ0CAbQWc4yd VenxVQZJh06OV8wksXds/dai12Ic X-Google-Smtp-Source: ACJfBovdC8OVqIBKAN+lJKGkejQ8H8SKql8cT4oLNzLUYNwP+KOxGTnwORq4c3rWRcAZtLyg/GyK8g== X-Received: by 10.98.214.129 with SMTP id a1mr24822103pfl.221.1515997993278; Sun, 14 Jan 2018 22:33:13 -0800 (PST) From: Suraj Jitindar Singh To: qemu-ppc@nongnu.org Date: Mon, 15 Jan 2018 17:32:35 +1100 Message-Id: <20180115063235.7518-7-sjitindarsingh@gmail.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20180115063235.7518-1-sjitindarsingh@gmail.com> References: <20180115063235.7518-1-sjitindarsingh@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c00::241 Subject: [Qemu-devel] [QEMU-PPC] [PATCH V3 6/6] target/ppc/spapr: Add H-Call H_GET_CPU_CHARACTERISTICS X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: paulus@ozlabs.org, qemu-devel@nongnu.org, sjitindarsingh@gmail.com, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The new H-Call H_GET_CPU_CHARACTERISTICS is used by the guest to query behaviours and available characteristics of the cpu. Implement the handler for this new H-Call which formulates its response based on the setting of the spapr_caps cap-cfpc, cap-sbbc and cap-ibs. Signed-off-by: Suraj Jitindar Singh --- hw/ppc/spapr_hcall.c | 66 ++++++++++++++++++++++++++++++++++++++++++++++= ++++ include/hw/ppc/spapr.h | 1 + 2 files changed, 67 insertions(+) diff --git a/hw/ppc/spapr_hcall.c b/hw/ppc/spapr_hcall.c index 51eba52e86..a693d3b852 100644 --- a/hw/ppc/spapr_hcall.c +++ b/hw/ppc/spapr_hcall.c @@ -1654,6 +1654,69 @@ static target_ulong h_client_architecture_support(Po= werPCCPU *cpu, return H_SUCCESS; } =20 +static target_ulong h_get_cpu_characteristics(PowerPCCPU *cpu, + sPAPRMachineState *spapr, + target_ulong opcode, + target_ulong *args) +{ + uint64_t characteristics =3D H_CPU_CHAR_HON_BRANCH_HINTS & + ~H_CPU_CHAR_THR_RECONF_TRIG; + uint64_t behaviour =3D H_CPU_BEHAV_FAVOUR_SECURITY; + uint8_t safe_cache =3D spapr_get_cap(spapr, SPAPR_CAP_CFPC); + uint8_t safe_bounds_check =3D spapr_get_cap(spapr, SPAPR_CAP_SBBC); + uint8_t safe_indirect_branch =3D spapr_get_cap(spapr, SPAPR_CAP_IBS); + + switch (safe_cache) { + case SPAPR_CAP_WORKAROUND: + characteristics |=3D H_CPU_CHAR_L1D_FLUSH_ORI30; + characteristics |=3D H_CPU_CHAR_L1D_FLUSH_TRIG2; + characteristics |=3D H_CPU_CHAR_L1D_THREAD_PRIV; + behaviour |=3D H_CPU_BEHAV_L1D_FLUSH_PR; + break; + case SPAPR_CAP_FIXED: + break; + default: /* broken */ + if (safe_cache !=3D SPAPR_CAP_BROKEN) { + error_report("Invalid value for cap-cfpc (%d), assuming broken= ", + safe_cache); + } + behaviour |=3D H_CPU_BEHAV_L1D_FLUSH_PR; + break; + } + + switch (safe_bounds_check) { + case SPAPR_CAP_WORKAROUND: + characteristics |=3D H_CPU_CHAR_SPEC_BAR_ORI31; + behaviour |=3D H_CPU_BEHAV_BNDS_CHK_SPEC_BAR; + break; + case SPAPR_CAP_FIXED: + break; + default: /* broken */ + if (safe_bounds_check !=3D SPAPR_CAP_BROKEN) { + error_report("Invalid value for cap-sbbc (%d), assuming broken= ", + safe_bounds_check); + } + behaviour |=3D H_CPU_BEHAV_BNDS_CHK_SPEC_BAR; + break; + } + + switch (safe_indirect_branch) { + case SPAPR_CAP_FIXED: + characteristics |=3D H_CPU_CHAR_BCCTRL_SERIALISED; + default: /* broken */ + if (safe_indirect_branch !=3D SPAPR_CAP_BROKEN) { + error_report("Invalid value for cap-ibs (%d), assuming broken", + safe_indirect_branch); + } + break; + } + + args[0] =3D characteristics; + args[1] =3D behaviour; + + return H_SUCCESS; +} + static spapr_hcall_fn papr_hypercall_table[(MAX_HCALL_OPCODE / 4) + 1]; static spapr_hcall_fn kvmppc_hypercall_table[KVMPPC_HCALL_MAX - KVMPPC_HCA= LL_BASE + 1]; =20 @@ -1733,6 +1796,9 @@ static void hypercall_register_types(void) spapr_register_hypercall(H_INVALIDATE_PID, h_invalidate_pid); spapr_register_hypercall(H_REGISTER_PROC_TBL, h_register_process_table= ); =20 + /* hcall-get-cpu-characteristics */ + spapr_register_hypercall(H_GET_CPU_CHARACTERISTICS, h_get_cpu_characte= ristics); + /* "debugger" hcalls (also used by SLOF). Note: We do -not- differenci= ate * here between the "CI" and the "CACHE" variants, they will use whate= ver * mapping attributes qemu is using. When using KVM, the kernel will diff --git a/include/hw/ppc/spapr.h b/include/hw/ppc/spapr.h index 549d7a4134..62c077ac20 100644 --- a/include/hw/ppc/spapr.h +++ b/include/hw/ppc/spapr.h @@ -404,6 +404,7 @@ struct sPAPRMachineState { #define H_GET_HCA_INFO 0x1B8 #define H_GET_PERF_COUNT 0x1BC #define H_MANAGE_TRACE 0x1C0 +#define H_GET_CPU_CHARACTERISTICS 0x1C8 #define H_FREE_LOGICAL_LAN_BUFFER 0x1D4 #define H_QUERY_INT_STATE 0x1E4 #define H_POLL_PENDING 0x1D8 --=20 2.13.6