qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-ppc] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handl


From: David Gibson
Subject: Re: [Qemu-ppc] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler
Date: Thu, 5 Feb 2015 00:44:41 +1100
User-agent: Mutt/1.5.23 (2014-03-12)

On Wed, Feb 04, 2015 at 02:42:00PM +0100, Alexander Graf wrote:
> 
> 
> On 14.01.15 02:41, David Gibson wrote:
> > On Mon, Jan 05, 2015 at 11:26:28AM +1100, Gavin Shan wrote:
> >> The patch implements sPAPRPHBClass::eeh_handler so that the
> >> EEH RTAS requests can be routed to VFIO for further handling.
> >>
> >> Signed-off-by: Gavin Shan <address@hidden>
> >> ---
> >>  hw/ppc/spapr_pci_vfio.c | 56 
> >> +++++++++++++++++++++++++++++++++++++++++++++++++
> >>  hw/vfio/common.c        |  1 +
> >>  2 files changed, 57 insertions(+)
> >>
> >> diff --git a/hw/ppc/spapr_pci_vfio.c b/hw/ppc/spapr_pci_vfio.c
> >> index 144912b..73652a9 100644
> >> --- a/hw/ppc/spapr_pci_vfio.c
> >> +++ b/hw/ppc/spapr_pci_vfio.c
> >> @@ -71,6 +71,61 @@ static void spapr_phb_vfio_finish_realize(sPAPRPHBState 
> >> *sphb, Error **errp)
> >>                                  spapr_tce_get_iommu(tcet));
> >>  }
> >>  
> >> +static int spapr_phb_vfio_eeh_handler(sPAPRPHBState *sphb, int req, int 
> >> opt)
> >> +{
> >> +    sPAPRPHBVFIOState *svphb = SPAPR_PCI_VFIO_HOST_BRIDGE(sphb);
> >> +    struct vfio_eeh_pe_op op = { .argsz = sizeof(op) };
> > 
> > This is a local variable, which means it won't be initialized.  You
> > never memset() it and it's not obvious that all fields get
> > initialized, which makes it dangerous to pass to an ioctl().
> 
> As far as I understand C, in the construct above all unmentioned fields
> actually do get initialized to 0.

Sorry, my mistake.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson

Attachment: pgp8ObZSLKURI.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]