Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 158686 | Differences between
and this patch

Collapse All | Expand All

(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/conftest.sh (-59 lines)
Lines 896-960 Link Here
896
        fi
896
        fi
897
    ;;
897
    ;;
898
898
899
    xen_sanity_check)
900
        #
901
        # Check if the target kernel is a Xen kernel. If so, then exit, since
902
        # the driver doesn't currently work with Xen.
903
        #
904
        RET=1
905
        VERBOSE=$6
906
        FILE="linux/autoconf.h"
907
908
        if [ -n "$IGNORE_XEN_PRESENCE" ]; then
909
            exit 0
910
        fi
911
912
        if [ -f $HEADERS/$FILE -o -f $OUTPUT/include/$FILE ]; then
913
            #
914
            # We are looking at a configured source tree; verify
915
            # that it's not a Xen kernel.
916
            #
917
            echo "#include <linux/autoconf.h>
918
            #ifdef CONFIG_XEN
919
            #error CONFIG_XEN defined!!
920
            #endif
921
            " > conftest$$.c
922
923
            $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
924
            rm -f conftest$$.c
925
926
            if [ -f conftest$$.o ]; then
927
                rm -f conftest$$.o
928
                RET=0
929
            fi
930
        else
931
            CONFIG=$HEADERS/../.config
932
            if [ -f $CONFIG ]; then
933
                if [ -z "$(grep "^CONFIG_XEN=y" $CONFIG)" ]; then
934
                    RET=0
935
                fi
936
            fi
937
        fi
938
939
        if [ "$RET" != "0" ]; then
940
            echo "The kernel you are installing for is a Xen kernel!";
941
            echo "";
942
            echo "The NVIDIA driver does not currently work on Xen kernels. If ";
943
            echo "you are using a stock distribution kernel, please install ";
944
            echo "a variant of this kernel without Xen support; if this is a ";
945
            echo "custom kernel, please install a standard Linux kernel.  Then ";
946
            echo "try installing the NVIDIA kernel module again.";
947
            echo "";
948
            if [ "$VERBOSE" = "full_output" ]; then
949
                echo "*** Failed Xen sanity check. Bailing out! ***";
950
                echo "";
951
            fi
952
            exit 1
953
        else
954
            exit 0
955
        fi
956
    ;;
957
958
    acpi_device_ops_match)
899
    acpi_device_ops_match)
959
        #
900
        #
960
        # Determine if the acpi_device_ops data structure has
901
        # Determine if the acpi_device_ops data structure has
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/Makefile.kbuild (-4 / +1 lines)
Lines 293-307 Link Here
293
nvidiafb-sanity-check:
293
nvidiafb-sanity-check:
294
	@if ! $(CONFTEST) nvidiafb_sanity_check full_output; then exit 1; fi
294
	@if ! $(CONFTEST) nvidiafb_sanity_check full_output; then exit 1; fi
295
295
296
xen-sanity-check:
297
	@if ! $(CONFTEST) xen_sanity_check full_output; then exit 1; fi
298
299
#
296
#
300
# Build the NVIDIA kernel module using Linux KBUILD. This target is used by
297
# Build the NVIDIA kernel module using Linux KBUILD. This target is used by
301
# the "package-install" target below.
298
# the "package-install" target below.
302
#
299
#
303
300
304
module: cc-version-check xen-sanity-check rivafb-sanity-check nvidiafb-sanity-check
301
module: cc-version-check rivafb-sanity-check nvidiafb-sanity-check
305
	@if [ -z "$(PATCHLEVEL)" ]; then \
302
	@if [ -z "$(PATCHLEVEL)" ]; then \
306
	  echo "failed to determine PATCHLEVEL!"; \
303
	  echo "failed to determine PATCHLEVEL!"; \
307
	  exit 1; \
304
	  exit 1; \
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv.c (-1 / +13 lines)
Lines 42-48 Link Here
42
42
43
int nv_pat_enabled = 0;
43
int nv_pat_enabled = 0;
44
44
45
#if !defined(NV_BUILD_NV_PAT_SUPPORT)
45
/*
46
 * disable PAT support if XEN or PREEMPT_RT is configured in kernel
47
 */
