[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 18/25] s390x/pci: enable uid-checking
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 18/25] s390x/pci: enable uid-checking |
Date: |
Mon, 11 Jul 2016 10:09:05 +0200 |
From: Yi Min Zhao <address@hidden>
The uid-checking facility guarantees uniqueness of the uid within the
vm and exposes the real uid to the guest when listing pci devices.
Let's always enable it and present it to the guest in the response to
the list pci clp command.
Signed-off-by: Yi Min Zhao <address@hidden>
Reviewed-by: Pierre Morel <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
hw/s390x/s390-pci-bus.h | 1 +
hw/s390x/s390-pci-inst.c | 7 +++----
hw/s390x/s390-pci-inst.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h
index 658bda5..2d9150c 100644
--- a/hw/s390x/s390-pci-bus.h
+++ b/hw/s390x/s390-pci-bus.h
@@ -33,6 +33,7 @@
#define ZPCI_MAX_FID 0xffffffff
#define ZPCI_MAX_UID 0xffff
#define UID_UNDEFINED 0
+#define UID_CHECKING_ENABLED 0x01
#define S390_PCI_HOST_BRIDGE(obj) \
OBJECT_CHECK(S390pciState, (obj), TYPE_S390_PCI_HOST_BRIDGE)
diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
index 744f435..c84d0eb 100644
--- a/hw/s390x/s390-pci-inst.c
+++ b/hw/s390x/s390-pci-inst.c
@@ -56,8 +56,7 @@ static int list_pci(ClpReqRspListPci *rrb, uint8_t *cc)
}
if ((ldl_p(&rrb->request.fmt) & ~CLP_MASK_FMT) != 0 ||
- ldq_p(&rrb->request.reserved1) != 0 ||
- ldq_p(&rrb->request.reserved2) != 0) {
+ ldq_p(&rrb->request.reserved1) != 0) {
res_code = CLP_RC_RESNOT0;
rc = -EINVAL;
goto out;
@@ -91,9 +90,9 @@ static int list_pci(ClpReqRspListPci *rrb, uint8_t *cc)
stl_p(&rrb->response.fmt, 0);
stq_p(&rrb->response.reserved1, 0);
- stq_p(&rrb->response.reserved2, 0);
stl_p(&rrb->response.mdd, FH_MASK_SHM);
stw_p(&rrb->response.max_fn, PCI_MAX_FUNCTIONS);
+ rrb->response.flags = UID_CHECKING_ENABLED;
rrb->response.entry_size = sizeof(ClpFhListEntry);
finish = 0;
idx = resume_token;
@@ -260,7 +259,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2)
stl_p(&resquery->fid, pbdev->fid);
stw_p(&resquery->pchid, 0);
stw_p(&resquery->ug, 1);
- stl_p(&resquery->uid, pbdev->fid);
+ stl_p(&resquery->uid, pbdev->uid);
stw_p(&resquery->hdr.rsp, CLP_RC_OK);
break;
}
diff --git a/hw/s390x/s390-pci-inst.h b/hw/s390x/s390-pci-inst.h
index c35f337..e1c2ee1 100644
--- a/hw/s390x/s390-pci-inst.h
+++ b/hw/s390x/s390-pci-inst.h
@@ -104,7 +104,7 @@ typedef struct ClpRspListPci {
uint64_t resume_token;
uint32_t mdd;
uint16_t max_fn;
- uint8_t reserved2;
+ uint8_t flags;
uint8_t entry_size;
ClpFhListEntry fh_list[CLP_FH_LIST_NR_ENTRIES];
} QEMU_PACKED ClpRspListPci;
--
2.9.0
- [Qemu-devel] [PULL 14/25] s390x/pci: enforce zPCI state checking, (continued)
- [Qemu-devel] [PULL 14/25] s390x/pci: enforce zPCI state checking, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 08/25] s390x/css: Unplug handler of virtual css bridge, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 12/25] s390x/pci: unify FH_ macros, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 19/25] s390x/pci: enable zpci hot-plug/hot-unplug, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 17/25] s390x/pci: introduce S390PCIBusDevice qdev, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 03/25] s390x/ipl: Support IPL from selected SCSI device, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 02/25] pc-bios/s390-ccw.img: rebuild image, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 15/25] s390x/pci: introduce S390PCIBus, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 23/25] s390x/pci: fix stpcifc_service_call, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 20/25] s390x/pci: add checkings in CLP_SET_PCI_FN, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 18/25] s390x/pci: enable uid-checking,
Cornelia Huck <=
- [Qemu-devel] [PULL 11/25] s390x/pci: write fid in CLP_QUERY_PCI_FN, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 16/25] s390x/pci: introduce S390PCIIOMMU, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 21/25] s390x/pci: refactor s390_pci_find_dev_by_idx, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 10/25] s390x/pci: acceleration for getting S390pciState, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 24/25] s390x/pci: replace fid with idx in msg data of msix, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 07/25] s390x/css: Factor out virtual css bridge and bus, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 22/25] s390x/pci: refactor list_pci, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 25/25] s390x/pci: make hot-unplug handler smoother, Cornelia Huck, 2016/07/11
- [Qemu-devel] [PULL 13/25] s390x/pci: refactor s390_pci_find_dev_by_fh, Cornelia Huck, 2016/07/11
- Re: [Qemu-devel] [PULL 00/25] s390x patches for 2.7, Peter Maydell, 2016/07/12