From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from [222.73.24.84] (helo=song.cn.fujitsu.com) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1Sjo4g-0006R1-0y for kexec@lists.infradead.org; Wed, 27 Jun 2012 08:58:10 +0000 Message-ID: <4FEACA5E.4090009@cn.fujitsu.com> Date: Wed, 27 Jun 2012 16:54:54 +0800 From: Yanfei Zhang MIME-Version: 1.0 Subject: [PATCH v3 4/5] Sysfs: Export VMCSINFO via sysfs References: <4FEAC945.50700@cn.fujitsu.com> In-Reply-To: <4FEAC945.50700@cn.fujitsu.com> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: kexec-bounces@lists.infradead.org Errors-To: kexec-bounces+dwmw2=infradead.org@lists.infradead.org To: Avi Kivity , mtosatti@redhat.com Cc: dzickus@redhat.com, luto@mit.edu, kvm@vger.kernel.org, Joerg Roedel , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, paul.gortmaker@windriver.com, ludwig.nussel@suse.de, ebiederm@xmission.com, Greg KH This patch export offsets of fields via /sys/devices/cpu/vmcs/. Individual offsets are contained in subfiles named by the filed's encoding, e.g.: /sys/devices/cpu/vmcs/0800 Signed-off-by: zhangyanfei --- drivers/base/core.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 346be8b..dd05ee7 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "base.h" #include "power/power.h" @@ -1038,6 +1039,11 @@ int device_add(struct device *dev) error = dpm_sysfs_add(dev); if (error) goto DPMError; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + error = vmcs_sysfs_add(dev); + if (error) + goto VMCSError; +#endif device_pm_add(dev); /* Notify clients of device addition. This call must come @@ -1069,6 +1075,10 @@ int device_add(struct device *dev) done: put_device(dev); return error; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + VMCSError: + dpm_sysfs_remove(dev); +#endif DPMError: bus_remove_device(dev); BusError: @@ -1171,6 +1181,9 @@ void device_del(struct device *dev) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); device_pm_remove(dev); +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + vmcs_sysfs_remove(dev); +#endif dpm_sysfs_remove(dev); if (parent) klist_del(&dev->p->knode_parent); -- 1.7.1 _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yanfei Zhang Subject: [PATCH v3 4/5] Sysfs: Export VMCSINFO via sysfs Date: Wed, 27 Jun 2012 16:54:54 +0800 Message-ID: <4FEACA5E.4090009@cn.fujitsu.com> References: <4FEAC945.50700@cn.fujitsu.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: dzickus-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org, luto-3s7WtUTddSA@public.gmane.org, kvm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Joerg Roedel , kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, paul.gortmaker-CWA4WttNNZF54TAoqtyWWQ@public.gmane.org, ludwig.nussel-l3A5Bk7waGM@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, Greg KH To: Avi Kivity , mtosatti-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Return-path: In-Reply-To: <4FEAC945.50700-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kexec-bounces-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org List-Id: kvm.vger.kernel.org This patch export offsets of fields via /sys/devices/cpu/vmcs/. Individual offsets are contained in subfiles named by the filed's encoding, e.g.: /sys/devices/cpu/vmcs/0800 Signed-off-by: zhangyanfei --- drivers/base/core.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 346be8b..dd05ee7 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "base.h" #include "power/power.h" @@ -1038,6 +1039,11 @@ int device_add(struct device *dev) error = dpm_sysfs_add(dev); if (error) goto DPMError; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + error = vmcs_sysfs_add(dev); + if (error) + goto VMCSError; +#endif device_pm_add(dev); /* Notify clients of device addition. This call must come @@ -1069,6 +1075,10 @@ int device_add(struct device *dev) done: put_device(dev); return error; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + VMCSError: + dpm_sysfs_remove(dev); +#endif DPMError: bus_remove_device(dev); BusError: @@ -1171,6 +1181,9 @@ void device_del(struct device *dev) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); device_pm_remove(dev); +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + vmcs_sysfs_remove(dev); +#endif dpm_sysfs_remove(dev); if (parent) klist_del(&dev->p->knode_parent); -- 1.7.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754411Ab2F0I6M (ORCPT ); Wed, 27 Jun 2012 04:58:12 -0400 Received: from cn.fujitsu.com ([222.73.24.84]:22329 "EHLO song.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-OK) by vger.kernel.org with ESMTP id S1752201Ab2F0I6L (ORCPT ); Wed, 27 Jun 2012 04:58:11 -0400 X-IronPort-AV: E=Sophos;i="4.77,483,1336320000"; d="scan'208";a="5273749" Message-ID: <4FEACA5E.4090009@cn.fujitsu.com> Date: Wed, 27 Jun 2012 16:54:54 +0800 From: Yanfei Zhang User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.9) Gecko/20100413 Fedora/3.0.4-2.fc13 Thunderbird/3.0.4 MIME-Version: 1.0 To: Avi Kivity , mtosatti@redhat.com CC: ebiederm@xmission.com, luto@mit.edu, Joerg Roedel , dzickus@redhat.com, paul.gortmaker@windriver.com, ludwig.nussel@suse.de, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, kexec@lists.infradead.org, Greg KH Subject: [PATCH v3 4/5] Sysfs: Export VMCSINFO via sysfs References: <4FEAC945.50700@cn.fujitsu.com> In-Reply-To: <4FEAC945.50700@cn.fujitsu.com> X-MIMETrack: Itemize by SMTP Server on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/06/27 16:58:19, Serialize by Router on mailserver/fnst(Release 8.5.3|September 15, 2011) at 2012/06/27 16:58:22, Serialize complete at 2012/06/27 16:58:22 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=GB2312 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch export offsets of fields via /sys/devices/cpu/vmcs/. Individual offsets are contained in subfiles named by the filed's encoding, e.g.: /sys/devices/cpu/vmcs/0800 Signed-off-by: zhangyanfei --- drivers/base/core.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index 346be8b..dd05ee7 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "base.h" #include "power/power.h" @@ -1038,6 +1039,11 @@ int device_add(struct device *dev) error = dpm_sysfs_add(dev); if (error) goto DPMError; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + error = vmcs_sysfs_add(dev); + if (error) + goto VMCSError; +#endif device_pm_add(dev); /* Notify clients of device addition. This call must come @@ -1069,6 +1075,10 @@ int device_add(struct device *dev) done: put_device(dev); return error; +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + VMCSError: + dpm_sysfs_remove(dev); +#endif DPMError: bus_remove_device(dev); BusError: @@ -1171,6 +1181,9 @@ void device_del(struct device *dev) blocking_notifier_call_chain(&dev->bus->p->bus_notifier, BUS_NOTIFY_DEL_DEVICE, dev); device_pm_remove(dev); +#if defined(CONFIG_KVM_INTEL) || defined(CONFIG_KVM_INTEL_MODULE) + vmcs_sysfs_remove(dev); +#endif dpm_sysfs_remove(dev); if (parent) klist_del(&dev->p->knode_parent); -- 1.7.1