From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39695) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YJ0Fp-0004T6-Pm for qemu-devel@nongnu.org; Wed, 04 Feb 2015 08:44:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YJ0Fo-0001eH-Pc for qemu-devel@nongnu.org; Wed, 04 Feb 2015 08:44:29 -0500 Date: Thu, 5 Feb 2015 00:44:41 +1100 From: David Gibson Message-ID: <20150204134441.GC25675@voom.fritz.box> References: <1420417588-32562-1-git-send-email-gwshan@linux.vnet.ibm.com> <1420417588-32562-3-git-send-email-gwshan@linux.vnet.ibm.com> <20150114014159.GR3654@voom.BigPond> <54D221A8.8030901@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1ccMZA6j1vT5UqiK" Content-Disposition: inline In-Reply-To: <54D221A8.8030901@suse.de> Subject: Re: [Qemu-devel] [PATCH v15 2/2] sPAPR: Implement sPAPRPHBClass::eeh_handler List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Alexander Graf Cc: aik@ozlabs.ru, alex.williamson@redhat.com, qemu-ppc@nongnu.org, Gavin Shan , qemu-devel@nongnu.org --1ccMZA6j1vT5UqiK Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 04, 2015 at 02:42:00PM +0100, Alexander Graf wrote: >=20 >=20 > 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 > >> --- > >> 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(sPAPRPHBS= tate *sphb, Error **errp) > >> spapr_tce_get_iommu(tcet)); > >> } > >> =20 > >> +static int spapr_phb_vfio_eeh_handler(sPAPRPHBState *sphb, int req, i= nt opt) > >> +{ > >> + sPAPRPHBVFIOState *svphb =3D SPAPR_PCI_VFIO_HOST_BRIDGE(sphb); > >> + struct vfio_eeh_pe_op op =3D { .argsz =3D sizeof(op) }; > >=20 > > 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(). >=20 > As far as I understand C, in the construct above all unmentioned fields > actually do get initialized to 0. Sorry, my mistake. --=20 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 --1ccMZA6j1vT5UqiK Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJU0iJJAAoJEGw4ysog2bOSNywQAI08/h6q2EE8ri89oWdHI6Rn 0h9ibDmt6crkwIh4rt+v+m4OzK8DlxrIXjITNm3+/jtOZ9JE+Nlqi0P4RbNx6C+Q 8UyVOqTeQclZ1ryg+4loF+IZWw/ioQuiE/a2k53vCMQ6/gRqbLah3dluL2Vvu8WU jEB2Ggses/4uzBwKHbYmzDa00GHhdPm5Z+9nGtHTdzirOSs0XkbkMCn/hKOWNhnJ sFaIaEC/4USvNIggDXxQyU9D+mvwPYIX21SFu5ZsSUkFkzfw0ir/ZkO+DnZRMUW5 c4q8iJwCrE6ZGsqpvOxjP3nPdtFrTbSRQ0n8uVlWtk37QYtkmJxLrR3R19loKDbk zOReSn87VMKBytcAyj3K7poOffZ8JuqLcDPTSRwiK73UFulDYzpMrvL5OUR3VVQy YGwrRavleJQoFKHaGSM4yVh0jqEGW8StB/DY8VduflfqcTK0eRXtSyPA9AGE8NN5 ZzCkxvMAYL6il7G65fpn0wLS6AkRcKbbV/apL1ZRU0YyWexH82dTDP8knSH+aiva aq0ubct6t664hwHyKKnmr/KFrk/PAO09jDQPww3YnkJtilNXXjZHiY3afT00ZPgl OKrtyN9tXpksSSEhx/N+F3aHBY57GmbD1H00qfPGTsgw9zE/WodKBXNxRdpU/YWG a8lTEOU41fWHujoB+d9M =K1Rh -----END PGP SIGNATURE----- --1ccMZA6j1vT5UqiK--