[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 1/9] pseries: Factor out check for out-of-bounds LIOBN
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 1/9] pseries: Factor out check for out-of-bounds LIOBN |
Date: |
Mon, 6 May 2013 17:25:09 +0200 |
From: David Gibson <address@hidden>
PAPR defines LIOBNs (Logical IO Bus Numbers) to be 32-bit, and we check for
values that aren't in the code for H_PUT_TCE. This patch factors the check
into spapr_tce_find_by_liobn(), which already checks if a 32-bit LIOBN
actually exists. This will become more important as future patches add
other hypercalls which need to look up a LIOBN.
At the same time we fix the typo in the message.
Signed-off-by: David Gibson <address@hidden>
Signed-off-by: Alexey Kardashevskiy <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
hw/ppc/spapr_iommu.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/hw/ppc/spapr_iommu.c b/hw/ppc/spapr_iommu.c
index d2782cf..c6aa4fe 100644
--- a/hw/ppc/spapr_iommu.c
+++ b/hw/ppc/spapr_iommu.c
@@ -55,6 +55,12 @@ static sPAPRTCETable *spapr_tce_find_by_liobn(uint32_t liobn)
{
sPAPRTCETable *tcet;
+ if (liobn & 0xFFFFFFFF00000000ULL) {
+ hcall_dprintf("Request for out-of-bounds LIOBN 0x" TARGET_FMT_lx "\n",
+ liobn);
+ return NULL;
+ }
+
QLIST_FOREACH(tcet, &spapr_tce_tables, list) {
if (tcet->liobn == liobn) {
return tcet;
@@ -218,12 +224,6 @@ static target_ulong h_put_tce(PowerPCCPU *cpu,
sPAPREnvironment *spapr,
target_ulong tce = args[2];
sPAPRTCETable *tcet = spapr_tce_find_by_liobn(liobn);
- if (liobn & 0xFFFFFFFF00000000ULL) {
- hcall_dprintf("spapr_vio_put_tce on out-of-boundsw LIOBN "
- TARGET_FMT_lx "\n", liobn);
- return H_PARAMETER;
- }
-
ioba &= ~(SPAPR_TCE_PAGE_SIZE - 1);
if (tcet) {
--
1.6.0.2
- [Qemu-ppc] [PULL 1.5 0/9] ppc patch queue 2013-05-06, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 8/9] PPC: e500: correct params->ram_size with ram_size, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 7/9] target-ppc: Add read and write of PPR SPR, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 3/9] PPC: e500: initialize GPRs as per epapr, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 1/9] pseries: Factor out check for out-of-bounds LIOBN,
Alexander Graf <=
- [Qemu-ppc] [PATCH 9/9] spapr_llan: fix device reenabling, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 5/9] PPC: Add MMU type for 2.06 with AMR but no TB pages, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 2/9] pseries: Fix debug message for out-of-bounds address in H_PUT_TCE, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 6/9] target-ppc: Fix invalid SPR read/write warnings, Alexander Graf, 2013/05/06
- [Qemu-ppc] [PATCH 4/9] pseries: Update SLOF firmware image, Alexander Graf, 2013/05/06
- Re: [Qemu-ppc] [PULL 1.5 0/9] ppc patch queue 2013-05-06, Aurelien Jarno, 2013/05/06