WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] Re: [PATCH 2/2] ioemu: make management of PCI D-states by gu

To: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH 2/2] ioemu: make management of PCI D-states by guest optional
From: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Date: Wed, 11 Mar 2009 17:16:05 +0900
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx, Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
Delivery-date: Wed, 11 Mar 2009 01:17:17 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <7kd4cvfche.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <7kfxhrfcmv.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx> <7kd4cvfche.fsf@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 6 Mar 2009 14:26:37 +0900
Kouya Shimura <kouya@xxxxxxxxxxxxxx> wrote:

> +/* read Power Management Control/Status register */
> +static int pt_pmcsr_reg_read(struct pt_dev *ptdev,
> +        struct pt_reg_tbl *cfg_entry,
> +        uint16_t *value, uint16_t valid_mask)
> +{
> +    struct pt_reg_info_tbl *reg = cfg_entry->reg;
> +    uint16_t valid_emu_mask = reg->emu_mask;
> +
> +    if (!ptdev->power_mgmt)
> +        valid_emu_mask |= PCI_PM_CTRL_STATE_MASK;

(snip)

> @@ -3082,6 +3113,24 @@ static int pt_pmcsr_reg_write(struct pt_dev *ptdev,
>      struct pt_pm_info *pm_state = ptdev->pm_state;
>      uint16_t read_val = 0;
>  
> +    if (!ptdev->power_mgmt) {
> +        uint16_t emu_mask = 
> +            PCI_PM_CTRL_PME_STATUS | PCI_PM_CTRL_DATA_SCALE_MASK |
> +            PCI_PM_CTRL_PME_ENABLE |
> +            PCI_PM_CTRL_DATA_SEL_MASK | PCI_PM_CTRL_STATE_MASK;
> +        uint16_t ro_mask = PCI_PM_CTRL_DATA_SCALE_MASK;

Hi,

Why are Data_Scale field and Data_Select field emulated?
I think we can pass-through them as follows.

On the other hand, No_Soft_Reset field needs to be emulated and fixed
to 1. The reason is PowerState field is emulated, that means guest
software can change power state, but actual power state of device is
not changed. So internal reset never occurs.

As a result, the code will be as the following.

read:
      valid_emu_mask |= PCI_PM_CTRL_STATE_MASK |
             PCI_PM_CTRL_NO_SOFT_RESET;

write:
      uint16_t emu_mask = reg->emu_mask | PCI_PM_CTRL_STATE_MASK |
             PCI_PM_CTRL_NO_SOFT_RESET;
      uint16_t ro_mask = reg->ro_mask;

Thanks,
--
Yuji Shimada


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel