Print this page
7127  remove -Wno-missing-braces from Makefile.uts

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/i86pc/io/immu_dvma.c
          +++ new/usr/src/uts/i86pc/io/immu_dvma.c
↓ open down ↓ 924 lines elided ↑ open up ↑
 925  925          return (DDI_WALK_CONTINUE);
 926  926  
 927  927  }
 928  928  
 929  929  static void
 930  930  map_unity_domain(domain_t *domain)
 931  931  {
 932  932          struct memlist *mp;
 933  933          uint64_t start;
 934  934          uint64_t npages;
 935      -        immu_dcookie_t dcookies[1] = {0};
      935 +        immu_dcookie_t dcookies[1] = {{(uintptr_t)NULL}};
 936  936          int dcount = 0;
 937  937  
 938  938          /*
 939  939           * UNITY arenas are a mirror of the physical memory
 940  940           * installed on the system.
 941  941           */
 942  942  
 943  943  #ifdef BUGGY_DRIVERS
 944  944          /*
 945  945           * Dont skip page0. Some broken HW/FW access it.
↓ open down ↓ 364 lines elided ↑ open up ↑
1310 1310   */
1311 1311  static domain_t *
1312 1312  domain_create(immu_t *immu, dev_info_t *ddip, dev_info_t *rdip,
1313 1313      immu_flags_t immu_flags)
1314 1314  {
1315 1315          int kmflags;
1316 1316          domain_t *domain;
1317 1317          char mod_hash_name[128];
1318 1318          immu_devi_t *immu_devi;
1319 1319          int did;
1320      -        immu_dcookie_t dcookies[1] = {0};
     1320 +        immu_dcookie_t dcookies[1] = {{(uintptr_t)NULL}};
1321 1321          int dcount = 0;
1322 1322  
1323 1323          immu_devi = immu_devi_get(rdip);
1324 1324  
1325 1325          /*
1326 1326           * First allocate a domainid.
1327 1327           * This routine will never fail, since if we run out
1328 1328           * of domains the unity domain will be allocated.
1329 1329           */
1330 1330          did = did_alloc(immu, rdip, ddip, immu_flags);
↓ open down ↓ 626 lines elided ↑ open up ↑
1957 1957                      "(%" PRIx64 "-%" PRIx64 ")",
1958 1958                      start, start + len);
1959 1959                  *(uint64_t *)arg = ~0ULL;
1960 1960          }
1961 1961  }
1962 1962  
1963 1963  void
1964 1964  immu_print_fault_info(uint_t sid, uint64_t dvma)
1965 1965  {
1966 1966          int nlevels;
1967      -        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {0};
     1967 +        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {{0}};
1968 1968          xlate_t *xlatep;
1969 1969          hw_pdte_t pte;
1970 1970          domain_t *domain;
1971 1971          immu_t *immu;
1972 1972          uint64_t dvma_arg;
1973 1973  
1974 1974          if (mod_hash_find(bdf_domain_hash,
1975 1975              (void *)(uintptr_t)sid, (void *)&domain) != 0) {
1976 1976                  ddi_err(DER_WARN, NULL,
1977 1977                      "no domain for faulting SID %08x", sid);
↓ open down ↓ 370 lines elided ↑ open up ↑
2348 2348   */
2349 2349  static boolean_t
2350 2350  dvma_map(domain_t *domain, uint64_t sdvma, uint64_t snvpages,
2351 2351      immu_dcookie_t *dcookies, int dcount, dev_info_t *rdip,
2352 2352      immu_flags_t immu_flags)
2353 2353  {
2354 2354          uint64_t dvma;
2355 2355          uint64_t n;
2356 2356          immu_t *immu = domain->dom_immu;
2357 2357          int nlevels = immu->immu_dvma_nlevels;
2358      -        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {0};
     2358 +        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {{0}};
2359 2359          boolean_t pde_set = B_FALSE;
2360 2360  
2361 2361          n = snvpages;
2362 2362          dvma = sdvma;
2363 2363  
2364 2364          while (n > 0) {
2365 2365                  xlate_setup(dvma, xlate, nlevels);
2366 2366  
2367 2367                  /* Lookup or allocate PGDIRs and PGTABLEs if necessary */
2368 2368                  if (PDE_set_all(immu, domain, xlate, nlevels, rdip, immu_flags)
↓ open down ↓ 19 lines elided ↑ open up ↑
2388 2388   * dvma: starting DVMA
2389 2389   * npages: Number of IMMU pages to be unmapped
2390 2390   * rdip: requesting device
2391 2391   */
2392 2392  static void
2393 2393  dvma_unmap(domain_t *domain, uint64_t sdvma, uint64_t snpages,
2394 2394      dev_info_t *rdip)
2395 2395  {
2396 2396          immu_t *immu = domain->dom_immu;
2397 2397          int nlevels = immu->immu_dvma_nlevels;
2398      -        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {0};
     2398 +        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {{0}};
2399 2399          uint64_t n;
2400 2400          uint64_t dvma;
2401 2401  
2402 2402          dvma = sdvma;
2403 2403          n = snpages;
2404 2404  
2405 2405          while (n > 0) {
2406 2406                  /* setup the xlate array */
2407 2407                  xlate_setup(dvma, xlate, nlevels);
2408 2408  
↓ open down ↓ 35 lines elided ↑ open up ↑
2444 2444              xsize, align, 0, 0, (void *)(uintptr_t)minaddr,
2445 2445              (void *)(uintptr_t)maxaddr, kmf);
2446 2446  
2447 2447          return (dvma);
2448 2448  }
2449 2449  
2450 2450  static void
2451 2451  dvma_prealloc(dev_info_t *rdip, immu_hdl_priv_t *ihp, ddi_dma_attr_t *dma_attr)
2452 2452  {
2453 2453          int nlevels;
2454      -        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {0}, *xlp;
     2454 +        xlate_t xlate[IMMU_PGTABLE_MAX_LEVELS + 1] = {{0}}, *xlp;
2455 2455          uint64_t dvma, n;
2456 2456          size_t xsize, align;
2457 2457          uint64_t minaddr, maxaddr, dmamax;
2458 2458          int on, npte, pindex;
2459 2459          hw_pdte_t *shwp;
2460 2460          immu_t *immu;
2461 2461          domain_t *domain;
2462 2462  
2463 2463          /* parameters */
2464 2464          domain = IMMU_DEVI(rdip)->imd_domain;
↓ open down ↓ 361 lines elided ↑ open up ↑
2826 2826   *       called when the installed memory on a
2827 2827   *       system increases, to expand domain DVMA
2828 2828   *       for domains with UNITY mapping
2829 2829   */
2830 2830  void
2831 2831  immu_dvma_physmem_update(uint64_t addr, uint64_t size)
2832 2832  {
2833 2833          uint64_t start;
2834 2834          uint64_t npages;
2835 2835          int dcount;
2836      -        immu_dcookie_t dcookies[1] = {0};
     2836 +        immu_dcookie_t dcookies[1] = {{(uintptr_t)NULL}};
2837 2837          domain_t *domain;
2838 2838  
2839 2839          /*
2840 2840           * Just walk the system-wide list of domains with
2841 2841           * UNITY mapping. Both the list of *all* domains
2842 2842           * and *UNITY* domains is protected by the same
2843 2843           * single lock
2844 2844           */
2845 2845          mutex_enter(&immu_domain_lock);
2846 2846          domain = list_head(&immu_unity_domain_list);
↓ open down ↓ 102 lines elided ↑ open up ↑
2949 2949                  ddi_err(DER_MODE, rdip, "DVMA map: context update failed");
2950 2950                  return (DDI_DMA_NORESOURCES);
2951 2951          }
2952 2952  
2953 2953          return (DDI_SUCCESS);
2954 2954  }
2955 2955  
2956 2956  int
2957 2957  immu_map_memrange(dev_info_t *rdip, memrng_t *mrng)
2958 2958  {
2959      -        immu_dcookie_t dcookies[1] = {0};
     2959 +        immu_dcookie_t dcookies[1] = {{(uintptr_t)NULL}};
2960 2960          boolean_t pde_set;
2961 2961          immu_t *immu;
2962 2962          domain_t *domain;
2963 2963          immu_inv_wait_t iw;
2964 2964  
2965 2965          dcookies[0].dck_paddr = mrng->mrng_start;
2966 2966          dcookies[0].dck_npages = mrng->mrng_npages;
2967 2967  
2968 2968          domain = IMMU_DEVI(rdip)->imd_domain;
2969 2969          immu = domain->dom_immu;
↓ open down ↓ 210 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX