tools: Drop xc_cpuid_check() and bindings

There are no current users which I can locate.  One piece of xend which didn't
move forwards into xl/libxl is this:

  #   Configure host CPUID consistency checks, which must be satisfied for this
  #   VM to be allowed to run on this host's processor type:
  #cpuid_check=[ '1:ecx=xxxxxxxxxxxxxxxxxxxxxxxxxx1xxxxx' ]
  # - Host must have VMX feature flag set

The implementation of xc_cpuid_check() is conceptually broken.  Dom0's view of
CPUID is not the approprite view to check, and will be wrong in the presence
of CPUID masking/faulting, and for HVM-based toolstack domains.

If it turns out that the functionality is required, it should be implemented
in terms of XEN_SYSCTL_get_cpuid_policy to use the proper CPUID view.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
This commit is contained in:
Andrew Cooper authored and Wei Liu committed 2017-07-20 17:35:52 +01:00
1 parent 32e5bd5dcf
commit 73771b89fd
6 files changed
-143

No files matched your search

-34
View File
@@ -711,29 +711,6 @@ static PyObject *pyxc_create_cpuid_dict(char **regs)
return dict;
}
static PyObject *pyxc_dom_check_cpuid(XcObject *self,
PyObject *args)
{
PyObject *sub_input, *config;
unsigned int input[2];
char *regs[4], *regs_transform[4];
if ( !PyArg_ParseTuple(args, "iOO", &input[0], &sub_input, &config) )
return NULL;
pyxc_dom_extract_cpuid(config, regs);
input[1] = XEN_CPUID_INPUT_UNUSED;
if ( PyLong_Check(sub_input) )
input[1] = PyLong_AsUnsignedLong(sub_input);
if ( xc_cpuid_check(self->xc_handle, input,
(const char **)regs, regs_transform) )
return pyxc_error_to_exception(self->xc_handle);
return pyxc_create_cpuid_dict(regs_transform);
}
static PyObject *pyxc_dom_set_policy_cpuid(XcObject *self,
PyObject *args)
{
@@ -2467,17 +2444,6 @@ static PyMethodDef pyxc_methods[] = {
" keys [str]: String of keys to inject.\n" },
#if defined(__i386__) || defined(__x86_64__)
{ "domain_check_cpuid",
(PyCFunction)pyxc_dom_check_cpuid,
METH_VARARGS, "\n"
"Apply checks to host CPUID.\n"
" input [long]: Input for cpuid instruction (eax)\n"
" sub_input [long]: Second input (optional, may be None) for cpuid "
" instruction (ecx)\n"
" config [dict]: Dictionary of register\n"
" config [dict]: Dictionary of register, use for checking\n\n"
"Returns: [int] 0 on success; exception on error.\n" },
{ "domain_set_cpuid",
(PyCFunction)pyxc_dom_set_cpuid,
METH_VARARGS, "\n"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.