48
49
#if defined(CONFIG_XEN) || defined(CONFIG_PREEMPT_RT) || !defined(NV_BUILD_NV_PAT_SUPPORT)
46
static int nv_disable_pat = 1;
50
static int nv_disable_pat = 1;
47
#else
51
#else
48
static int nv_disable_pat = 0;
52
static int nv_disable_pat = 0;
Lines 951-958 Link Here
951
        return;
955
        return;
952
#endif
956
#endif
953
957
958
#if !defined(CONFIG_PREEMPT_RT)
954
    NV_SAVE_FLAGS(eflags);
959
    NV_SAVE_FLAGS(eflags);
955
    NV_CLI();
960
    NV_CLI();
961
#endif
956
    __nv_disable_caches(&cr4);
962
    __nv_disable_caches(&cr4);
957
963
958
    NV_READ_PAT_ENTRIES(pat1, pat2);
964
    NV_READ_PAT_ENTRIES(pat1, pat2);
Lines 963-969 Link Here
963
    NV_WRITE_PAT_ENTRIES(pat1, pat2);
969
    NV_WRITE_PAT_ENTRIES(pat1, pat2);
964
970
965
    __nv_enable_caches(cr4);
971
    __nv_enable_caches(cr4);
972
#if !defined(CONFIG_PREEMPT_RT)
966
    NV_RESTORE_FLAGS(eflags);
973
    NV_RESTORE_FLAGS(eflags);
974
#endif
967
}
975
}
968
976
969
static void __nv_restore_pat_entries(void *info)
977
static void __nv_restore_pat_entries(void *info)
Lines 977-990 Link Here
977
        return;
985
        return;
978
#endif
986
#endif
979
987
988
#if !defined(CONFIG_PREEMPT_RT)
980
    NV_SAVE_FLAGS(eflags);
989
    NV_SAVE_FLAGS(eflags);
981
    NV_CLI();
990
    NV_CLI();
991
#endif
982
    __nv_disable_caches(&cr4);
992
    __nv_disable_caches(&cr4);
983
993
984
    NV_WRITE_PAT_ENTRIES(orig_pat1, orig_pat2);
994
    NV_WRITE_PAT_ENTRIES(orig_pat1, orig_pat2);
985
995
986
    __nv_enable_caches(cr4);
996
    __nv_enable_caches(cr4);
997
#if !defined(CONFIG_PREEMPT_RT)
987
    NV_RESTORE_FLAGS(eflags);
998
    NV_RESTORE_FLAGS(eflags);
999
#endif
988
}
1000
}
989
1001
990
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */
1002
#endif /* defined(NV_BUILD_NV_PAT_SUPPORT) */
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-linux.h (-2 / +12 lines)
Lines 261-267 Link Here
261
 * tiny, and the kernel panics when it is exhausted. try to warn the user that
261
 * tiny, and the kernel panics when it is exhausted. try to warn the user that
262
 * they need to boost the size of their pool.
262
 * they need to boost the size of their pool.
263
 */
263
 */
264
#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32)
264
#if defined(CONFIG_SWIOTLB) && !defined(GFP_DMA32) && !defined(CONFIG_XEN)
265
#define NV_SWIOTLB 1
265
#define NV_SWIOTLB 1
266
#endif
266
#endif
267
267
Lines 666-672 Link Here
666
#  define NV_CLI()                      local_irq_disable()
666
#  define NV_CLI()                      local_irq_disable()
667
#  define NV_SAVE_FLAGS(eflags)         local_save_flags(eflags)
667
#  define NV_SAVE_FLAGS(eflags)         local_save_flags(eflags)
668
#  define NV_RESTORE_FLAGS(eflags)      local_irq_restore(eflags)
668
#  define NV_RESTORE_FLAGS(eflags)      local_irq_restore(eflags)
669
#if defined(CONFIG_PREEMPT_RT)
670
#  define NV_MAY_SLEEP()                (!in_interrupt() && !in_atomic() && !in_softirq())
671
#else
669
#  define NV_MAY_SLEEP()                (!in_interrupt() && !in_atomic())
672
#  define NV_MAY_SLEEP()                (!in_interrupt() && !in_atomic())
673
#endif
670
#  define NV_MODULE_PARAMETER(x)        module_param(x, int, 0)
674
#  define NV_MODULE_PARAMETER(x)        module_param(x, int, 0)
671
#  define NV_MODULE_STRING_PARAMETER(x) module_param(x, charp, 0)
675
#  define NV_MODULE_STRING_PARAMETER(x) module_param(x, charp, 0)
672
676
Lines 821-827 Link Here
821
#define NV_VM_INSERT_PAGE(vma, addr, page) \
825
#define NV_VM_INSERT_PAGE(vma, addr, page) \
822
    vm_insert_page(vma, addr, page)
