Files
qemu/backends/confidential-guest-support.c
Isaku Yamahata a9e2064e49 confidential guest support, KVM/TDX: Disable pv clock for guest TD
KVM TDX guest doesn't allow KVM clock.  Although guest TD doesn't use a KVM
clock, qemu creates it by default with i386 KVM enabled.  When guest TD
crashes and KVM_RUN returns -EIO, the following message is shown.
  KVM_GET_CLOCK failed: Input/output error
The message confuses the user and misleads the debug process.  Don't create
KVM_CLOCK when confidential computing is enabled, and it has a property to
disable the pv clock.

Signed-off-by: Isaku Yamahata <isaku.yamahata@intel.com>
Signed-off-by: Binbin Wu <binbin.wu@linux.intel.com>
2023-11-28 17:14:57 +02:00

50 lines
1.3 KiB
C

/*
* QEMU Confidential Guest support
*
* Copyright Red Hat.
*
* Authors:
* David Gibson <david@gibson.dropbear.id.au>
*
* This work is licensed under the terms of the GNU GPL, version 2 or
* later. See the COPYING file in the top-level directory.
*
*/
#include "qemu/osdep.h"
#include "exec/confidential-guest-support.h"
OBJECT_DEFINE_ABSTRACT_TYPE(ConfidentialGuestSupport,
confidential_guest_support,
CONFIDENTIAL_GUEST_SUPPORT,
OBJECT)
static bool cgs_get_disable_pv_clock(Object *obj, Error **errp)
{
ConfidentialGuestSupport *cgs = CONFIDENTIAL_GUEST_SUPPORT(obj);
return cgs->disable_pv_clock;
}
static void cgs_set_disable_pv_clock(Object *obj, bool value, Error **errp)
{
ConfidentialGuestSupport *cgs = CONFIDENTIAL_GUEST_SUPPORT(obj);
cgs->disable_pv_clock = value;
}
static void confidential_guest_support_class_init(ObjectClass *oc, void *data)
{
object_class_property_add_bool(oc, CONFIDENTIAL_GUEST_SUPPORT_DISABLE_PV_CLOCK,
cgs_get_disable_pv_clock, cgs_set_disable_pv_clock);
}
static void confidential_guest_support_init(Object *obj)
{
}
static void confidential_guest_support_finalize(Object *obj)
{
}