Displaying 20 results from an estimated 31 matches for "align_down".
Did you mean:
_align_down
2018 Mar 03
0
[PATCH] mmu: ALIGN_DOWN correct variable
Commit 7110c89bb8852ff8b0f88ce05b332b3fe22bd11e ("mmu: swap out round
for ALIGN") replaced two calls to round/rounddown with ALIGN/ALIGN_DOWN,
but erroneously applied ALIGN_DOWN to a different variable (addr) and left
intended variable (tail) not rounded/ALIGNed.
As a result screen corruption, X lockups are observable. An example of kernel
log of affected system with NV98 card where it was bisected:
nouveau 0000:01:00.0: gr: TRAP_M2MF...
2018 Apr 04
2
nouveau TRAP_M2MF still there on G98
...7 +1354,7 @@ nvkm_vmm_get_locked(struct nvkm_vmm *vmm, bool
> getref, bool mapref, bool sparse,
>
> tail = this->addr + this->size;
> if (vmm->func->page_block && next && next->page != p)
> - tail = ALIGN_DOWN(tail, vmm->func->page_block);
> + tail = rounddown(tail, vmm->func->page_block);
>
> if (addr <= tail && tail - addr >= size) {
> rb_erase(&this->tree, &vmm->free);
>
Alas, it did...
2018 Apr 03
2
nouveau TRAP_M2MF still there on G98
Hi!
In commit da5e45e619b3f101420c38b3006a9ae4f3ad19b0:
> drm/nouveau/mmu: ALIGN_DOWN correct variable
>
> Commit 7110c89bb8852ff8b0f88ce05b332b3fe22bd11e ("mmu: swap out round
> for ALIGN") replaced two calls to round/rounddown with ALIGN/ALIGN_DOWN,
> but erroneously applied ALIGN_DOWN to a different variable (addr) and left
> intended variable (tail)...
2020 Jul 15
2
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
...new_ist;
> + unsigned long *p;
> +
> + if (!sev_es_active())
> + return;
> +
> + /* Read old IST entry */
> + old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
> +
> + /* Make room on the IST stack */
> + if (on_vc_stack(regs->sp))
> + new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist);
> + else
> + new_ist = old_ist - sizeof(old_ist);
> +
> + /* Store old IST entry */
> + p = (unsigned long *)new_ist;
> + *p = old_ist;
> +
> + /* Set new IST entry */
> + this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC],...
2020 Jul 15
2
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
...new_ist;
> + unsigned long *p;
> +
> + if (!sev_es_active())
> + return;
> +
> + /* Read old IST entry */
> + old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
> +
> + /* Make room on the IST stack */
> + if (on_vc_stack(regs->sp))
> + new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist);
> + else
> + new_ist = old_ist - sizeof(old_ist);
> +
> + /* Store old IST entry */
> + p = (unsigned long *)new_ist;
> + *p = old_ist;
> +
> + /* Set new IST entry */
> + this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC],...
2011 Mar 31
0
[LLVMdev] More DWARF problems
...DWARF info that is being emitted by my front end, which has been broken for about a month now. Here's what happens when I attempt to use gdb to debug one of my programs on OS X:
>>
>> gdb stack crawl at point of internal error:
>> [ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
>> [ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die_in_comp_unit+0x65) [0xc0e19]
>> [ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4) [0xcf07f]
>> [ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x29) [0xcf0b3]
>...
2011 Mar 31
2
[LLVMdev] More DWARF problems
...ARF info that is
> being emitted by my front end, which has been broken for about a month now.
> Here's what happens when I attempt to use gdb to debug one of my programs on
> OS X:
>
> gdb stack crawl at point of internal error:
> [ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
> [ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin
> (find_partial_die_in_comp_unit+0x65) [0xc0e19]
> [ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4)
> [0xcf07f]
> [ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x29)
> [0xcf0b3]
&...
2018 Apr 04
0
nouveau TRAP_M2MF still there on G98
...ubdev/mmu/vmm.c
@@ -1354,7 +1354,7 @@ nvkm_vmm_get_locked(struct nvkm_vmm *vmm, bool
getref, bool mapref, bool sparse,
tail = this->addr + this->size;
if (vmm->func->page_block && next && next->page != p)
- tail = ALIGN_DOWN(tail, vmm->func->page_block);
+ tail = rounddown(tail, vmm->func->page_block);
if (addr <= tail && tail - addr >= size) {
rb_erase(&this->tree, &vmm->free);
All best,
Māris.
2018 Apr 04
0
nouveau TRAP_M2MF still there on G98
...mm_get_locked(struct nvkm_vmm *vmm, bool
>> getref, bool mapref, bool sparse,
>>
>> tail = this->addr + this->size;
>> if (vmm->func->page_block && next && next->page != p)
>> - tail = ALIGN_DOWN(tail, vmm->func->page_block);
>> + tail = rounddown(tail, vmm->func->page_block);
>>
>> if (addr <= tail && tail - addr >= size) {
>> rb_erase(&this->tree, &vmm->free);
>...
2011 Mar 30
5
[LLVMdev] More DWARF problems
...down the problem with the DWARF info that is being
emitted by my front end, which has been broken for about a month now. Here's
what happens when I attempt to use gdb to debug one of my programs on OS X:
gdb stack crawl at point of internal error:
[ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
[ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin
(find_partial_die_in_comp_unit+0x65) [0xc0e19]
[ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4)
[0xcf07f]
[ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x29)
[0xcf0b3]
[ 4 ] /usr/libexec/gdb/gdb-i386...
2020 Jul 15
0
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
...; > + if (!sev_es_active())
> > + return;
> > +
> > + /* Read old IST entry */
> > + old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
> > +
> > + /* Make room on the IST stack */
> > + if (on_vc_stack(regs->sp))
> > + new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist);
> > + else
> > + new_ist = old_ist - sizeof(old_ist);
> > +
> > + /* Store old IST entry */
> > + p = (unsigned long *)new_ist;
> > + *p = old_ist;
> > +
> > + /* Set new IST entry */
> > + this_cpu...
2020 Aug 31
1
[PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler
...EXCEPTION_LAST)
> + sp = __this_cpu_ist_top_va(VC2);
> +
> +sync:
> + /*
> + * Found a safe stack - switch to it as if the entry didn't happen via
> + * IST stack. The code below only copies pt_regs, the real switch happens
> + * in assembly code.
> + */
> + sp = ALIGN_DOWN(sp, 8) - sizeof(*regs);
> +
> + regs = (struct pt_regs *)sp;
> + *regs = *eregs;
> +
> + return regs;
> +}
> +#endif
> +
> struct bad_iret_stack {
> void *error_entry_ret;
> struct pt_regs regs;
> --
--
Regards/Gruss,
Boris.
https://people.kernel.org...
2018 Sep 17
0
Re: [PATCH nbdkit v2] common: isaligned: Use a macro instead of relying on implicit truncation.
...ro when we can use a function that is likely to be inlined
anyway?
This is not used in tight loops, so there is no reason to use a macro.
If you want to use a macro, see the kernel align macros:
57 /* @a is a power of 2 value */
58 #define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
59 #define ALIGN_DOWN(x, a) __ALIGN_KERNEL((x) - ((a) - 1), (a))
60 #define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
61 #define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
62 #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
>
> #endif /* NBDKIT...
2011 Mar 30
0
[LLVMdev] More DWARF problems
...em with the DWARF info that is being emitted by my front end, which has been broken for about a month now. Here's what happens when I attempt to use gdb to debug one of my programs on OS X:
>
> gdb stack crawl at point of internal error:
> [ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
> [ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die_in_comp_unit+0x65) [0xc0e19]
> [ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4) [0xcf07f]
> [ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x29) [0xcf0b3]
> [ 4 ] /usr/...
2020 Jul 14
0
[PATCH v4 45/75] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
...enter(struct pt_regs *regs)
+{
+ unsigned long old_ist, new_ist;
+ unsigned long *p;
+
+ if (!sev_es_active())
+ return;
+
+ /* Read old IST entry */
+ old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
+
+ /* Make room on the IST stack */
+ if (on_vc_stack(regs->sp))
+ new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist);
+ else
+ new_ist = old_ist - sizeof(old_ist);
+
+ /* Store old IST entry */
+ p = (unsigned long *)new_ist;
+ *p = old_ist;
+
+ /* Set new IST entry */
+ this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC], new_ist);
+}
+
+void noinstr sev_es_ist_exit(...
2020 Aug 24
0
[PATCH v6 46/76] x86/sev-es: Adjust #VC IST Stack on entering NMI handler
...rly.
+ */
+void noinstr __sev_es_ist_enter(struct pt_regs *regs)
+{
+ unsigned long old_ist, new_ist;
+ unsigned long *p;
+
+ /* Read old IST entry */
+ old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]);
+
+ /* Make room on the IST stack */
+ if (on_vc_stack(regs->sp))
+ new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist);
+ else
+ new_ist = old_ist - sizeof(old_ist);
+
+ /* Store old IST entry */
+ p = (unsigned long *)new_ist;
+ *p = old_ist;
+
+ /* Set new IST entry */
+ this_cpu_write(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC], new_ist);
+}
+
+void noinstr __sev_es_ist_exi...
2011 Apr 03
2
[LLVMdev] More DWARF problems
...ARF info that is
> being emitted by my front end, which has been broken for about a month now.
> Here's what happens when I attempt to use gdb to debug one of my programs on
> OS X:
>
> gdb stack crawl at point of internal error:
> [ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
> [ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin
> (find_partial_die_in_comp_unit+0x65) [0xc0e19]
> [ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4)
> [0xcf07f]
> [ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x29)
> [0xcf0b3]
&...
2011 Apr 02
2
[LLVMdev] More DWARF problems
...; being emitted by my front end, which has been broken for about a month now.
>> Here's what happens when I attempt to use gdb to debug one of my programs on
>> OS X:
>>
>> gdb stack crawl at point of internal error:
>> [ 0 ] /usr/libexec/gdb/gdb-i386-apple-darwin (align_down+0x0) [0x122300]
>> [ 1 ] /usr/libexec/gdb/gdb-i386-apple-darwin
>> (find_partial_die_in_comp_unit+0x65) [0xc0e19]
>> [ 2 ] /usr/libexec/gdb/gdb-i386-apple-darwin (find_partial_die+0x2d4)
>> [0xcf07f]
>> [ 3 ] /usr/libexec/gdb/gdb-i386-apple-darwin (fixup_partial_die+0x...
2023 Aug 30
1
[PATCH] virtio_balloon: Fix endless deflation and inflation on arm64
On 29.08.23 03:54, Gavin Shan wrote:
> The deflation request to the target, which isn't unaligned to the
> guest page size causes endless deflation and inflation actions. For
> example, we receive the flooding QMP events for the changes on memory
> balloon's size after a deflation request to the unaligned target is
> sent for the ARM64 guest, where we have 64KB base page
2020 Aug 24
0
[PATCH v6 48/76] x86/entry/64: Add entry code for #VC handler
...PE_ENTRY ||
+ info.type >= STACK_TYPE_EXCEPTION_LAST)
+ sp = __this_cpu_ist_top_va(VC2);
+
+sync:
+ /*
+ * Found a safe stack - switch to it as if the entry didn't happen via
+ * IST stack. The code below only copies pt_regs, the real switch happens
+ * in assembly code.
+ */
+ sp = ALIGN_DOWN(sp, 8) - sizeof(*regs);
+
+ regs = (struct pt_regs *)sp;
+ *regs = *eregs;
+
+ return regs;
+}
+#endif
+
struct bad_iret_stack {
void *error_entry_ret;
struct pt_regs regs;
--
2.28.0