826
    vm_insert_page(vma, addr, page)
823
#endif
827
#endif
824
#if defined(NV_REMAP_PFN_RANGE_PRESENT)
828
#if defined(CONFIG_XEN)
829
#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
830
    io_remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
831
#elif defined(NV_REMAP_PFN_RANGE_PRESENT)
825
#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
832
#define NV_REMAP_PAGE_RANGE(from, offset, x...) \
826
    remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
833
    remap_pfn_range(vma, from, ((offset) >> PAGE_SHIFT), x)
827
#elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT)
834
#elif defined(NV_REMAP_PAGE_RANGE_5_PRESENT)
Lines 941-946 Link Here
941
        __pte_value;                                    \
948
        __pte_value;                                    \
942
    })
949
    })
943
950
951
#if !defined(CONFIG_XEN)
952
#define phys_to_machine(x) x
953
#endif
944
954
945
#define NV_PAGE_ALIGN(addr)             ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
955
#define NV_PAGE_ALIGN(addr)             ( ((addr) + PAGE_SIZE - 1) / PAGE_SIZE)
946
#define NV_MASK_OFFSET(addr)            ( (addr) & (PAGE_SIZE - 1) )
956
#define NV_MASK_OFFSET(addr)            ( (addr) & (PAGE_SIZE - 1) )
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/nv-vm.c (+3 lines)
Lines 352-357 Link Here
352
352
353
static void nv_flush_caches(void)
353
static void nv_flush_caches(void)
354
{
354
{
355
#if defined(CONFIG_PREEMPT_RT)
356
    if(!nv_pat_enabled) return;
357
#endif
355
#if defined(KERNEL_2_4)
358
#if defined(KERNEL_2_4)
356
    // for 2.4 kernels, just automatically flush the caches and invalidate tlbs
359
    // for 2.4 kernels, just automatically flush the caches and invalidate tlbs
357
    nv_execute_on_all_cpus(cache_flush, NULL);
360
    nv_execute_on_all_cpus(cache_flush, NULL);
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-agp.c (-1 / +1 lines)
Lines 295-301 Link Here
295
295
296
         page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
296
         page_ptr->phys_addr = (ptr->memory[i] & PAGE_MASK);
297
         page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
297
         page_ptr->virt_addr = (unsigned long) __va(page_ptr->phys_addr);
298
         page_ptr->dma_addr  = page_ptr->phys_addr;
298
         page_ptr->dma_addr  = phys_to_machine(page_ptr->phys_addr);
299
    }
299
    }
300
300
301
    return RM_OK;
301
    return RM_OK;
(-)NVIDIA-Linux-x86_64-100.14.11-pkg2.dist/usr/src/nv/os-interface.c (+2 lines)
Lines 552-557 Link Here
552
    MicroSeconds = MilliSeconds * 1000;
552
    MicroSeconds = MilliSeconds * 1000;
553
    tm_end.tv_usec = MicroSeconds;
553
    tm_end.tv_usec = MicroSeconds;
554
    tm_end.tv_sec = 0;
554
    tm_end.tv_sec = 0;
555
#if !defined(CONFIG_XEN) && !defined(CONFIG_PREEMPT_RT)
555
    NV_TIMERADD(&tm_aux, &tm_end, &tm_end);
556
    NV_TIMERADD(&tm_aux, &tm_end, &tm_end);
556
557
557
    /* do we have a full jiffie to wait? */
558
    /* do we have a full jiffie to wait? */
Lines 599-604 Link Here
599
                MicroSeconds = 0;
600
                MicroSeconds = 0;
600
        } while ((jiffies = NV_USECS_TO_JIFFIES(MicroSeconds)) != 0);
601
        } while ((jiffies = NV_USECS_TO_JIFFIES(MicroSeconds)) != 0);
601
    }
602
    }
603
#endif
602
604
603
    if (MicroSeconds > 1000)
605
    if (MicroSeconds > 1000)
604
    {
606
    {

Return to bug 158686