/** * Copyright (C) 2008, Creative Technology Ltd. All Rights Reserved. * * This source file is released under GPL v2 license (no other versions). * See the COPYING file included in the main directory of this source * distribution for the license terms and conditions. * * @File ctvmem.h * * @Brief * This file contains the definition of virtual memory management object * for card device. * * @Author Liu Chun * @Date Mar 28 2008 */ #ifndef CTVMEM_H #define CTVMEM_H #define CT_PTP_NUM 4 /* num of device page table pages */ #include <linux/mutex.h> #include <linux/list.h> #include <linux/pci.h> #include <sound/memalloc.h> /* The chip can handle the page table of 4k pages * (emu20k1 can handle even 8k pages, but we don't use it right now) */ #define CT_PAGE_SIZE 4096 #define CT_PAGE_SHIFT 12 #define CT_PAGE_MASK (~(PAGE_SIZE - 1)) #define CT_PAGE_ALIGN(addr) ALIGN(addr, CT_PAGE_SIZE) struct ct_vm_block { unsigned int addr; /* starting logical addr of this block */ unsigned int size; /* size of this device virtual mem block */ struct list_head list; }; struct snd_pcm_substream; /* Virtual memory management object for card device */ struct ct_vm { struct snd_dma_buffer ptp[CT_PTP_NUM]; /* Device page table pages */ unsigned int size; /* Available addr space in bytes */ struct list_head unused; /* List of unused blocks */ struct list_head used; /* List of used blocks */ struct mutex lock; /* Map host addr (kmalloced/vmalloced) to device logical addr. */ struct ct_vm_block *(*map)(struct ct_vm *, struct snd_pcm_substream *, int size); /* Unmap device logical addr area. */ void (*unmap)(struct ct_vm *, struct ct_vm_block *block); dma_addr_t (*get_ptp_phys)(struct ct_vm *vm, int index); }; int ct_vm_create(struct ct_vm **rvm, struct pci_dev *pci); void ct_vm_destroy(struct ct_vm *vm); #endif /* CTVMEM_H */ net-next.git/tree/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>tree</a><a class='active' href='/cgit.cgi/linux/net-next.git/commit/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/sound/usb/misc/Makefile'> <input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='c8f325a59cfc718d13a50fbc746ed9b415c25e92'/><select name='qt'> <option value='grep'>log msg</option> <option value='author'>author</option> <option value='committer'>committer</option> <option value='range'>range</option> </select> <input class='txt' type='search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/commit/?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>root</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>sound</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/usb?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>usb</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/usb/misc?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>misc</a>/<a href='/cgit.cgi/linux/net-next.git/commit/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>Makefile</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='c8f325a59cfc718d13a50fbc746ed9b415c25e92'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'> <tr><th>author</th><td>Ard Biesheuvel <ard.biesheuvel@linaro.org></td><td class='right'>2017-02-01 17:45:02 +0000</td></tr> <tr><th>committer</th><td>Ingo Molnar <mingo@kernel.org></td><td class='right'>2017-02-01 21:17:49 +0100</td></tr> <tr><th>commit</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>c8f325a59cfc718d13a50fbc746ed9b415c25e92</a> (<a href='/cgit.cgi/linux/net-next.git/patch/sound/usb/misc/Makefile?id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>patch</a>)</td></tr> <tr><th>tree</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/tree/?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>d53fbdac9d0781e39a13b2ac6b2bd258cf3b4140</a> /<a href='/cgit.cgi/linux/net-next.git/tree/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>sound/usb/misc/Makefile</a></td></tr> <tr><th>parent</th><td colspan='2' class='oid'><a href='/cgit.cgi/linux/net-next.git/commit/sound/usb/misc/Makefile?h=nds-private-remove&id=bf29bddf0417a4783da3b24e8c9e017ac649326f'>bf29bddf0417a4783da3b24e8c9e017ac649326f</a> (<a href='/cgit.cgi/linux/net-next.git/diff/sound/usb/misc/Makefile?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92&id2=bf29bddf0417a4783da3b24e8c9e017ac649326f'>diff</a>)</td></tr></table> <div class='commit-subject'>efi/fdt: Avoid FDT manipulation after ExitBootServices()</div><div class='commit-msg'>Some AArch64 UEFI implementations disable the MMU in ExitBootServices(), after which unaligned accesses to RAM are no longer supported. Commit: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") fixed an issue in the memory map handling of the stub FDT code, but inadvertently created an issue with such firmware, by moving some of the FDT manipulation to after the invocation of ExitBootServices(). Given that the stub's libfdt implementation uses the ordinary, accelerated string functions, which rely on hardware handling of unaligned accesses, manipulating the FDT with the MMU off may result in alignment faults. So fix the situation by moving the update_fdt_memmap() call into the callback function invoked by efi_exit_boot_services() right before it calls the ExitBootServices() UEFI service (which is arguably a better place for it anyway) Note that disabling the MMU in ExitBootServices() is not compliant with the UEFI spec, and carries great risk due to the fact that switching from cached to uncached memory accesses halfway through compiler generated code (i.e., involving a stack) can never be done in a way that is architecturally safe. Fixes: abfb7b686a3e ("efi/libstub/arm*: Pass latest memory map to the kernel") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Tested-by: Riku Voipio <riku.voipio@linaro.org> Cc: <stable@vger.kernel.org> Cc: mark.rutland@arm.com Cc: linux-efi@vger.kernel.org Cc: matt@codeblueprint.co.uk Cc: leif.lindholm@linaro.org Cc: linux-arm-kernel@lists.infradead.org Link: http://lkml.kernel.org/r/1485971102-23330-2-git-send-email-ard.biesheuvel@linaro.org Signed-off-by: Ingo Molnar <mingo@kernel.org> </div><div class='diffstat-header'><a href='/cgit.cgi/linux/net-next.git/diff/?h=nds-private-remove&id=c8f325a59cfc718d13a50fbc746ed9b415c25e92'>Diffstat</a> (limited to 'sound/usb/misc/Makefile')</div><table summary='diffstat' class='diffstat'>