@@ -140,7 +140,7 @@ config HAS_ITS
depends on GICV3 && !NEW_VGIC && !ARM_32
config OVERLAY_DTB
- bool "DTB overlay support (UNSUPPORTED)" if UNSUPPORTED
+ bool "DTB overlay support (UNSUPPORTED)" if UNSUPPORTED && SYSCTL
help
Dynamic addition/removal of Xen device tree nodes using a dtbo.
@@ -54,7 +54,7 @@ obj-y += smpboot.o
obj-$(CONFIG_STATIC_EVTCHN) += static-evtchn.init.o
obj-$(CONFIG_STATIC_MEMORY) += static-memory.init.o
obj-$(CONFIG_STATIC_SHM) += static-shmem.init.o
-obj-y += sysctl.o
+obj-$(CONFIG_SYSCTL) += sysctl.o
obj-y += time.o
obj-y += traps.o
obj-y += vcpreg.o
@@ -15,7 +15,6 @@
#include <asm/arm64/sve.h>
#include <public/sysctl.h>
-#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
pi->capabilities |= XEN_SYSCTL_PHYSCAP_hvm | XEN_SYSCTL_PHYSCAP_hap;
@@ -23,7 +22,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
pi->arch_capabilities |= MASK_INSR(sve_encode_vl(get_sys_vl_len()),
XEN_SYSCTL_PHYSCAP_ARM_SVE_MASK);
}
-#endif
long arch_do_sysctl(struct xen_sysctl *sysctl,
XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
@@ -322,13 +322,13 @@ unsigned long raw_copy_from_guest(void *to, const void __user *from,
/* sysctl.c */
+#ifdef CONFIG_SYSCTL
long arch_do_sysctl(struct xen_sysctl *sysctl,
XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
{
BUG_ON("unimplemented");
}
-#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
BUG_ON("unimplemented");
@@ -79,7 +79,7 @@ ifneq ($(CONFIG_PV_SHIM_EXCLUSIVE),y)
obj-y += domctl.o
obj-y += platform_hypercall.o
obj-$(CONFIG_COMPAT) += x86_64/platform_hypercall.o
-obj-y += sysctl.o
+obj-$(CONFIG_SYSCTL) += sysctl.o
endif
extra-y += asm-macros.i
@@ -75,8 +75,10 @@ static inline bool psr_cmt_enabled(void)
int psr_alloc_rmid(struct domain *d);
void psr_free_rmid(struct domain *d);
+#ifdef CONFIG_SYSCTL
int psr_get_info(unsigned int socket, enum psr_type type,
uint32_t data[], unsigned int array_len);
+#endif
int psr_get_val(struct domain *d, unsigned int socket,
uint32_t *val, enum psr_type type);
int psr_set_val(struct domain *d, unsigned int socket,
@@ -133,9 +133,11 @@ static const struct feat_props {
*/
enum psr_type alt_type;
+#ifdef CONFIG_SYSCTL
/* get_feat_info is used to return feature HW info through sysctl. */
bool (*get_feat_info)(const struct feat_node *feat,
uint32_t data[], unsigned int array_len);
+#endif
/* write_msr is used to write out feature MSR register. */
void (*write_msr)(unsigned int cos, uint32_t val, enum psr_type type);
@@ -418,6 +420,7 @@ static bool mba_init_feature(const struct cpuid_leaf *regs,
return true;
}
+#ifdef CONFIG_SYSCTL
static bool cf_check cat_get_feat_info(
const struct feat_node *feat, uint32_t data[], unsigned int array_len)
{
@@ -430,6 +433,7 @@ static bool cf_check cat_get_feat_info(
return true;
}
+#endif
/* L3 CAT props */
static void cf_check l3_cat_write_msr(
@@ -442,11 +446,14 @@ static const struct feat_props l3_cat_props = {
.cos_num = 1,
.type[0] = PSR_TYPE_L3_CBM,
.alt_type = PSR_TYPE_UNKNOWN,
+#ifdef CONFIG_SYSCTL
.get_feat_info = cat_get_feat_info,
+#endif
.write_msr = l3_cat_write_msr,
.sanitize = cat_check_cbm,
};
+#ifdef CONFIG_SYSCTL
/* L3 CDP props */
static bool cf_check l3_cdp_get_feat_info(
const struct feat_node *feat, uint32_t data[], uint32_t array_len)
@@ -458,6 +465,7 @@ static bool cf_check l3_cdp_get_feat_info(
return true;
}
+#endif
static void cf_check l3_cdp_write_msr(
unsigned int cos, uint32_t val, enum psr_type type)
@@ -473,7 +481,9 @@ static const struct feat_props l3_cdp_props = {
.type[0] = PSR_TYPE_L3_DATA,
.type[1] = PSR_TYPE_L3_CODE,
.alt_type = PSR_TYPE_L3_CBM,
+#ifdef CONFIG_SYSCTL
.get_feat_info = l3_cdp_get_feat_info,
+#endif
.write_msr = l3_cdp_write_msr,
.sanitize = cat_check_cbm,
};
@@ -489,11 +499,14 @@ static const struct feat_props l2_cat_props = {
.cos_num = 1,
.type[0] = PSR_TYPE_L2_CBM,
.alt_type = PSR_TYPE_UNKNOWN,
+#ifdef CONFIG_SYSCTL
.get_feat_info = cat_get_feat_info,
+#endif
.write_msr = l2_cat_write_msr,
.sanitize = cat_check_cbm,
};
+#ifdef CONFIG_SYSCTL
/* MBA props */
static bool cf_check mba_get_feat_info(
const struct feat_node *feat, uint32_t data[], unsigned int array_len)
@@ -508,6 +521,7 @@ static bool cf_check mba_get_feat_info(
return true;
}
+#endif
static void cf_check mba_write_msr(
unsigned int cos, uint32_t val, enum psr_type type)
@@ -545,7 +559,9 @@ static const struct feat_props mba_props = {
.cos_num = 1,
.type[0] = PSR_TYPE_MBA_THRTL,
.alt_type = PSR_TYPE_UNKNOWN,
+#ifdef CONFIG_SYSCTL
.get_feat_info = mba_get_feat_info,
+#endif
.write_msr = mba_write_msr,
.sanitize = mba_sanitize_thrtl,
};
@@ -808,6 +824,7 @@ static struct psr_socket_info *get_socket_info(unsigned int socket)
return socket_info + socket;
}
+#ifdef CONFIG_SYSCTL
int psr_get_info(unsigned int socket, enum psr_type type,
uint32_t data[], unsigned int array_len)
{
@@ -839,6 +856,7 @@ int psr_get_info(unsigned int socket, enum psr_type type,
return -EINVAL;
}
+#endif /* CONFIG_SYSCTL */
int psr_get_val(struct domain *d, unsigned int socket,
uint32_t *val, enum psr_type type)
@@ -91,7 +91,6 @@ static long cf_check smt_up_down_helper(void *data)
return ret;
}
-#ifdef CONFIG_SYSCTL
void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
{
memcpy(pi->hw_cap, boot_cpu_data.x86_capability,
@@ -105,7 +104,6 @@ void arch_do_physinfo(struct xen_sysctl_physinfo *pi)
if ( IS_ENABLED(CONFIG_SHADOW_PAGING) )
pi->capabilities |= XEN_SYSCTL_PHYSCAP_shadow;
}
-#endif
long arch_do_sysctl(
struct xen_sysctl *sysctl, XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
@@ -29,10 +29,18 @@ arch_do_domctl(
struct xen_domctl *domctl, struct domain *d,
XEN_GUEST_HANDLE_PARAM(xen_domctl_t) u_domctl);
+#ifdef CONFIG_SYSCTL
extern long
arch_do_sysctl(
struct xen_sysctl *sysctl,
XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl);
+#else
+static inline long arch_do_sysctl(struct xen_sysctl *sysctl,
+ XEN_GUEST_HANDLE_PARAM(xen_sysctl_t) u_sysctl)
+{
+ return -EOPNOTSUPP;
+}
+#endif
extern long
pci_physdev_op(